19 declare(strict_types=1);
32 'discipline' =>
'Discipline',
34 'prerequisite' =>
'Prerequisite',
35 'educational objective' =>
'EducationalObjective',
36 'accessibility restrictions' =>
'AccessibilityRestrictions',
37 'educational level' =>
'EducationalLevel',
38 'skill level' =>
'SkillLevel',
39 'security level' =>
'SecurityLevel',
40 'competency' =>
'Competency' 59 if (!$a_taxon_path_id) {
63 $tax->setMetaId($a_taxon_path_id);
72 $tax->setParentType(
'meta_classification');
88 $key->setMetaId($a_keyword_id);
97 $key->setParentType(
'meta_classification');
105 switch ($a_purpose) {
109 case 'EducationalObjective':
110 case 'AccessibilityRestrictions':
111 case 'EducationalLevel':
113 case 'SecurityLevel':
115 $this->purpose = $a_purpose;
130 $this->description = $a_description;
140 $this->description_language = $lng_obj;
145 return is_object($this->description_language) ? $this->description_language : null;
150 return is_object($this->description_language) ? $this->description_language->getLanguageCode() :
'';
156 $fields[
'meta_classification_id'] = array(
'integer', $next_id = $this->db->nextId(
'il_meta_classification'));
158 if ($this->db->insert(
'il_meta_classification', $fields)) {
167 return $this->
getMetaId() && $this->db->update(
168 'il_meta_classification',
170 [
"meta_classification_id" => [
'integer', $this->
getMetaId()]]
174 public function delete():
bool 177 $query =
"DELETE FROM il_meta_classification " .
178 "WHERE meta_classification_id = " . $this->db->quote($this->
getMetaId(),
'integer');
179 $res = $this->db->manipulate($query);
203 $purpose = (string) array_search(
205 self::PURPOSE_TRANSLATION
209 'rbac_id' => array(
'integer', $this->
getRBACId()),
210 'obj_id' => array(
'integer', $this->
getObjId()),
211 'obj_type' => array(
'text', $this->
getObjType()),
212 'purpose' => array(
'text', $purpose),
221 $query =
"SELECT * FROM il_meta_classification " .
222 "WHERE meta_classification_id = " . $this->db->quote($this->
getMetaId(),
'integer');
224 $res = $this->db->query($query);
229 if (key_exists($row->purpose ??
'', self::PURPOSE_TRANSLATION)) {
230 $row->purpose = self::PURPOSE_TRANSLATION[$row->purpose ??
''];
234 $this->
setObjId((
int) $row->obj_id);
238 $this->description_language =
new ilMDLanguageItem($row->description_language ??
'');
252 foreach ($taxs as
$id) {
254 $tax->toXML($writer);
258 $tax->toXML($writer);
272 foreach ($keys as $id) {
274 $key->toXML($writer);
278 $key->toXML($writer);
288 public static function _getIds(
int $a_rbac_id,
int $a_obj_id): array
292 $ilDB = $DIC[
'ilDB'];
294 $query =
"SELECT meta_classification_id FROM il_meta_classification " .
295 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
296 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
301 $ids[] = (
int) $row->meta_classification_id;
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
const PURPOSE_TRANSLATION
Compatibility fix for legacy MD classes for new db tables.
getTaxonPath(int $a_taxon_path_id)
toXML(ilXmlWriter $writer)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPurpose(string $a_purpose)
xmlEndTag(string $tag)
Writes an endtag.
setDescriptionLanguage(ilMDLanguageItem $lng_obj)
getDescriptionLanguageCode()
ilMDLanguageItem $description_language
static _getIds(int $a_rbac_id, int $a_obj_id)
getKeyword(int $a_keyword_id)
static _getIds(int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
setMetaId(int $a_meta_id, bool $a_read_data=true)
setObjType(string $a_type)
setDescription(string $a_description)