/**
  * Hard-deletes a node and its child nodes from database.
  *
  * Warning: No deleted=1 is set in node record, nodes are really deleted!
  *
  * @param Tx_PtExtbase_Tree_Node $node
  */
 protected function deleteNode(Tx_PtExtbase_Tree_Node $node)
 {
     $left = $node->getLft();
     $right = $node->getRgt();
     $query = "DELETE FROM tx_ptextbase_tree_node WHERE lft >= " . $left . " AND rgt <= " . $right;
     $extQuery = $this->createQuery();
     $extQuery->statement($query)->execute(true);
 }
Beispiel #2
0
 /** @test */
 public function constructReturnsInitializedNode()
 {
     $node = new Tx_PtExtbase_Tree_Node();
     $this->assertEquals($node->getLft(), 1);
     $this->assertEquals($node->getRgt(), 2);
 }