Skip to content

Commit

Permalink
Document missing options and auto-whitelisting in Model::save().
Browse files Browse the repository at this point in the history
Fixes #1293
  • Loading branch information
mariuswilms committed Jul 14, 2016
1 parent c64674f commit cae1ea7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion data/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,9 @@ public static function instanceMethods(array $methods = null) {
* $post->save(null, array('validate' => false));
* ```
*
* By default only validates and saves fields from the schema (if available). This behavior
* can be controlled via the `'whitelist'` and `'locked'` options.
*
* @see lithium\data\Model::$validates
* @see lithium\data\Model::validates()
* @see lithium\data\Entity::errors()
Expand All @@ -1224,7 +1227,10 @@ public static function instanceMethods(array $methods = null) {
* correspond to the optional `'on'` key in validation rules. They will be passed
* to the validates() method if `'validate'` is not `false`.
* - `'whitelist'` _array_: An array of fields that are allowed to be saved to this
* record.
* record. When unprovided will - if available - default to fields of the current
* schema and the `'locked'` option is not `false`.
* - `'locked'` _boolean_: Whether to use schema for saving just fields from the
* schema or not. Defaults to `true`.
* @return boolean Returns `true` on a successful save operation, `false` on failure.
* @filter
*/
Expand Down

0 comments on commit cae1ea7

Please sign in to comment.