ObjectDB::Relationship::ManyToOne - many to one relationship for ObjectDB
package Article; use strict; use warnings; use base 'ObjectDB'; __PACKAGE__->schema( table => 'article', columns => [qw/ id author_id title /], primary_keys => ['id'], auto_increment => 'id', relationships => { author => { type => 'many to one', class => 'Author', map => {author_id => 'id'} } } ); 1;
Many to one relationship for ObjectDB.
map
Hash reference holding columns mappings.
new
Returns new ObjectDB::Relationship::ManyToOne instance.
to_source
Returns generated join arguments that are passed to the sql generator. Used internally.
Viacheslav Tykhanovskyi, vti@cpan.org.
vti@cpan.org
Copyright (C) 2009, Viacheslav Tykhanovskyi.
This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.
To install ObjectDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ObjectDB
CPAN shell
perl -MCPAN -e shell install ObjectDB
For more information on module installation, please visit the detailed CPAN module installation guide.