[Bast-commits] r4360 - DBIx-Class/0.08/trunk/lib/DBIx/Class

nigel at dev.catalyst.perl.org nigel at dev.catalyst.perl.org
Thu May 8 14:21:33 BST 2008


Author: nigel
Date: 2008-05-08 14:21:33 +0100 (Thu, 08 May 2008)
New Revision: 4360

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
Log:
cascade_copy docs - takes from http://osdir.com/ml/lang.perl.modules.dbix-class/2007-03/msg00106.html

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm	2008-05-07 22:40:30 UTC (rev 4359)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship.pm	2008-05-08 13:21:33 UTC (rev 4360)
@@ -271,6 +271,11 @@
 database-level cascade or restrict will take precedence over a
 DBIx-Class-based cascading delete.
 
+If you copy an object in a class with a C<has_many> relationship, all
+the related objects will be copied as well. To turn this behaviour off,
+pass C<cascade_copy => 0 > in the C<$attr> hashref. The behaviour
+defaults to C<cascade_copy => 1>.
+
 See L<DBIx::Class::Relationship::Base> for documentation on relationship
 methods and valid relationship attributes.
 

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm	2008-05-07 22:40:30 UTC (rev 4359)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm	2008-05-08 13:21:33 UTC (rev 4360)
@@ -547,7 +547,9 @@
 
   my $copy = $orig->copy({ change => $to, ... });
 
-Inserts a new row with the specified changes.
+Inserts a new row with the specified changes. If the row has related
+objects in a C<has_many> then those objects may be copied too depending
+on the C<cascade_copy> relationship attribute.
 
 =cut
 




More information about the Bast-commits mailing list