Skip to content

Commit

Permalink
Changed to filterResults be protected instead of private.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Feb 25, 2011
1 parent 728d9b2 commit 73b3b65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -1081,7 +1081,7 @@ public function read($model, $queryData = array(), $recursive = null) {
return false;
}

$filtered = $this->__filterResults($resultSet, $model);
$filtered = $this->_filterResults($resultSet, $model);

if ($model->recursive > -1) {
foreach ($_associations as $type) {
Expand Down Expand Up @@ -1109,7 +1109,7 @@ public function read($model, $queryData = array(), $recursive = null) {
}
}
}
$this->__filterResults($resultSet, $model, $filtered);
$this->_filterResults($resultSet, $model, $filtered);
}

if (!is_null($recursive)) {
Expand All @@ -1125,9 +1125,8 @@ public function read($model, $queryData = array(), $recursive = null) {
* @param object $model Instance of model to operate against
* @param array $filtered List of classes already filtered, to be skipped
* @return array Array of results that have been filtered through $model->afterFind
* @access private
*/
function __filterResults(&$results, &$model, $filtered = array()) {
protected function _filterResults(&$results, &$model, $filtered = array()) {
$filtering = array();
$count = count($results);

Expand Down Expand Up @@ -1215,7 +1214,7 @@ public function queryAssociation($model, &$linkModel, $type, $association, $asso
}
}
}
$this->__filterResults($fetch, $model);
$this->_filterResults($fetch, $model);
return $this->__mergeHasMany($resultSet, $fetch, $association, $model, $linkModel, $recursive);
} elseif ($type === 'hasAndBelongsToMany') {
$ins = $fetch = array();
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/model/model.php
Expand Up @@ -2175,7 +2175,7 @@ public function find($type = 'first', $query = array()) {
$this->resetAssociations();

if ($query['callbacks'] === true || $query['callbacks'] === 'after') {
$results = $this->__filterResults($results);
$results = $this->_filterResults($results);
}

$this->findQueryType = null;
Expand Down Expand Up @@ -2409,7 +2409,7 @@ protected function _findThreaded($state, $query, $results = array()) {
* @param boolean $primary If this is the primary model results (results from model where the find operation was performed)
* @return array Set of filtered results
*/
private function __filterResults($results, $primary = true) {
protected function _filterResults($results, $primary = true) {
$return = $this->Behaviors->trigger(
'afterFind',
array(&$this, $results, $primary),
Expand Down

0 comments on commit 73b3b65

Please sign in to comment.