[Bast-commits] r5282 - in DBIx-Class/0.08/trunk/lib/DBIx/Class: . Manual

castaway at dev.catalyst.perl.org castaway at dev.catalyst.perl.org
Tue Dec 30 10:58:19 GMT 2008


Author: castaway
Date: 2008-12-30 10:58:19 +0000 (Tue, 30 Dec 2008)
New Revision: 5282

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Glossary.pod
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm
Log:
Add definitions of relationship and relationship bridge, link to them from the rel docs


Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Glossary.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Glossary.pod	2008-12-29 22:17:37 UTC (rev 5281)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Glossary.pod	2008-12-30 10:58:19 UTC (rev 5282)
@@ -36,6 +36,18 @@
 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<many_to_many> 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

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm	2008-12-29 22:17:37 UTC (rev 5281)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm	2008-12-30 10:58:19 UTC (rev 5282)
@@ -39,6 +39,9 @@
 
 =head1 DESCRIPTION
 
+The word I<Relationship> has a specific meaning in DBIx::Class, see
+the definition in the L<Glossary|DBIx::Class::Manual::Glossary/Relationship>.
+
 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<DBIx::Class> provides. To create efficient database queries,
@@ -102,20 +105,20 @@
 
 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<undef> 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<DBIx::Class::Relationship::Base> 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 @@
 
 =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 @@
 
 =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 @@
 
 =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 @@
 
 =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<many_to_many> is a I<Relationship bridge> which has a specific
+meaning in DBIx::Class, see the definition in the
+L<Glossary|DBIx::Class::Manual::Glossary/Relationship bridge>.
+
 C<many_to_many> 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 




More information about the Bast-commits mailing list