From 13f5633c09ecbfdd0087815f6a619ea1e9be812d Mon Sep 17 00:00:00 2001 From: Alexander Hartmaier Date: Mon, 4 Oct 2010 12:39:24 +0200 Subject: [PATCH] docs for if_not_submitted parameter --- lib/DBIx/Class/ResultSet/RecursiveUpdate.pm | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) 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: -- 2.45.2