From 1481f82ec1bc4d20683c8e20a6490b75ba80ed04 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Thu, 10 May 2012 00:05:30 -0430 Subject: [PATCH] Added warning messages in doc block for validateMany and validateAssociated about first param being passed by reference --- lib/Cake/Model/Model.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index d24ab16aa..3fa250c0f 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2100,6 +2100,10 @@ class Model extends Object implements CakeEventListener { * - fieldList: Equivalent to the $fieldList parameter in Model::save() * - deep: If set to true, all associated data will be validated as well. * + * Warning: This method could potentially change the passed argument `$data`, + * If you do not want this to happen, make a copy of `$data` before passing it + * to this method + * * @param array $data Record data to validate. This should be a numerically-indexed array * @param array $options Options to use when validating record data (see above), See also $options of validates(). * @return boolean True on success, or false on failure. @@ -2301,6 +2305,10 @@ class Model extends Object implements CakeEventListener { * - fieldList: Equivalent to the $fieldList parameter in Model::save() * - deep: If set to true, not only directly associated data , but deeper nested associated data is validated as well. * + * Warning: This method could potentially change the passed argument `$data`, + * If you do not want this to happen, make a copy of `$data` before passing it + * to this method + * * @param array $data Record data to validate. This should be an array indexed by association name. * @param array $options Options to use when validating record data (see above), See also $options of validates(). * @return array|boolean If atomic: True on success, or false on failure.