File Coverage

blib/lib/Test/DBIx/Class/Example/Schema/Result/Company/Employee.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Test::DBIx::Class::Example::Schema::Result::Company::Employee; {
2 15     15   17558 use base 'Test::DBIx::Class::Example::Schema::Result';
  15         24  
  15         2668  
3              
4             __PACKAGE__->table('company_employee');
5              
6             __PACKAGE__->add_columns(
7             fk_company_id => {
8             data_type => 'varchar',
9             size => '36',
10             is_nullable => 0,
11             },
12             fk_employee_id => {
13             data_type => 'varchar',
14             size => '36',
15             is_nullable => 0,
16             },
17             fk_job_id => {
18             data_type => 'varchar',
19             size => '36',
20             is_nullable => 0,
21             },
22             started => {
23             data_type => 'datetime',
24             is_nullable => 0,
25             },
26             ended => {
27             data_type => 'datetime',
28             is_nullable => 0,
29             },
30             );
31              
32             __PACKAGE__->set_primary_key('fk_company_id', 'fk_employee_id');
33              
34             __PACKAGE__->belongs_to(
35             job => 'Test::DBIx::Class::Example::Schema::Result::Job',
36             { 'foreign.job_id' => 'self.fk_job_id' },
37             );
38              
39             __PACKAGE__->belongs_to(
40             company => 'Test::DBIx::Class::Example::Schema::Result::Company',
41             { 'foreign.company_id' => 'self.fk_company_id' },
42             );
43              
44             __PACKAGE__->belongs_to(
45             employee => 'Test::DBIx::Class::Example::Schema::Result::Person::Employee',
46             { 'foreign.employee_id' => 'self.fk_employee_id' },
47             );
48              
49             } 1
50              
51             __END__
52              
53             =head1 NAME
54              
55             Test::DBIx::Class::Example::Schema::Result::Company::Employee - Company To Employee M2M
56              
57             =head1 DESCRIPTION
58              
59             Bridge table between Company and Employee, since each company has many Employees and a
60             given employee can be performed at more than one company.
61              
62             =head1 SEE ALSO
63              
64             The following modules or resources may be of interest.
65              
66             L<DBIx::Class>
67              
68             =head1 AUTHOR
69              
70             John Napiorkowski C<< <jjnapiork@cpan.org> >>
71              
72             =head1 COPYRIGHT & LICENSE
73              
74             Copyright 2009, John Napiorkowski C<< <jjnapiork@cpan.org> >>
75              
76             This program is free software; you can redistribute it and/or modify
77             it under the same terms as Perl itself.
78              
79             =cut