1 package # hide from PAUSE
2 DBICTest::Schema::Artwork_to_Artist;
4 use base qw/DBICTest::BaseResult/;
7 __PACKAGE__->table('artwork_to_artist');
8 __PACKAGE__->add_columns(
10 data_type => 'integer',
14 data_type => 'integer',
18 __PACKAGE__->set_primary_key(qw/artwork_cd_id artist_id/);
19 __PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_cd_id');
20 __PACKAGE__->belongs_to('artist', 'DBICTest::Schema::Artist', 'artist_id');
22 __PACKAGE__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist',
26 # This is for test purposes only. A regular user does not
27 # need to sanity check the passed-in arguments, this is what
28 # the tests are for :)
29 my @missing_args = grep { ! defined $args->{$_} }
30 qw/self_alias foreign_alias self_resultsource foreign_relname/;
31 confess "Required arguments not supplied to custom rel coderef: @missing_args\n"
35 { "$args->{foreign_alias}.artistid" => { -ident => "$args->{self_alias}.artist_id" },
36 "$args->{foreign_alias}.rank" => { '<' => 10 },
38 $args->{self_rowobj} && {
39 "$args->{foreign_alias}.artistid" => $args->{self_rowobj}->artist_id,
40 "$args->{foreign_alias}.rank" => { '<' => 10 },
46 __PACKAGE__->belongs_to('artist_test_m2m_noopt', 'DBICTest::Schema::Artist',
50 # This is for test purposes only. A regular user does not
51 # need to sanity check the passed-in arguments, this is what
52 # the tests are for :)
53 my @missing_args = grep { ! defined $args->{$_} }
54 qw/self_alias foreign_alias self_resultsource foreign_relname/;
55 confess "Required arguments not supplied to custom rel coderef: @missing_args\n"
59 { "$args->{foreign_alias}.artistid" => { -ident => "$args->{self_alias}.artist_id" },
60 "$args->{foreign_alias}.rank" => { '<' => 10 },