Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.1
-
Fix Version/s: 1.2.0
-
Component/s: Nested Set
-
Labels:None
Description
How to reproduce
- fetch a tree with nested set
$root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId());
- issue
$root->getNode()->getChildren(); or there will be a total query mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> .... <?php endforeach; ?> ...
Problem is described more verbosely here – http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/
What behavior is expected
An already fetched record instance is returned, without calling database and without causing query flooding.
Like in propel.
In propel if you are calling ....::retrieveTree($id) it returns the root
with completed, pooled (cached) and linked tree.
What happens
An additional query is issued
This is a big slip in architecture of Doctrine`s nested set implementation.