Skip to content
Permalink
Browse files

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.
  • Loading branch information...
markstory committed Dec 12, 2010
1 parent dc7ff89 commit f3445cd94152c478fc30700307a8c824815574ca
Showing with 5 additions and 2 deletions.
  1. +5 −2 cake/libs/model/model_behavior.php
@@ -80,10 +80,13 @@ function cleanup($model) {
*
* @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.

0 comments on commit f3445cd

Please sign in to comment.
You can’t perform that action at this time.