From: Jess Robinson Date: Tue, 30 Dec 2008 10:58:19 +0000 (+0000) Subject: Add definitions of relationship and relationship bridge, link to them from the rel... X-Git-Tag: v0.08240~206 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7cf4ae7a66b75a490eec84ce154bf306e1ff8744;p=dbsrgits%2FDBIx-Class.git Add definitions of relationship and relationship bridge, link to them from the rel docs --- diff --git a/lib/DBIx/Class/Manual/Glossary.pod b/lib/DBIx/Class/Manual/Glossary.pod index 818e88a..a70ffa1 100644 --- a/lib/DBIx/Class/Manual/Glossary.pod +++ b/lib/DBIx/Class/Manual/Glossary.pod @@ -36,6 +36,18 @@ Object-relational mapping, or Object-relationship modelling. Either way it's a method of mapping the contents of database tables (rows), to objects in programming-language-space. DBIx::Class is an ORM. +=head2 Relationship + +In DBIx::Class a relationship defines the connection between exactly +two tables. The relationship condition lists the columns in each table +that contain the same values. It is used to output an SQL JOIN +condition between the tables. + +=head2 Relationship bridge + +A relationship bridge, such as C defines an accessor to +retrieve row contents across multiple relationships. + =head2 ResultSet This is an object representing a set of data. It can either be an diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index 3479ac2..67e4f68 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -39,6 +39,9 @@ See L for more. =head1 DESCRIPTION +The word I has a specific meaning in DBIx::Class, see +the definition in the L. + This class provides methods to set up relationships between the tables in your database model. Relationships are the most useful and powerful technique that L provides. To create efficient database queries, @@ -102,20 +105,20 @@ L. All helper methods are called similar to the following template: - __PACKAGE__->$method_name('relname', 'Foreign::Class', $cond, $attrs); + __PACKAGE__->$method_name('relname', 'Foreign::Class', \%cond | \@cond, \%attrs); Both C<$cond> and C<$attrs> are optional. Pass C for C<$cond> if -you want to use the default value for it, but still want to set C<$attrs>. +you want to use the default value for it, but still want to set C<\%attrs>. See L for documentation on the -attrubutes that are allowed in the C<$attrs> argument. +attrubutes that are allowed in the C<\%attrs> argument. =head2 belongs_to =over 4 -=item Arguments: $accessor_name, $related_class, $our_fk_column|\%cond|\@cond?, \%attr? +=item Arguments: $accessor_name, $related_class, $our_fk_column|\%cond|\@cond?, \%attrs? =back @@ -225,7 +228,7 @@ which can be assigned to relationships as well. =over 4 -=item Arguments: $accessor_name, $related_class, $their_fk_column|\%cond|\@cond?, \%attr? +=item Arguments: $accessor_name, $related_class, $their_fk_column|\%cond|\@cond?, \%attrs? =back @@ -358,7 +361,7 @@ which can be assigned to relationships as well. =over 4 -=item Arguments: $accessor_name, $related_class, $their_fk_column|\%cond|\@cond?, \%attr? +=item Arguments: $accessor_name, $related_class, $their_fk_column|\%cond|\@cond?, \%attrs? =back @@ -442,7 +445,7 @@ which can be assigned to relationships as well. =over 4 -=item Arguments: $accessor_name, $related_class, $their_fk_column|\%cond|\@cond?, \%attr? +=item Arguments: $accessor_name, $related_class, $their_fk_column|\%cond|\@cond?, \%attrs? =back @@ -529,10 +532,14 @@ which can be assigned to relationships as well. =over 4 -=item Arguments: $accessor_name, $link_rel_name, $foreign_rel_name, \%attr? +=item Arguments: $accessor_name, $link_rel_name, $foreign_rel_name, \%attrs? =back +C is a I which has a specific +meaning in DBIx::Class, see the definition in the +L. + C is not strictly a relationship in its own right. Instead, it is a bridge between two resultsets which provide the same kind of convenience accessors as true relationships provide. Although the accessor will return a