Commit e006ebb0 authored by romanb's avatar romanb

Added missing multiple root support to Doctrine_Node_NestedSet::getAncestors().

parent ec6fc688
...@@ -209,9 +209,10 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int ...@@ -209,9 +209,10 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
$q = $this->record->getTable()->createQuery(); $q = $this->record->getTable()->createQuery();
$componentName = $this->record->getTable()->getComponentName(); $componentName = $this->record->getTable()->getComponentName();
$ancestors = $q->where("$componentName.lft < ? AND $componentName.rgt > ?", array($this->getLeftValue(), $this->getRightValue())) $q = $q->where("$componentName.lft < ? AND $componentName.rgt > ?", array($this->getLeftValue(), $this->getRightValue()))
->orderBy("$componentName.lft asc") ->orderBy("$componentName.lft asc");
->execute(); $q = $this->record->getTable()->getTree()->returnQueryWithRootId($q, $this->getRootValue());
$ancestors = $q->execute();
return $ancestors; return $ancestors;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment