Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.1
-
Fix Version/s: 1.2.1
-
Component/s: Nested Set
-
Labels:None
Description
Im using next code
$category = Doctrine_Core::getTable('Mr_DirectoryTreeNodes')->findOneBy('id',$params['id']);
$node = $category->getNode();
$node->delete();
Doctrine_Node_NestedSet::delete() deletes all root nodes;
_____________________
to fix add
$q = $q->addWhere("$baseAlias.id = ?", $this->record->get('id'));
after :
$q = $q->addWhere("$baseAlias.lft >= ? AND $baseAlias.rgt <= ?", array($this->getLeftValue(), $this->getRightValue()));
with
public function setUp()
{ $options = array( 'hasManyRoots' => true, 'rootColumnName' => 'root_id' ); $this->actAs('Timestampable'); $this->actAs('NestedSet',$options); parent::setUp(); });
it works propertly