X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FBasicRels.pm;h=7a6f520aa838e4850b89723efb62893d142247ba;hb=0f6ac8bbd6575d44fcb30cefcb5e387bb09d8b79;hp=13948afa497930776324a3439cd791a816a27d90;hpb=7411204b288b1df6416832707a8a6ce11e2ab3d8;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/BasicRels.pm b/t/lib/DBICTest/Schema/BasicRels.pm index 13948af..7a6f520 100644 --- a/t/lib/DBICTest/Schema/BasicRels.pm +++ b/t/lib/DBICTest/Schema/BasicRels.pm @@ -15,10 +15,19 @@ DBICTest::Schema::Artist->add_relationship( onekeys => 'DBICTest::Schema::OneKey', { 'foreign.artist' => 'self.artistid' } ); - +DBICTest::Schema::Artist->add_relationship( + artist_undirected_maps => 'DBICTest::Schema::ArtistUndirectedMap', + [{'foreign.id1' => 'self.artistid'}, {'foreign.id2' => 'self.artistid'}], + { accessor => 'multi' } +); +DBICTest::Schema::ArtistUndirectedMap->add_relationship( + 'mapped_artists', 'DBICTest::Schema::Artist', + [{'foreign.artistid' => 'self.id1'}, {'foreign.artistid' => 'self.id2'}] +); DBICTest::Schema::CD->add_relationship( artist => 'DBICTest::Schema::Artist', { 'foreign.artistid' => 'self.artist' }, + { accessor => 'filter' }, ); DBICTest::Schema::CD->add_relationship( tracks => 'DBICTest::Schema::Track', @@ -34,7 +43,7 @@ DBICTest::Schema::CD->add_relationship( DBICTest::Schema::CD->add_relationship( liner_notes => 'DBICTest::Schema::LinerNotes', { 'foreign.liner_id' => 'self.cdid' }, - { join_type => 'LEFT' } + { join_type => 'LEFT', accessor => 'single' } ); DBICTest::Schema::CD->add_relationship( cd_to_producer => 'DBICTest::Schema::CD_to_Producer', @@ -62,7 +71,8 @@ DBICTest::Schema::SelfRef->add_relationship( DBICTest::Schema::Tag->add_relationship( cd => 'DBICTest::Schema::CD', - { 'foreign.cdid' => 'self.cd' } + { 'foreign.cdid' => 'self.cd' }, + { accessor => 'single' } ); DBICTest::Schema::Track->add_relationship( @@ -90,5 +100,6 @@ DBICTest::Schema::CD_to_Producer->add_relationship( # now the Helpers DBICTest::Schema::CD->many_to_many( 'producers', 'cd_to_producer', 'producer'); +DBICTest::Schema::CD->many_to_many( 'producers_sorted', 'cd_to_producer', 'producer', { order_by => 'producer.name' }); 1;