Update Model/Behaviors callback signature to be PHP5.4+ compliant.

This commit is contained in:
Ber Clausen 2013-09-05 10:38:29 -03:00
parent 77c453b2a3
commit c524645738
6 changed files with 33 additions and 14 deletions

View file

@ -141,9 +141,11 @@ class ModelBehavior extends Object {
* will allow you to make the validation fail.
*
* @param Model $model Model using this behavior
* @param array $options Options passed from Model::save().
* @return mixed False or null will abort the operation. Any other result will continue.
* @see Model::save()
*/
public function beforeValidate(Model $model) {
public function beforeValidate(Model $model, $options = array()) {
return true;
}
@ -163,9 +165,11 @@ class ModelBehavior extends Object {
* will abort the save operation.
*
* @param Model $model Model using this behavior
* @param array $options Options passed from Model::save().
* @return mixed False if the operation should abort. Any other result will continue.
* @see Model::save()
*/
public function beforeSave(Model $model) {
public function beforeSave(Model $model, $options = array()) {
return true;
}