Added missing multiple root support to Doctrine_Node_NestedSet::getAncestors().
This commit is contained in:
parent
ec6fc6881c
commit
e006ebb056
@ -209,9 +209,10 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
|
||||
$q = $this->record->getTable()->createQuery();
|
||||
|
||||
$componentName = $this->record->getTable()->getComponentName();
|
||||
$ancestors = $q->where("$componentName.lft < ? AND $componentName.rgt > ?", array($this->getLeftValue(), $this->getRightValue()))
|
||||
->orderBy("$componentName.lft asc")
|
||||
->execute();
|
||||
$q = $q->where("$componentName.lft < ? AND $componentName.rgt > ?", array($this->getLeftValue(), $this->getRightValue()))
|
||||
->orderBy("$componentName.lft asc");
|
||||
$q = $this->record->getTable()->getTree()->returnQueryWithRootId($q, $this->getRootValue());
|
||||
$ancestors = $q->execute();
|
||||
|
||||
return $ancestors;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user