line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::DBIx::Class::Example::Schema::Result::Person::Artist; { |
2
|
15
|
|
|
15
|
|
12311
|
use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
15
|
|
|
|
|
23
|
|
|
15
|
|
|
|
|
2255
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
__PACKAGE__->table('person_artist'); |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->add_columns( |
7
|
|
|
|
|
|
|
artist_id => { |
8
|
|
|
|
|
|
|
data_type => 'varchar', |
9
|
|
|
|
|
|
|
size => '36', |
10
|
|
|
|
|
|
|
is_nullable => 0, |
11
|
|
|
|
|
|
|
}, |
12
|
|
|
|
|
|
|
created => { |
13
|
|
|
|
|
|
|
data_type => 'timestamp', |
14
|
|
|
|
|
|
|
set_on_create => 1, |
15
|
|
|
|
|
|
|
is_nullable => 0, |
16
|
|
|
|
|
|
|
}, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
__PACKAGE__->set_primary_key('artist_id'); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__PACKAGE__->belongs_to( |
22
|
|
|
|
|
|
|
person => 'Test::DBIx::Class::Example::Schema::Result::Person', |
23
|
|
|
|
|
|
|
{ 'foreign.person_id' => 'self.artist_id'}, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__PACKAGE__->has_many( |
27
|
|
|
|
|
|
|
cd_artists => 'Test::DBIx::Class::Example::Schema::Result::CD::Artist', |
28
|
|
|
|
|
|
|
{ 'foreign.fk_artist_id' => 'self.artist_id'} |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->many_to_many( |
32
|
|
|
|
|
|
|
cds => 'cd_artists', 'cd', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} 1 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Test::DBIx::Class::Example::Schema::Result::Person::Artist - Artist Role |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Some Persons are artists. Each Artist works contributes to one or more CDs. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 SEE ALSO |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
The following modules or resources may be of interest. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
L<DBIx::Class> |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
John Napiorkowski C<< <jjnapiork@cpan.org> >> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Copyright 2009, John Napiorkowski C<< <jjnapiork@cpan.org> >> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
62
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |