46 $this->title = $a_title;
66 $this->type = $a_type;
106 $this->order_nr = $a_val;
116 return $this->order_nr;
126 $this->taxonomy_id = $a_val;
136 return $this->taxonomy_id;
146 if(!isset($this->data_record))
148 $query =
"SELECT * FROM tax_node WHERE obj_id = ".
149 $ilDB->quote($this->
id,
"integer");
150 $obj_set = $ilDB->query(
$query);
151 $this->data_record = $ilDB->fetchAssoc($obj_set);
153 $this->
setType($this->data_record[
"type"]);
154 $this->
setTitle($this->data_record[
"title"]);
155 $this->
setOrderNr($this->data_record[
"order_nr"]);
168 die(
"ilTaxonomyNode->create: No taxonomy ID given");
172 $id = $ilDB->nextId(
"tax_node");
173 $query =
"INSERT INTO tax_node (obj_id, title, type, create_date, order_nr, tax_id) ".
175 $ilDB->quote(
$id,
"integer").
",".
176 $ilDB->quote($this->
getTitle(),
"text").
",".
177 $ilDB->quote($this->
getType(),
"text").
", ".
179 $ilDB->quote((
int) $this->
getOrderNr(),
"integer").
", ".
182 $ilDB->manipulate(
$query);
194 $query =
"UPDATE tax_node SET ".
195 " title = ".$ilDB->quote($this->
getTitle(),
"text").
196 " ,order_nr = ".$ilDB->quote((
int) $this->
getOrderNr(),
"integer").
197 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
199 $ilDB->manipulate(
$query);
210 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
213 $query =
"DELETE FROM tax_node WHERE obj_id= ".
214 $ilDB->quote($this->
getId(),
"integer");
215 $ilDB->manipulate(
$query);
225 $taxn->setType($this->
getType());
233 $taxn->setTaxonomyId($a_tax_id);
246 protected static function _lookup($a_obj_id, $a_field)
250 $query =
"SELECT $a_field FROM tax_node WHERE obj_id = ".
251 $ilDB->quote($a_obj_id,
"integer");
252 $obj_set = $ilDB->query(
$query);
253 $obj_rec = $ilDB->fetchAssoc($obj_set);
255 return $obj_rec[$a_field];
274 static function putInTree($a_tax_id, $a_node, $a_parent_id =
"", $a_target_node_id =
"",
277 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyTree.php");
281 $parent_id = ($a_parent_id !=
"")
283 : $tax_tree->readRootId();
286 if ($a_target_node_id !=
"")
288 $target = $a_target_node_id;
293 $childs = $tax_tree->getChilds($parent_id);
295 if (count($childs) == 0)
301 $target = $childs[count($childs) - 1][
"obj_id"];
305 if ($tax_tree->isInTree($parent_id) && !$tax_tree->isInTree($a_node->getId()))
307 $tax_tree->insertNode($a_node->getId(), $parent_id, $target);
321 $ilDB->manipulate(
"UPDATE tax_node SET ".
322 " order_nr = ".$ilDB->quote($a_order_nr,
"integer").
323 " WHERE obj_id = ".$ilDB->quote($a_node_id,
"integer")
337 $ilDB->manipulate(
"UPDATE tax_node SET ".
338 " title = ".$ilDB->quote($a_title,
"text").
339 " WHERE obj_id = ".$ilDB->quote($a_node_id,
"integer")
348 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyTree.php");
350 if ($a_parent_id == 0)
352 $a_parent_id = $tax_tree->readRootId();
354 $childs = $tax_tree->getChilds($a_parent_id);
357 foreach ($childs as $c)
359 if ($c[
"order_nr"] > $max)
361 $max = $c[
"order_nr"] + 10;
376 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyTree.php");
378 if ($a_parent_id == 0)
380 $a_parent_id = $tax_tree->readRootId();
382 $childs = $tax_tree->getChilds($a_parent_id);
386 foreach ($childs as $c)