mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Removed the ReflectionClass when filtering results. The Reflection just help in big data.
This commit is contained in:
parent
d7991aac23
commit
0e30042f82
1 changed files with 0 additions and 10 deletions
|
@ -1127,8 +1127,6 @@ class DboSource extends DataSource {
|
||||||
* @return array Array of results that have been filtered through $model->afterFind
|
* @return array Array of results that have been filtered through $model->afterFind
|
||||||
*/
|
*/
|
||||||
protected function _filterResults(&$results, Model $model, $filtered = array()) {
|
protected function _filterResults(&$results, Model $model, $filtered = array()) {
|
||||||
static $haveCallback = array();
|
|
||||||
|
|
||||||
$current = current($results);
|
$current = current($results);
|
||||||
if (!is_array($current)) {
|
if (!is_array($current)) {
|
||||||
return array();
|
return array();
|
||||||
|
@ -1140,14 +1138,6 @@ class DboSource extends DataSource {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$linkedModel = $model->{$className};
|
$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;
|
$filtering[] = $className;
|
||||||
foreach ($results as &$result) {
|
foreach ($results as &$result) {
|
||||||
$data = $linkedModel->afterFind(array(array($className => $result[$className])), false);
|
$data = $linkedModel->afterFind(array(array($className => $result[$className])), false);
|
||||||
|
|
Loading…
Add table
Reference in a new issue