From 6f217c131f46462543ff8a4c94d4793ae829541a Mon Sep 17 00:00:00 2001 From: inoas Date: Thu, 15 Sep 2016 11:14:27 +0200 Subject: [PATCH 1/3] Disable marshalling of nested data docs + link Note: I will still have to dig for the Sphinx syntax to reference that given link + chapter --- en/orm/saving-data.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/en/orm/saving-data.rst b/en/orm/saving-data.rst index cbfb204b53..590958c39e 100644 --- a/en/orm/saving-data.rst +++ b/en/orm/saving-data.rst @@ -211,6 +211,12 @@ associations should be marshalled:: ] ]); +You may also disable marshalling of possible nested associations like so: + + $entity = $articles->newEntity($data, ['associated' => []]); + // or... + $entity = $articles->patchEntity($entity, $data, ['associated' => []]); + The above indicates that the 'Tags', 'Comments' and 'Users' for the Comments should be marshalled. Alternatively, you can use dot notation for brevity:: @@ -236,6 +242,8 @@ change the validation set to be used per association:: 'Comments.Users' => ['validate' => 'signup'] ] ]); + +Read more about using different validators: http://book.cakephp.org/3.0/en/orm/validation.html#using-a-different-validation-set-for-associations The following diagram gives an overview of what happens inside the ``newEntity()`` or ``patchEntity()`` method: From df9721ee6460a3d2bfb2386beeaf2eb62704bf1f Mon Sep 17 00:00:00 2001 From: inoas Date: Thu, 15 Sep 2016 11:55:28 +0200 Subject: [PATCH 2/3] Update link --- en/orm/saving-data.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/en/orm/saving-data.rst b/en/orm/saving-data.rst index 590958c39e..ac45afcf96 100644 --- a/en/orm/saving-data.rst +++ b/en/orm/saving-data.rst @@ -242,8 +242,9 @@ change the validation set to be used per association:: 'Comments.Users' => ['validate' => 'signup'] ] ]); - -Read more about using different validators: http://book.cakephp.org/3.0/en/orm/validation.html#using-a-different-validation-set-for-associations + +The :ref:`using-different-validators-per-association chapter has more information on how to +use different validators for associated marshalling. The following diagram gives an overview of what happens inside the ``newEntity()`` or ``patchEntity()`` method: From 911fc11f41ce23c702b2c19a5c56bdfa78a60dc6 Mon Sep 17 00:00:00 2001 From: inoas Date: Fri, 16 Sep 2016 04:33:44 +0200 Subject: [PATCH 3/3] fix docs syntax --- en/orm/saving-data.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/orm/saving-data.rst b/en/orm/saving-data.rst index ac45afcf96..f76ac22275 100644 --- a/en/orm/saving-data.rst +++ b/en/orm/saving-data.rst @@ -211,7 +211,7 @@ associations should be marshalled:: ] ]); -You may also disable marshalling of possible nested associations like so: +You may also disable marshalling of possible nested associations like so:: $entity = $articles->newEntity($data, ['associated' => []]); // or... @@ -243,7 +243,7 @@ change the validation set to be used per association:: ] ]); -The :ref:`using-different-validators-per-association chapter has more information on how to +The :ref:`using-different-validators-per-association` chapter has more information on how to use different validators for associated marshalling. The following diagram gives an overview of what happens inside the