1 package #hide from pause
2 DBICNGTest::Schema::Result::Person;
6 extends 'DBICNGTest::Schema::Result';
11 DBICNGTest::Schema::Result::Person; An example Person Class;
15 Tests for this type of FK relationship
19 This class defines the following attributes.
23 attribute for the created column
37 =head1 PACKAGE METHODS
39 This module defines the following package methods
43 Name of the Physical table in the database
53 Add columns and meta information
57 Primary Key which is an auto generated autoinc
61 foreign key to the Gender table
73 When the person was added to the database
94 data_type=>'datetime',
95 default_value=>'date("now")',
101 Sets the Primary keys for this table
106 ->set_primary_key(qw/person_id/);
111 Each Person might have a resultset of friendlist
117 friendlist => 'DBICNGTest::Schema::Result::FriendList',
118 {'foreign.fk_person_id' => 'self.person_id'});
128 ->belongs_to( gender => 'DBICNGTest::Schema::Result::Gender', {
129 'foreign.gender_id' => 'self.fk_gender_id' });
134 A resultset of the people listing me as a friend (if any)
139 ->belongs_to( fanlist => 'DBICNGTest::Schema::Result::FriendList', {
140 'foreign.fk_friend_id' => 'self.person_id' });
145 A resultset of Persons who are in my FriendList
150 ->many_to_many( friends => 'friendlist', 'friend' );
155 A resultset of people that have me in their friendlist
160 ->many_to_many( fans => 'fanlist', 'befriender' );
165 This module defines the following methods.
169 See L<DBIx::Class> for more information regarding authors.
173 You may distribute this code under the same terms as Perl itself.