ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMDClassification Class Reference
+ Inheritance diagram for ilMDClassification:
+ Collaboration diagram for ilMDClassification:

Public Member Functions

getTaxonPathIds ()
 
getTaxonPath ($a_taxon_path_id)
 
addTaxonPath ()
 
getKeywordIds ()
 
getKeyword ($a_keyword_id)
 
addKeyword ()
 
 setPurpose ($a_purpose)
 
 getPurpose ()
 
 setDescription ($a_description)
 
 getDescription ()
 
 setDescriptionLanguage (&$lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
getTaxonPathIds ()
 
getTaxonPath ($a_taxon_path_id)
 
addTaxonPath ()
 
getKeywordIds ()
 
getKeyword ($a_keyword_id)
 
addKeyword ()
 
 setPurpose ($a_purpose)
 
 getPurpose ()
 
 setDescription ($a_description)
 
 getDescription ()
 
 setDescriptionLanguage (&$lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id)
 
- Public Member Functions inherited from ilMDBase
 __construct ( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
 
 setRBACId ($a_id)
 
 getRBACId ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setObjType ($a_type)
 
 getObjType ()
 
 setMetaId ($a_meta_id, $a_read_data=true)
 
 getMetaId ()
 
 setParentType ($a_parent_type)
 
 getParentType ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 setExportMode ($a_export_mode=true)
 
 getExportMode ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 
 __construct ( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
 
 setRBACId ($a_id)
 
 getRBACId ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setObjType ($a_type)
 
 getObjType ()
 
 setMetaId ($a_meta_id, $a_read_data=true)
 
 getMetaId ()
 
 setParentType ($a_parent_type)
 
 getParentType ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 

Static Public Member Functions

static _getIds ($a_rbac_id, $a_obj_id)
 

Additional Inherited Members

- Data Fields inherited from ilMDBase
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 
- Protected Attributes inherited from ilMDBase
 $log
 

Detailed Description

Definition at line 33 of file class.ilMDClassification.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDClassification::__getFields ( )

Definition at line 202 of file class.ilMDClassification.php.

203 {
204 return array('rbac_id' => array('integer',$this->getRBACId()),
205 'obj_id' => array('integer',$this->getObjId()),
206 'obj_type' => array('text',$this->getObjType()),
207 'purpose' => array('text',$this->getPurpose()),
208 'description' => array('text',$this->getDescription()),
209 'description_language' => array('text',$this->getDescriptionLanguageCode()));
210 }

References getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), getPurpose(), and ilMDBase\getRBACId().

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDClassification::__getFields ( )

Definition at line 198 of file class.ilMDClassification.php.

199 {
200 return array('rbac_id' => $this->getRBACId(),
201 'obj_id' => $this->getObjId(),
202 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
203 'purpose' => ilUtil::prepareDBString($this->getPurpose()),
204 'description' => ilUtil::prepareDBString($this->getDescription()),
205 'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
206 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

References getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), getPurpose(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

+ Here is the call graph for this function:

◆ _getIds() [1/2]

static ilMDClassification::_getIds (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 286 of file class.ilMDClassification.php.

287 {
288 global $DIC;
289
290 $ilDB = $DIC['ilDB'];
291
292 $query = "SELECT meta_classification_id FROM il_meta_classification " .
293 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
294 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
295
296
297 $res = $ilDB->query($query);
298 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
299 $ids[] = $row->meta_classification_id;
300 }
301 return $ids ? $ids : array();
302 }
global $DIC
Definition: goto.php:24
$query
foreach($_POST as $key=> $value) $res
global $ilDB

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMD\getClassificationIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

ilMDClassification::_getIds (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 259 of file class.ilMDClassification.php.

260 {
261 global $ilDB;
262
263 $query = "SELECT meta_classification_id FROM il_meta_classification " .
264 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
265 "AND obj_id = " . $ilDB->quote($a_obj_id);
266
267
268 $res = $ilDB->query($query);
269 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
270 $ids[] = $row->meta_classification_id;
271 }
272 return $ids ? $ids : array();
273 }

References $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ addKeyword() [1/2]

& ilMDClassification::addKeyword ( )

Definition at line 83 of file class.ilMDClassification.php.

84 {
85 include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
86
87 $key = new ilMDKeyword($this->getRBACId(), $this->getObjId(), $this->getObjType());
88 $key->setParentId($this->getMetaId());
89 $key->setParentType('meta_classification');
90
91 return $key;
92 }

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ addKeyword() [2/2]

& ilMDClassification::addKeyword ( )

Definition at line 83 of file class.ilMDClassification.php.

84 {
85 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
86
87 $key = new ilMDKeyword($this->getRBACId(), $this->getObjId(), $this->getObjType());
88 $key->setParentId($this->getMetaId());
89 $key->setParentType('meta_classification');
90
91 return $key;
92 }

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ addTaxonPath() [1/2]

& ilMDClassification::addTaxonPath ( )

Definition at line 54 of file class.ilMDClassification.php.

55 {
56 include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
57
58 $tax = new ilMDTaxonPath($this->getRBACId(), $this->getObjId(), $this->getObjType());
59 $tax->setParentId($this->getMetaId());
60 $tax->setParentType('meta_classification');
61
62 return $tax;
63 }

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ addTaxonPath() [2/2]

& ilMDClassification::addTaxonPath ( )

Definition at line 54 of file class.ilMDClassification.php.

55 {
56 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
57
58 $tax = new ilMDTaxonPath($this->getRBACId(), $this->getObjId(), $this->getObjType());
59 $tax->setParentId($this->getMetaId());
60 $tax->setParentType('meta_classification');
61
62 return $tax;
63 }

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ delete() [1/2]

ilMDClassification::delete ( )

Reimplemented from ilMDBase.

Definition at line 176 of file class.ilMDClassification.php.

177 {
178 global $DIC;
179
180 $ilDB = $DIC['ilDB'];
181
182 if ($this->getMetaId()) {
183 $query = "DELETE FROM il_meta_classification " .
184 "WHERE meta_classification_id = " . $ilDB->quote($this->getMetaId(), 'integer');
185 $res = $ilDB->manipulate($query);
186
187 foreach ($this->getTaxonPathIds() as $id) {
188 $tax = $this->getTaxonPath($id);
189 $tax->delete();
190 }
191 foreach ($this->getKeywordIds() as $id) {
192 $key = $this->getKeyword($id);
193 $key->delete();
194 }
195
196 return true;
197 }
198 return false;
199 }
& getTaxonPath($a_taxon_path_id)

References $DIC, $ilDB, $query, $res, getKeyword(), getKeywordIds(), ilMDBase\getMetaId(), getTaxonPath(), and getTaxonPathIds().

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDClassification::delete ( )

Reimplemented from ilMDBase.

Definition at line 173 of file class.ilMDClassification.php.

174 {
175 global $ilDB;
176
177 if ($this->getMetaId()) {
178 $query = "DELETE FROM il_meta_classification " .
179 "WHERE meta_classification_id = " . $ilDB->quote($this->getMetaId());
180
181 $this->db->query($query);
182
183 foreach ($this->getTaxonPathIds() as $id) {
184 $tax = &$this->getTaxonPath($id);
185 $tax->delete();
186 }
187 foreach ($this->getKeywordIds() as $id) {
188 $key = &$this->getKeyword($id);
189 $key->delete();
190 }
191
192 return true;
193 }
194 return false;
195 }

References $ilDB, $query, getKeyword(), getKeywordIds(), ilMDBase\getMetaId(), getTaxonPath(), and getTaxonPathIds().

+ Here is the call graph for this function:

◆ getDescription() [1/2]

ilMDClassification::getDescription ( )

Definition at line 122 of file class.ilMDClassification.php.

123 {
124 return $this->description;
125 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescription() [2/2]

ilMDClassification::getDescription ( )

Definition at line 122 of file class.ilMDClassification.php.

123 {
124 return $this->description;
125 }

◆ getDescriptionLanguage() [1/2]

& ilMDClassification::getDescriptionLanguage ( )

Definition at line 132 of file class.ilMDClassification.php.

133 {
134 return is_object($this->description_language) ? $this->description_language : false;
135 }

◆ getDescriptionLanguage() [2/2]

& ilMDClassification::getDescriptionLanguage ( )

Definition at line 132 of file class.ilMDClassification.php.

133 {
134 return is_object($this->description_language) ? $this->description_language : false;
135 }

◆ getDescriptionLanguageCode() [1/2]

ilMDClassification::getDescriptionLanguageCode ( )

Definition at line 136 of file class.ilMDClassification.php.

137 {
138 return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
139 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescriptionLanguageCode() [2/2]

ilMDClassification::getDescriptionLanguageCode ( )

Definition at line 136 of file class.ilMDClassification.php.

137 {
138 return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
139 }

◆ getKeyword() [1/2]

& ilMDClassification::getKeyword (   $a_keyword_id)

Definition at line 71 of file class.ilMDClassification.php.

72 {
73 include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
74
75 if (!$a_keyword_id) {
76 return false;
77 }
78 $key = new ilMDKeyword();
79 $key->setMetaId($a_keyword_id);
80
81 return $key;
82 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getKeyword() [2/2]

& ilMDClassification::getKeyword (   $a_keyword_id)

Definition at line 71 of file class.ilMDClassification.php.

72 {
73 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
74
75 if (!$a_keyword_id) {
76 return false;
77 }
78 $key = new ilMDKeyword();
79 $key->setMetaId($a_keyword_id);
80
81 return $key;
82 }

◆ getKeywordIds() [1/2]

& ilMDClassification::getKeywordIds ( )

Definition at line 65 of file class.ilMDClassification.php.

66 {
67 include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
68
69 return ilMDKeyword::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_classification');
70 }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)

References ilMDKeyword\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by delete(), and toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getKeywordIds() [2/2]

& ilMDClassification::getKeywordIds ( )

Definition at line 65 of file class.ilMDClassification.php.

66 {
67 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
68
69 return ilMDKeyword::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_classification');
70 }

References ilMDKeyword\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ getPurpose() [1/2]

ilMDClassification::getPurpose ( )

Definition at line 114 of file class.ilMDClassification.php.

115 {
116 return $this->purpose;
117 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getPurpose() [2/2]

ilMDClassification::getPurpose ( )

Definition at line 114 of file class.ilMDClassification.php.

115 {
116 return $this->purpose;
117 }

◆ getTaxonPath() [1/2]

& ilMDClassification::getTaxonPath (   $a_taxon_path_id)

Definition at line 42 of file class.ilMDClassification.php.

43 {
44 include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
45
46 if (!$a_taxon_path_id) {
47 return false;
48 }
49 $tax = new ilMDTaxonPath();
50 $tax->setMetaId($a_taxon_path_id);
51
52 return $tax;
53 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getTaxonPath() [2/2]

& ilMDClassification::getTaxonPath (   $a_taxon_path_id)

Definition at line 42 of file class.ilMDClassification.php.

43 {
44 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
45
46 if (!$a_taxon_path_id) {
47 return false;
48 }
49 $tax = new ilMDTaxonPath();
50 $tax->setMetaId($a_taxon_path_id);
51
52 return $tax;
53 }

◆ getTaxonPathIds() [1/2]

& ilMDClassification::getTaxonPathIds ( )

Definition at line 36 of file class.ilMDClassification.php.

37 {
38 include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
39
40 return ilMDTaxonPath::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_classification');
41 }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)

References ilMDTaxonPath\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by delete(), and toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTaxonPathIds() [2/2]

& ilMDClassification::getTaxonPathIds ( )

Definition at line 36 of file class.ilMDClassification.php.

37 {
38 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
39
40 return ilMDTaxonPath::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_classification');
41 }

References ilMDTaxonPath\_getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

+ Here is the call graph for this function:

◆ read() [1/2]

ilMDClassification::read ( )

Definition at line 212 of file class.ilMDClassification.php.

213 {
214 global $DIC;
215
216 $ilDB = $DIC['ilDB'];
217
218 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
219
220 if ($this->getMetaId()) {
221 $query = "SELECT * FROM il_meta_classification " .
222 "WHERE meta_classification_id = " . $ilDB->quote($this->getMetaId(), 'integer');
223
224 $res = $this->db->query($query);
225 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
226 $this->setRBACId($row->rbac_id);
227 $this->setObjId($row->obj_id);
228 $this->setObjType($row->obj_type);
229 $this->setPurpose($row->purpose);
230 $this->setDescription($row->description);
231 $this->description_language = new ilMDLanguageItem($row->description_language);
232 }
233 }
234 return true;
235 }
setObjId($a_id)
setObjType($a_type)
setRBACId($a_id)

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setDescription(), ilMDBase\setObjId(), ilMDBase\setObjType(), setPurpose(), and ilMDBase\setRBACId().

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDClassification::read ( )

Definition at line 208 of file class.ilMDClassification.php.

209 {
210 global $ilDB;
211
212 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
213
214 if ($this->getMetaId()) {
215 $query = "SELECT * FROM il_meta_classification " .
216 "WHERE meta_classification_id = " . $ilDB->quote($this->getMetaId());
217
218 $res = $this->db->query($query);
219 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
220 $this->setRBACId($row->rbac_id);
221 $this->setObjId($row->obj_id);
222 $this->setObjType($row->obj_type);
223 $this->setPurpose(ilUtil::stripSlashes($row->purpose));
224 $this->setDescription(ilUtil::stripSlashes($row->description));
225 $this->description_language = new ilMDLanguageItem($row->description_language);
226 }
227 }
228 return true;
229 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setDescription(), ilMDBase\setObjId(), ilMDBase\setObjType(), setPurpose(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDClassification::save ( )

Reimplemented from ilMDBase.

Definition at line 142 of file class.ilMDClassification.php.

143 {
144 global $DIC;
145
146 $ilDB = $DIC['ilDB'];
147
148 $fields = $this->__getFields();
149 $fields['meta_classification_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_classification'));
150
151 if ($this->db->insert('il_meta_classification', $fields)) {
152 $this->setMetaId($next_id);
153 return $this->getMetaId();
154 }
155 return false;
156 }
setMetaId($a_meta_id, $a_read_data=true)

References $DIC, $ilDB, __getFields(), ilMDBase\getMetaId(), and ilMDBase\setMetaId().

+ Here is the call graph for this function:

◆ save() [2/2]

ilMDClassification::save ( )

Reimplemented from ilMDBase.

Definition at line 142 of file class.ilMDClassification.php.

143 {
144 if ($this->db->autoExecute(
145 'il_meta_classification',
146 $this->__getFields(),
148 )) {
149 $this->setMetaId($this->db->getLastInsertId());
150
151 return $this->getMetaId();
152 }
153 return false;
154 }

References ilDBConstants\AUTOQUERY_INSERT, ilMDBase\getMetaId(), and ilMDBase\setMetaId().

+ Here is the call graph for this function:

◆ setDescription() [1/2]

ilMDClassification::setDescription (   $a_description)

Definition at line 118 of file class.ilMDClassification.php.

119 {
120 $this->description = $a_description;
121 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescription() [2/2]

ilMDClassification::setDescription (   $a_description)

Definition at line 118 of file class.ilMDClassification.php.

119 {
120 $this->description = $a_description;
121 }

◆ setDescriptionLanguage() [1/2]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

Definition at line 126 of file class.ilMDClassification.php.

127 {
128 if (is_object($lng_obj)) {
129 $this->description_language = $lng_obj;
130 }
131 }

◆ setDescriptionLanguage() [2/2]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

Definition at line 126 of file class.ilMDClassification.php.

127 {
128 if (is_object($lng_obj)) {
129 $this->description_language = &$lng_obj;
130 }
131 }

◆ setPurpose() [1/2]

ilMDClassification::setPurpose (   $a_purpose)

Definition at line 95 of file class.ilMDClassification.php.

96 {
97 switch ($a_purpose) {
98 case 'Discipline':
99 case 'Idea':
100 case 'Prerequisite':
101 case 'EducationalObjective':
102 case 'AccessibilityRestrictions':
103 case 'EducationalLevel':
104 case 'SkillLevel':
105 case 'SecurityLevel':
106 case 'Competency':
107 $this->purpose = $a_purpose;
108 return true;
109
110 default:
111 return false;
112 }
113 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPurpose() [2/2]

ilMDClassification::setPurpose (   $a_purpose)

Definition at line 95 of file class.ilMDClassification.php.

96 {
97 switch ($a_purpose) {
98 case 'Discipline':
99 case 'Idea':
100 case 'Prerequisite':
101 case 'EducationalObjective':
102 case 'AccessibilityRestrictions':
103 case 'EducationalLevel':
104 case 'SkillLevel':
105 case 'SecurityLevel':
106 case 'Competency':
107 $this->purpose = $a_purpose;
108 return true;
109
110 default:
111 return false;
112 }
113 }

◆ toXML() [1/2]

ilMDClassification::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 242 of file class.ilMDClassification.php.

243 {
244 $writer->xmlStartTag('Classification', array('Purpose' => $this->getPurpose()
245 ? $this->getPurpose()
246 : 'Idea'));
247
248 // Taxon Path
249 $taxs = $this->getTaxonPathIds();
250 foreach ($taxs as $id) {
251 $tax = &$this->getTaxonPath($id);
252 $tax->toXML($writer);
253 }
254 if (!count($taxs)) {
255 include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
256 $tax = new ilMDTaxonPath($this->getRBACId(), $this->getObjId());
257 $tax->toXML($writer);
258 }
259
260 // Description
261 $writer->xmlElement(
262 'Description',
263 array('Language' => $this->getDescriptionLanguageCode()
265 : 'en'),
266 $this->getDescription()
267 );
268
269 // Keyword
270 $keys = $this->getKeywordIds();
271 foreach ($keys as $id) {
272 $key = &$this->getKeyword($id);
273 $key->toXML($writer);
274 }
275 if (!count($keys)) {
276 include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
277 $key = new ilMDKeyword($this->getRBACId(), $this->getObjId());
278 $key->toXML($writer);
279 }
280 $writer->xmlEndTag('Classification');
281 }
$keys
Definition: metadata.php:187

References $keys, getDescription(), getDescriptionLanguageCode(), getKeyword(), getKeywordIds(), ilMDBase\getObjId(), getPurpose(), ilMDBase\getRBACId(), getTaxonPath(), and getTaxonPathIds().

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDClassification::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 236 of file class.ilMDClassification.php.

237 {
238 $writer->xmlStartTag('Classification', array('Purpose' => $this->getPurpose()));
239
240 // Taxon Path
241 foreach ($this->getTaxonPathIds() as $id) {
242 $tax = &$this->getTaxonPath($id);
243 $tax->toXML($writer);
244 }
245 // Description
246 $writer->xmlElement('Description', array('Language' => $this->getDescriptionLanguageCode()), $this->getDescription());
247
248 // Keyword
249 foreach ($this->getKeywordIds() as $id) {
250 $key = &$this->getKeyword($id);
251 $key->toXML($writer);
252 }
253 $writer->xmlEndTag('Classification');
254 }

References getDescription(), getDescriptionLanguageCode(), getKeyword(), getKeywordIds(), getPurpose(), getTaxonPath(), and getTaxonPathIds().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDClassification::update ( )

Reimplemented from ilMDBase.

Definition at line 158 of file class.ilMDClassification.php.

159 {
160 global $DIC;
161
162 $ilDB = $DIC['ilDB'];
163
164 if ($this->getMetaId()) {
165 if ($this->db->update(
166 'il_meta_classification',
167 $this->__getFields(),
168 array("meta_classification_id" => array('integer',$this->getMetaId()))
169 )) {
170 return true;
171 }
172 }
173 return false;
174 }

References $DIC, $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDClassification::update ( )

Reimplemented from ilMDBase.

Definition at line 156 of file class.ilMDClassification.php.

157 {
158 global $ilDB;
159
160 if ($this->getMetaId()) {
161 if ($this->db->autoExecute(
162 'il_meta_classification',
163 $this->__getFields(),
165 "meta_classification_id = " . $ilDB->quote($this->getMetaId())
166 )) {
167 return true;
168 }
169 }
170 return false;
171 }

References $ilDB, ilDBConstants\AUTOQUERY_UPDATE, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: