X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FBase.pm;h=034e5cc8eef0892d54d5190fc76df7511d2b0ee7;hb=045120e6a16429e7475e129bff3cd0d567eb4a89;hp=6e6a4f498aac5b4f35a9791950f7ace02935e484;hpb=75d079145a507a0e5ff89b2676d383f4fd1a5511;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 6e6a4f4..034e5cc 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -252,6 +252,21 @@ sub find_or_create_related { return $self->find_related(@_) || $self->create_related(@_); } +=head2 update_or_create_related + + my $updated_item = $obj->update_or_create_related('relname', \%col_data, \%attrs?); + +Update or create an item of a related class. See +L for details. + +=cut + +sub update_or_create_related { + my $self = shift; + my $rel = shift; + return $self->related_resultset($rel)->update_or_create(@_); +} + =head2 set_from_related $book->set_from_related('author', $author_obj);