line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::DBIx::Class::Example::Schema::Result::Person::Employee; { |
2
|
15
|
|
|
15
|
|
12956
|
use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
15
|
|
|
|
|
25
|
|
|
15
|
|
|
|
|
2194
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
__PACKAGE__->table('person_employee'); |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->add_columns( |
7
|
|
|
|
|
|
|
employee_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('employee_id'); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__PACKAGE__->belongs_to( |
22
|
|
|
|
|
|
|
person => 'Test::DBIx::Class::Example::Schema::Result::Person', |
23
|
|
|
|
|
|
|
{ 'foreign.person_id' => 'self.employee_id'}, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__PACKAGE__->has_many( |
27
|
|
|
|
|
|
|
company_employee_rs => 'Test::DBIx::Class::Example::Schema::Result::Company::Employee', |
28
|
|
|
|
|
|
|
{ 'foreign.fk_employee_id' => 'self.employee_id'} |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->many_to_many( |
32
|
|
|
|
|
|
|
companies => 'company_emplopyee_rs', 'company', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} 1 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Test::DBIx::Class::Example::Schema::Result::Person::Employee - Employee Role |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Some Persons are employees. Each Employee works at one or more companies. |
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 |