ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjTaxonomyAdministration.php
Go to the documentation of this file.
1<?php
2
24{
25 public function __construct($a_id = 0, $a_call_by_reference = true)
26 {
27 global $DIC;
28
29 $this->tree = $DIC->repositoryTree();
30 $this->db = $DIC->database();
31 $this->type = "taxs";
32 parent::__construct($a_id, $a_call_by_reference);
33 }
34
35 public function delete(): bool
36 {
37 // DISABLED
38 return false;
39 }
40
41 protected function getPath(int $a_ref_id): array
42 {
44
45 $res = array();
46
47 foreach ($tree->getPathFull($a_ref_id) as $data) {
48 $res[] = $data['title'];
49 }
50
51 return $res;
52 }
53
54 public function getRepositoryTaxonomies(): array
55 {
58
59 $res = array();
60
61 $sql = "SELECT oref.ref_id, od.obj_id, od.type obj_type, od.title obj_title," .
62 " tu.tax_id, od2.title tax_title, cs.value tax_status" .
63 " FROM object_data od" .
64 " JOIN object_reference oref ON (od.obj_id = oref.obj_id)" .
65 " JOIN tax_usage tu ON (tu.obj_id = od.obj_id)" .
66 " JOIN object_data od2 ON (od2.obj_id = tu.tax_id)" .
67 " LEFT JOIN container_settings cs ON (cs.id = od.obj_id AND keyword = " . $ilDB->quote(
69 "text"
70 ) . ")" .
71 " WHERE od.type = " . $ilDB->quote("cat", "text") . // categories only currently
72 " AND tu.tax_id > " . $ilDB->quote(0, "integer");
73 $set = $ilDB->query($sql);
74 while ($row = $ilDB->fetchAssoc($set)) {
75 if (!$tree->isDeleted((int) $row["ref_id"])) {
76 $res[$row["tax_id"]][$row["obj_id"]] = array(
77 "tax_id" => (int) $row["tax_id"],
78 "tax_title" => $row["tax_title"],
79 "tax_status" => (bool) $row["tax_status"],
80 "obj_title" => $row["obj_title"],
81 "obj_type" => $row["obj_type"],
82 "obj_id" => (int) $row["obj_id"],
83 "ref_id" => (int) $row["ref_id"],
84 "path" => $this->getPath((int) $row["ref_id"])
85 );
86 }
87 }
88
89 return $res;
90 }
91}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct($a_id=0, $a_call_by_reference=true)
Class ilObject Basic functions for all objects.
ilTree $tree
ilDBInterface $db
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
$res
Definition: ltiservices.php:69
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26