34        return array(
"4.3.0");
 
   37    protected function getXmlNamespace(
string $a_entity, 
string $a_schema_version): string
 
   39        return "http://www.ilias.de/xml/Services/Taxonomy/" . $a_entity;
 
   45    protected function getTypes(
string $a_entity, 
string $a_version): array
 
   48        if ($a_entity == 
"tax") {
 
   54                        "Description" => 
"text",
 
   55                        "SortingMode" => 
"integer" 
   61        if ($a_entity == 
"tax_usage") {
 
   72        if ($a_entity == 
"tax_tree") {
 
   78                        "Parent" => 
"integer",
 
   82                        "OrderNr" => 
"integer" 
   88        if ($a_entity == 
"tax_node_assignment") {
 
   92                        "NodeId" => 
"integer",
 
   93                        "Component" => 
"text",
 
  105    public function readData(
string $a_entity, 
string $a_version, array $a_ids): void
 
  109        if (!is_array($a_ids)) {
 
  110            $a_ids = array($a_ids);
 
  114        if ($a_entity == 
"tax") {
 
  115            switch ($a_version) {
 
  119                        " FROM tax_data JOIN object_data ON (tax_data.id = object_data.obj_id) " .
 
  121                        $ilDB->in(
"id", $a_ids, 
false, 
"integer"));
 
  127        if ($a_entity == 
"tax_usage") {
 
  128            switch ($a_version) {
 
  133                        $ilDB->in(
"tax_id", $a_ids, 
false, 
"integer"));
 
  139        if ($a_entity == 
"tax_tree") {
 
  140            switch ($a_version) {
 
  143                        " ,parent,depth,type,title,order_nr " .
 
  144                        " FROM tax_tree JOIN tax_node ON (child = obj_id) " .
 
  146                        $ilDB->in(
"tax_id", $a_ids, 
false, 
"integer") .
 
  153        if ($a_entity == 
"tax_node_assignment") {
 
  154            switch ($a_version) {
 
  157                        " FROM tax_node_assignment " .
 
  159                        $ilDB->in(
"node_id", $a_ids, 
false, 
"integer"));
 
  171        ?array $a_rec = 
null,
 
  177                    "tax_tree" => array(
"ids" => $a_rec[
"Id"] ?? 
null),
 
  178                    "tax_usage" => array(
"ids" => $a_rec[
"Id"] ?? 
null)
 
  182                    "tax_node_assignment" => array(
"ids" => $a_rec[
"Child"] ?? 
null)
 
  197        string $a_schema_version
 
  199        $a_rec = $this->stripTags($a_rec);
 
  205                $newObj->setTitle($a_rec[
"Title"]);
 
  206                $newObj->setDescription($a_rec[
"Description"]);
 
  207                $newObj->setSortingMode((
int) $a_rec[
"SortingMode"]);
 
  210                $this->current_obj = $newObj;
 
  211                $a_mapping->
addMapping(
"Services/Taxonomy", 
"tax", $a_rec[
"Id"], $newObj->getId());
 
  215                switch ($a_rec[
"Type"]) {
 
  217                        $parent = (
int) $a_mapping->
getMapping(
"Services/Taxonomy", 
"tax_tree", $a_rec[
"Parent"]);
 
  218                        $tax_id = $a_mapping->
getMapping(
"Services/Taxonomy", 
"tax", $a_rec[
"TaxId"]);
 
  220                            $parent = $this->current_obj->getTree()->readRootId();
 
  223                        $node->setTitle($a_rec[
"Title"]);
 
  224                        $node->setOrderNr((
int) $a_rec[
"OrderNr"]);
 
  225                        $node->setTaxonomyId((
int) $tax_id);
 
  239            case "tax_node_assignment":
 
  243                    ($a_rec[
"Component"] ?? 
"") .
 
  244                    ":" . ($a_rec[
"ItemType"] ?? 
"") . 
":" .
 
  245                    ($a_rec[
"ItemId"] ?? 
"")
 
  247                $new_node_id = (
int) $a_mapping->
getMapping(
"Services/Taxonomy", 
"tax_tree", $a_rec[
"NodeId"] ?? 
"");
 
  254                    ($a_rec[
"Component"] ?? 
"") .
 
  255                    ":" . ($a_rec[
"ItemType"] ?? 
"") . 
":" .
 
  256                    ($a_rec[
"ItemId"] ?? 
"")
 
  258                if ($new_item_id > 0 && $new_node_id > 0 && $new_item_id_obj > 0) {
 
  263                        $this->current_obj->getId()
 
  265                    $node_ass->addAssignment($new_node_id, $new_item_id);
 
  270                $usage = $a_mapping->
getMapping(
"Services/Taxonomy", 
"tax_usage_of_obj", $a_rec[
"ObjId"]);
 
  278                    $usage . $this->current_obj->getId()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
 
getMapping(string $a_comp, string $a_entity, string $a_old_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getTypes(string $a_entity, string $a_version)
@inheritDoc
 
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Needs to be overwritten for import use case.
 
ilObjTaxonomy $current_obj
 
readData(string $a_entity, string $a_version, array $a_ids)
@inheritDoc
 
getXmlNamespace(string $a_entity, string $a_schema_version)
 
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
Determine the dependent sets of data.
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static putInTree(int $a_tax_id, ilTaxonomyNode $a_node, int $a_parent_id=0, int $a_target_node_id=0, int $a_order_nr=0)