Making ModelBehavior::beforeFind() return true by default. Since

returning null causes the find to abort, behaviors should return true if
they are not going to return a query array.
This commit is contained in:
mark_story 2010-12-12 18:04:47 -05:00
parent dc7ff8911d
commit f3445cd941

View file

@ -80,10 +80,13 @@ class ModelBehavior extends Object {
*
* @param object $model Model using this behavior
* @param array $queryData Data used to execute this query, i.e. conditions, order, etc.
* @return mixed False or null will abort the operation. You should array will replace the value of $query.
* @return mixed False or null will abort the operation. You can return an array to replace the
* $query that will be eventually run.
* @access public
*/
public function beforeFind($model, $query) { }
public function beforeFind($model, $query) {
return true;
}
/**
* After find callback. Can be used to modify any results returned by find and findAll.