From: Alexander Hartmaier Date: Mon, 4 Oct 2010 10:39:24 +0000 (+0200) Subject: docs for if_not_submitted parameter X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=13f5633c09ecbfdd0087815f6a619ea1e9be812d;p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate docs for if_not_submitted parameter --- diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index 024511a..a8db9d2 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -456,10 +456,24 @@ Clearing the relationship: =head2 Treatment of has_many relations -In case the relationship is included but undefined or an empty array, the -related rows will be deleted or their foreign key column set to null depending -on if_not_submitted parameter (set_to_null or delete). -It defaults to undefined which skips both. +If a relationship key is included in the data structure with a value of undef +or an empty array, all existing related rows will be deleted, or their foreign +key columns will be set to null. + +The exact behaviour depends on the nullability of the foreign key columns and +the value of the "if_not_submitted" parameter. The parameter defaults to +undefined which neither nullifies nor deletes. + +When the array contains elements they are updated if they exist, created when +not and deleted if not included. + +=head3 All foreign table columns are nullable + +In this case recursive_update defaults to nullifying the foreign columns. + +=head3 Not all foreign table columns are nullable + +In this case recursive_update deletes the foreign rows. Updating the relationship: