Пример #1
0
 /**
  * Delete taxonomy object
  */
 function doDelete()
 {
     global $ilDB;
     // delete usages
     self::deleteUsagesOfTaxonomy($this->getId());
     // get all nodes
     $tree = $this->getTree();
     $subtree = $tree->getSubTreeIds($tree->readRootId());
     $subtree[] = $tree->readRootId();
     // get root node data (important: must happen before we
     // delete the nodes
     $root_node_data = $tree->getNodeData($tree->readRootId());
     // delete all nodes
     include_once "./Services/Taxonomy/classes/class.ilTaxonomyNode.php";
     foreach ($subtree as $node_id) {
         // delete node (this also deletes its assignments)
         $node = new ilTaxonomyNode($node_id);
         $node->delete();
     }
     // delete the tree
     $tree->deleteTree($root_node_data);
     // delete taxonoymy properties record
     $ilDB->manipulate("DELETE FROM tax_data WHERE " . " id = " . $ilDB->quote($this->getId(), "integer"));
 }