Skip to content

Commit

Permalink
Removed the ReflectionClass when filtering results. The Reflection ju…
Browse files Browse the repository at this point in the history
…st help in big data.
  • Loading branch information
jrbasso committed Feb 26, 2011
1 parent d7991aa commit 0e30042
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -1127,8 +1127,6 @@ public function read($model, $queryData = array(), $recursive = null) {
* @return array Array of results that have been filtered through $model->afterFind
*/
protected function _filterResults(&$results, Model $model, $filtered = array()) {
static $haveCallback = array();

$current = current($results);
if (!is_array($current)) {
return array();
Expand All @@ -1140,14 +1138,6 @@ protected function _filterResults(&$results, Model $model, $filtered = array())
continue;
}
$linkedModel = $model->{$className};
$linkedClass = get_class($linkedModel);
if (!isset($haveCallback[$linkedClass])) {
$ref = new ReflectionClass($linkedModel);
$haveCallback[$linkedClass] = $ref->getMethod('afterFind')->class !== 'Model';
}
if ($haveCallback[$linkedClass] !== true) {
continue;
}
$filtering[] = $className;
foreach ($results as &$result) {
$data = $linkedModel->afterFind(array(array($className => $result[$className])), false);
Expand Down

0 comments on commit 0e30042

Please sign in to comment.