Skip to content

Commit

Permalink
Fixing unnecessary extra calls to 'afterFind' callback of 'hasMany' a…
Browse files Browse the repository at this point in the history
…ssociated models. Closes #995
  • Loading branch information
ADmad committed Sep 5, 2010
1 parent 82fffe6 commit bfaaa6b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -54,7 +54,7 @@ class DboSource extends DataSource {

/**
* Caches result from query parsing operations. Cached results for both DboSource::name() and
* DboSource::conditions() will be stored here. Method caching uses `crc32()` which is
* DboSource::conditions() will be stored here. Method caching uses `crc32()` which is
* fast but can collisions more easily than other hashing algorithms. If you have problems
* with collisions, set DboSource::$cacheMethods to false.
*
Expand Down Expand Up @@ -519,7 +519,7 @@ function cacheMethod($method, $key, $value = null) {
* because the method uses a simple hashing algorithm it can infrequently have collisions.
* Setting DboSource::$cacheMethods to false will disable the memory cache.
*
* @param mixed $data Either a string with a column to quote. An array of columns to quote or an
* @param mixed $data Either a string with a column to quote. An array of columns to quote or an
* object from DboSource::expression() or DboSource::identifier()
* @return string SQL field
* @access public
Expand Down Expand Up @@ -845,6 +845,10 @@ function read(&$model, $queryData = array(), $recursive = null) {
$stack = array($assoc);
$db->queryAssociation($model, $linkModel, $type, $assoc, $assocData, $array, true, $resultSet, $model->recursive - 1, $stack);
unset($db);

if ($type === 'hasMany') {
$filtered []= $assoc;
}
}
}
}
Expand Down

0 comments on commit bfaaa6b

Please sign in to comment.