Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: Add Hierarchy::prepopulate_numchildren_cache() #8380

Merged
merged 12 commits into from
Sep 25, 2018
4 changes: 1 addition & 3 deletions src/ORM/Hierarchy/Hierarchy.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,7 @@ public static function prepopulate_numchildren_cache($baseClass, $stage, $idList
'"ParentID"',
"COUNT(DISTINCT $idColumn) AS \"NumChildren\"",
]);
$query->setGroupBy([
"ParentID
"]);
$query->setGroupBy(['"ParentID"']);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably best to use Convert::symbol2sql("ParentID") here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


$numChildren = $query->execute()->map();
self::$cache_numChildren[$baseClass][$stage] = $numChildren;
Expand Down