| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test::DBIx::Class::Example::Schema::Result::Person; { |
|
2
|
15
|
|
|
15
|
|
6690
|
use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
|
15
|
|
|
|
|
26
|
|
|
|
15
|
|
|
|
|
2216
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
__PACKAGE__->table('person'); |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->add_columns( |
|
7
|
|
|
|
|
|
|
person_id => { |
|
8
|
|
|
|
|
|
|
data_type => 'varchar', |
|
9
|
|
|
|
|
|
|
size => '36', |
|
10
|
|
|
|
|
|
|
is_nullable => 0, |
|
11
|
|
|
|
|
|
|
}, |
|
12
|
|
|
|
|
|
|
name => { |
|
13
|
|
|
|
|
|
|
data_type => 'varchar', |
|
14
|
|
|
|
|
|
|
size => '24', |
|
15
|
|
|
|
|
|
|
is_nullable => 0, |
|
16
|
|
|
|
|
|
|
}, |
|
17
|
|
|
|
|
|
|
age => { |
|
18
|
|
|
|
|
|
|
data_type => 'integer', |
|
19
|
|
|
|
|
|
|
is_nullable => 0, |
|
20
|
|
|
|
|
|
|
}, |
|
21
|
|
|
|
|
|
|
email => { |
|
22
|
|
|
|
|
|
|
data_type => 'varchar', |
|
23
|
|
|
|
|
|
|
size=>'128', |
|
24
|
|
|
|
|
|
|
is_nullable => 1, |
|
25
|
|
|
|
|
|
|
}, |
|
26
|
|
|
|
|
|
|
created => { |
|
27
|
|
|
|
|
|
|
data_type => 'timestamp', |
|
28
|
|
|
|
|
|
|
set_on_create => 1, |
|
29
|
|
|
|
|
|
|
is_nullable => 0, |
|
30
|
|
|
|
|
|
|
}, |
|
31
|
|
|
|
|
|
|
); |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__PACKAGE__->set_primary_key('person_id'); |
|
34
|
|
|
|
|
|
|
__PACKAGE__->uuid_columns('person_id'); |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__PACKAGE__->has_many( |
|
37
|
|
|
|
|
|
|
phone_rs => 'Test::DBIx::Class::Example::Schema::Result::Phone', |
|
38
|
|
|
|
|
|
|
{ 'foreign.fk_person_id' => 'self.person_id' }, |
|
39
|
|
|
|
|
|
|
); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__PACKAGE__->might_have( |
|
42
|
|
|
|
|
|
|
employee => 'Test::DBIx::Class::Example::Schema::Result::Person::Employee', |
|
43
|
|
|
|
|
|
|
{ |
|
44
|
|
|
|
|
|
|
'foreign.employee_id' => 'self.person_id', |
|
45
|
|
|
|
|
|
|
}, |
|
46
|
|
|
|
|
|
|
); |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__PACKAGE__->might_have( |
|
49
|
|
|
|
|
|
|
artist => 'Test::DBIx::Class::Example::Schema::Result::Person::Artist', |
|
50
|
|
|
|
|
|
|
{ |
|
51
|
|
|
|
|
|
|
'foreign.artist_id' => 'self.person_id', |
|
52
|
|
|
|
|
|
|
}, |
|
53
|
|
|
|
|
|
|
); |
|
54
|
|
|
|
|
|
|
} 1 |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 NAME |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Test::DBIx::Class::Example::Schema::Result::Person - The base result class |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
A Person has many Phone number and might be an employee. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Sample result class for testing and for other component authors |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The following modules or resources may be of interest. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
L<DBIx::Class> |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 AUTHOR |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
John Napiorkowski C<< <jjnapiork@cpan.org> >> |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Copyright 2009, John Napiorkowski C<< <jjnapiork@cpan.org> >> |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
|
85
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |