X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSource.pm;h=a11f97f049c8cd8fa4d39638b55fd0b4aae82e02;hb=ffdf4f11299b7dc0f9c57521688823f7cd1ed19f;hp=3d06ba93c04cb613733a8ef44858427ea786b673;hpb=17cab2f096f05c297fb7cd51fa1502616dabd844;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 3d06ba9..a11f97f 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -13,7 +13,7 @@ use base qw/DBIx::Class/; __PACKAGE__->mk_group_accessors('simple' => qw/_ordered_columns _columns _primaries _unique_constraints name resultset_attributes schema from _relationships column_info_from_storage source_info - source_name _indexes/); + source_name/); __PACKAGE__->mk_group_accessors('component_class' => qw/resultset_class result_class/); @@ -55,7 +55,6 @@ sub new { $new->{_relationships} = { %{$new->{_relationships}||{}} }; $new->{name} ||= "!!NAME NOT SET!!"; $new->{_columns_info_loaded} ||= 0; - $new->_indexes([]) unless $new->_indexes; return $new; } @@ -450,30 +449,6 @@ See also: L sub storage { shift->schema->storage; } -=head2 add_index - -Add an index to the result source. This has no effect for DBIx::Class - it is -just used for creating SQL with L. Takes the same arguments -as L. - -=cut - -sub add_index { - my ($self, $idx) = @_; - - push @{ $self->_indexes }, $idx; -} - -=head2 indexes - -Returns list of secondary (i.e. non unique) indexes created on this table. - -=cut - -sub indexes { - return @{ shift->_indexes }; -} - =head2 add_relationship $source->add_relationship('relname', 'related_source', $cond, $attrs); @@ -665,7 +640,7 @@ sub reverse_relationship_info { my $otherrel_info = $othertable->relationship_info($otherrel); my $back = $othertable->related_source($otherrel); - next unless $back->name eq $self->name; + next unless $back->source_name eq $self->source_name; my @othertestconds; @@ -1005,7 +980,9 @@ but is cached from then on unless resultset_class changes. Set the class of the resultset, this is useful if you want to create your own resultset methods. Create your own class derived from -L, and set it here. +L, and set it here. If called with no arguments, +this method returns the name of the existing resultset class, if one +exists. =head2 resultset_attributes @@ -1082,6 +1059,15 @@ sub throw_exception { } } +=head2 sqlt_deploy_hook($sqlt_table) + +An optional sub which you can declare in your own Schema class that will get +passed the L object when you deploy the schema +via L or L. + +For an example of what you can do with this, see +L. + =head1 AUTHORS Matt S. Trout