X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FBase.pm;h=f31e6850971ce6e3b1013e8438b7db5b227ee9ff;hb=3d618782661512ffb7b263a222e183808170b88a;hp=9797b7c2b3523921c9534bf9330c8c4d7aaf7021;hpb=f8bad7690ec8115ba42c6fe55a5ddb3a0ad2b8dd;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 9797b7c..f31e685 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -102,6 +102,13 @@ related object, but you also want the relationship accessor to double as a column accessor). For C accessors, an add_to_* method is also created, which calls C for the relationship. +=item is_foreign_key_constraint + +If you are using L to create SQL for you and you find that it +is creating constraints where it shouldn't, or not creating them where it +should, set this attribute to a true or false value to override the detection +of when to create constraints. + =back =head2 register_relationship @@ -410,7 +417,7 @@ B relationships.> =over 4 -=item Arguments: (@hashrefs | @objs) +=item Arguments: (\@hashrefs | \@objs) =back @@ -418,18 +425,22 @@ B relationships.> my @roles = $schema->resultset('Role')->search({ role => { '-in' -> ['Fred', 'Barney'] } } ); - $actor->set_roles(@roles); - # Replaces all of $actors previous roles with the two named + $actor->set_roles(\@roles); + # Replaces all of $actor's previous roles with the two named -Replace all the related objects with the given list of objects. This does a -C B to remove the association between the -current object and all related objects, then calls C repeatedly to -link all the new objects. +Replace all the related objects with the given reference to a list of +objects. This does a C B to remove the +association between the current object and all related objects, then calls +C repeatedly to link all the new objects. Note that this means that this method will B delete any objects in the table on the right side of the relation, merely that it will delete the link between them. +Due to a mistake in the original implementation of this method, it will also +accept a list of objects or hash references. This is B and will be +removed in a future version. + =head2 remove_from_$rel B relationships.>