X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship.pm;h=4dee96b2239cf482421dc51ed1532012f917d6bc;hb=9c0df5f32b68e23c670c89ce6cdbff60b4bd0ed0;hp=3ee93ff09c427d32720476bf5a3248fe86f219e7;hpb=7a2c1380cfeb48e9a4fc2b5cfa422584035afb1e;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index 3ee93ff..4dee96b 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -60,6 +60,7 @@ this: my $fred = $schema->resultset('Author')->find({ Name => 'Fred' }); my $fredsbooks = $schema->resultset('Book')->search({ Author => $fred->ID }); + With a has_many relationship called "books" on Author (see below for details), we can do this instead: @@ -270,6 +271,11 @@ pass C<< cascade_delete => 0 >> in the C<$attr> hashref. However, any 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 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 for documentation on relationship methods and valid relationship attributes.