Skip to content

Commit 00a34f1

Browse files
committed
Added warning messages in doc block for validateMany and validateAssociated about first param being passed by reference
1 parent 0fb025f commit 00a34f1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/Cake/Model/Model.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,10 @@ public function saveMany($data = null, $options = array()) {
21002100
* - fieldList: Equivalent to the $fieldList parameter in Model::save()
21012101
* - deep: If set to true, all associated data will be validated as well.
21022102
*
2103+
* Warning: This method could potentially change the passed argument `$data`,
2104+
* If you do not want this to happen, make a copy of `$data` before passing it
2105+
* to this method
2106+
*
21032107
* @param array $data Record data to validate. This should be a numerically-indexed array
21042108
* @param array $options Options to use when validating record data (see above), See also $options of validates().
21052109
* @return boolean True on success, or false on failure.
@@ -2301,6 +2305,10 @@ public function saveAssociated($data = null, $options = array()) {
23012305
* - fieldList: Equivalent to the $fieldList parameter in Model::save()
23022306
* - deep: If set to true, not only directly associated data , but deeper nested associated data is validated as well.
23032307
*
2308+
* Warning: This method could potentially change the passed argument `$data`,
2309+
* If you do not want this to happen, make a copy of `$data` before passing it
2310+
* to this method
2311+
*
23042312
* @param array $data Record data to validate. This should be an array indexed by association name.
23052313
* @param array $options Options to use when validating record data (see above), See also $options of validates().
23062314
* @return array|boolean If atomic: True on success, or false on failure.

0 commit comments

Comments
 (0)