1 package #hide from pause
2 DBICNGTest::Schema::Result::FriendList;
5 extends 'DBICNGTest::Schema::Result';
10 Zoomwit::tlib::DBIC::Schema::Result::FriendList; An example Friends Class;
18 our $VERSION = '0.01';
23 A Person can have zero or more friends
24 A Person can't be their own friend
25 A Person over 18 can't be friends with Persons under 18 and vis versa.
26 A Person can have friendships that are not mutual.
30 This class defines the following attributes.
32 =head1 PACKAGE METHODS
34 This module defines the following package methods
38 Name of the Physical table in the database
43 ->table('friend_list');
48 Add columns and meta information
52 ID of the person with friends
73 Sets the Primary keys for this table
78 ->set_primary_key(qw/fk_person_id fk_friend_id/);
83 The person that 'owns' the friendship (list)
88 ->belongs_to( befriender => 'DBICNGTest::Schema::Result::Person', {
89 'foreign.person_id' => 'self.fk_person_id' });
94 The actual friend that befriender is listing
99 ->belongs_to( friendee => 'DBICNGTest::Schema::Result::Person', {
100 'foreign.person_id' => 'self.fk_friend_id' });
105 This module defines the following methods.
109 See L<DBIx::Class> for more information regarding authors.
113 You may distribute this code under the same terms as Perl itself.