1 package # hide from PAUSE
2 DBICTest::Schema::Artwork_to_Artist;
7 use base qw/DBICTest::BaseResult/;
10 __PACKAGE__->table('artwork_to_artist');
11 __PACKAGE__->add_columns(
13 data_type => 'integer',
17 data_type => 'integer',
21 __PACKAGE__->set_primary_key(qw/artwork_cd_id artist_id/);
22 __PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_cd_id');
23 __PACKAGE__->belongs_to('artist', 'DBICTest::Schema::Artist', 'artist_id');
25 __PACKAGE__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist',
29 # This is for test purposes only. A regular user does not
30 # need to sanity check the passed-in arguments, this is what
31 # the tests are for :)
32 my @missing_args = grep { ! defined $args->{$_} }
33 qw/self_alias foreign_alias self_resultsource foreign_relname/;
34 confess "Required arguments not supplied to custom rel coderef: @missing_args\n"
38 { "$args->{foreign_alias}.artistid" => { -ident => "$args->{self_alias}.artist_id" },
39 "$args->{foreign_alias}.rank" => { '<' => 10 },
41 $args->{self_rowobj} && {
42 "$args->{foreign_alias}.artistid" => $args->{self_rowobj}->artist_id,
43 "$args->{foreign_alias}.rank" => { '<' => 10 },
49 __PACKAGE__->belongs_to('artist_test_m2m_noopt', 'DBICTest::Schema::Artist',
53 # This is for test purposes only. A regular user does not
54 # need to sanity check the passed-in arguments, this is what
55 # the tests are for :)
56 my @missing_args = grep { ! defined $args->{$_} }
57 qw/self_alias foreign_alias self_resultsource foreign_relname/;
58 confess "Required arguments not supplied to custom rel coderef: @missing_args\n"
62 { "$args->{foreign_alias}.artistid" => { -ident => "$args->{self_alias}.artist_id" },
63 "$args->{foreign_alias}.rank" => { '<' => 10 },