DBIx::Class::Relationship - Inter-table relationships
This class handles relationships between the tables in your database model. It allows your to set up relationships, and to perform joins on searches.
This POD details only the convenience methods for setting up standard relationship types. For more information see ::Relationship::Base
All convenience methods take a signature of the following format -
__PACKAGE__>method_name('relname', 'Foreign::Class', $join?, $attrs?);
my $f_obj = $obj->relname;
Creates a one-one relationship with another class; defaults to PK-PK for the join condition unless a condition is specified.
Creates an optional one-one relationship with another class; defaults to PK-PK for the join condition unless a condition is specified.
my @f_obj = $obj->relname($cond?, $attrs?); my $f_result_set = $obj->relname($cond?, $attrs?); $obj->add_to_relname(\%col_data);
Creates a one-many relationship with another class;
my $f_obj = $obj->relname; $obj->relname($new_f_obj);
Creates a relationship where we store the foreign class' PK; if $join is a column name instead of a condition that is assumed to be the FK, if not has_many assumes the FK is the relname is that is a column on the current class.
Matt S. Trout <mst@shadowcatsystems.co.uk>
You may distribute this code under the same terms as Perl itself.
To install DBIx::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class
CPAN shell
perl -MCPAN -e shell install DBIx::Class
For more information on module installation, please visit the detailed CPAN module installation guide.