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

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)
 
- Public Member Functions inherited from ilMD5295Base
 __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)
 

Static Public Member Functions

static _getIds ($a_rbac_id, $a_obj_id)
 

Additional Inherited Members

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

Detailed Description

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

Member Function Documentation

◆ __getFields()

ilMD5295Classification::__getFields ( )

Definition at line 202 of file class.ilMD5295Classification.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(), ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), getPurpose(), and ilMD5295Base\getRBACId().

Referenced by save().

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

◆ _getIds()

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

Definition at line 286 of file class.ilMD5295Classification.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 ilMD5295\getClassificationIds().

+ Here is the caller graph for this function:

◆ addKeyword()

& ilMD5295Classification::addKeyword ( )

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

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

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

+ Here is the call graph for this function:

◆ addTaxonPath()

& ilMD5295Classification::addTaxonPath ( )

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

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

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

+ Here is the call graph for this function:

◆ delete()

ilMD5295Classification::delete ( )

Reimplemented from ilMD5295Base.

Definition at line 176 of file class.ilMD5295Classification.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 }

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

+ Here is the call graph for this function:

◆ getDescription()

ilMD5295Classification::getDescription ( )

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

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

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescriptionLanguage()

& ilMD5295Classification::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguageCode()

ilMD5295Classification::getDescriptionLanguageCode ( )

Definition at line 136 of file class.ilMD5295Classification.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:

◆ getKeyword()

& ilMD5295Classification::getKeyword (   $a_keyword_id)

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

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

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getKeywordIds()

& ilMD5295Classification::getKeywordIds ( )

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

66 {
67 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Keyword.php';
68
69 return ilMD5295Keyword::_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 ilMD5295Keyword\_getIds(), ilMD5295Base\getMetaId(), ilMD5295Base\getObjId(), and ilMD5295Base\getRBACId().

Referenced by delete(), and toXML().

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

◆ getPurpose()

ilMD5295Classification::getPurpose ( )

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

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

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTaxonPath()

& ilMD5295Classification::getTaxonPath (   $a_taxon_path_id)

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

43 {
44 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295TaxonPath.php';
45
46 if (!$a_taxon_path_id) {
47 return false;
48 }
49 $tax = new ilMD5295TaxonPath();
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:

◆ getTaxonPathIds()

& ilMD5295Classification::getTaxonPathIds ( )

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

37 {
38 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295TaxonPath.php';
39
40 return ilMD5295TaxonPath::_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 ilMD5295TaxonPath\_getIds(), ilMD5295Base\getMetaId(), ilMD5295Base\getObjId(), and ilMD5295Base\getRBACId().

Referenced by delete(), and toXML().

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

◆ read()

ilMD5295Classification::read ( )

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

213 {
214 global $DIC;
215
216 $ilDB = $DIC['ilDB'];
217
218 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.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 ilMD5295LanguageItem($row->description_language);
232 }
233 }
234 return true;
235 }

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

+ Here is the call graph for this function:

◆ save()

ilMD5295Classification::save ( )

Reimplemented from ilMD5295Base.

Definition at line 142 of file class.ilMD5295Classification.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(), ilMD5295Base\getMetaId(), and ilMD5295Base\setMetaId().

+ Here is the call graph for this function:

◆ setDescription()

ilMD5295Classification::setDescription (   $a_description)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescriptionLanguage()

ilMD5295Classification::setDescriptionLanguage ( $lng_obj)

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

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

◆ setPurpose()

ilMD5295Classification::setPurpose (   $a_purpose)

Definition at line 95 of file class.ilMD5295Classification.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:

◆ toXML()

ilMD5295Classification::toXML ( $writer)

Reimplemented from ilMD5295Base.

Definition at line 242 of file class.ilMD5295Classification.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/Migration/DBUpdate_5295/classes/class.ilMD5295TaxonPath.php';
256 $tax = new ilMD5295TaxonPath($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/Migration/DBUpdate_5295/classes/class.ilMD5295Keyword.php';
277 $key = new ilMD5295Keyword($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(), ilMD5295Base\getObjId(), getPurpose(), ilMD5295Base\getRBACId(), getTaxonPath(), and getTaxonPathIds().

+ Here is the call graph for this function:

◆ update()

ilMD5295Classification::update ( )

Reimplemented from ilMD5295Base.

Definition at line 158 of file class.ilMD5295Classification.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 ilMD5295Base\getMetaId().

+ Here is the call graph for this function:

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