Skip to content
This repository
Browse code

Added warning messages in doc block for validateMany and validateAsso…

…ciated about first param being passed by reference
  • Loading branch information...
commit 00a34f14fe49940ccb13ce9f1bde5c27b61d9362 1 parent 0fb025f
José Lorenzo Rodríguez authored May 10, 2012

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  lib/Cake/Model/Model.php
8  lib/Cake/Model/Model.php
@@ -2100,6 +2100,10 @@ public function saveMany($data = null, $options = array()) {
2100 2100
  * - fieldList: Equivalent to the $fieldList parameter in Model::save()
2101 2101
  * - deep: If set to true, all associated data will be validated as well.
2102 2102
  *
  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
+ *
2103 2107
  * @param array $data Record data to validate. This should be a numerically-indexed array
2104 2108
  * @param array $options Options to use when validating record data (see above), See also $options of validates().
2105 2109
  * @return boolean True on success, or false on failure.
@@ -2301,6 +2305,10 @@ public function saveAssociated($data = null, $options = array()) {
2301 2305
  * - fieldList: Equivalent to the $fieldList parameter in Model::save()
2302 2306
  * - deep: If set to true, not only directly associated data , but deeper nested associated data is validated as well.
2303 2307
  *
  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
+ *
2304 2312
  * @param array $data Record data to validate. This should be an array indexed by association name.
2305 2313
  * @param array $options Options to use when validating record data (see above), See also $options of validates().
2306 2314
  * @return array|boolean If atomic: True on success, or false on failure.

0 notes on commit 00a34f1

Please sign in to comment.
Something went wrong with that request. Please try again.