Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@lorenzo lorenzo authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/Cake/Model/Model.php
View
8 lib/Cake/Model/Model.php
@@ -2100,6 +2100,10 @@ public function saveMany($data = null, $options = array()) {
* - 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 @@ public function saveAssociated($data = null, $options = array()) {
* - 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.
Please sign in to comment.
Something went wrong with that request. Please try again.