X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FBase.pm;h=8409165c83a5f091757718b0b2ea0023fdab600b;hb=096f421241e5abd4274e4344b873b8570ab17d43;hp=3e74d54bd4b09b76409e96470b345921a448931a;hpb=4d87db01f2e16c82b74bb9681ebd605acd6dbd37;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 3e74d54..8409165 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -67,7 +67,7 @@ Each key-value pair provided in a hashref will be used as Ced conditions. To add an Ced condition, use an arrayref of hashrefs. See the L documentation for more details. -Valid attributes are as follows: +In addition to standard result set attributes, the following attributes are also valid: =over 4 @@ -223,7 +223,7 @@ sub count_related { my $new_obj = $obj->new_related('relname', \%col_data); Create a new item of the related foreign class. If called on a -L object, it will magically +L object, it will magically set any foreign key columns of the new object to the related primary key columns of the source object for you. The newly created item will not be saved into your storage until you call L @@ -410,7 +410,7 @@ B relationships.> =over 4 -=item Arguments: (@hashrefs | @objs) +=item Arguments: (\@hashrefs | \@objs) =back @@ -418,18 +418,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.>