ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMD5295General Class Reference
+ Inheritance diagram for ilMD5295General:
+ Collaboration diagram for ilMD5295General:

Public Member Functions

 getPossibleSubelements ()
 
getIdentifierIds ()
 
getIdentifier ($a_identifier_id)
 
addIdentifier ()
 
getLanguageIds ()
 
getLanguage ($a_language_id)
 
addLanguage ()
 
getDescriptionIds ()
 
getDescription ($a_description_id)
 
addDescription ()
 
getKeywordIds ()
 
getKeyword ($a_keyword_id)
 
addKeyword ()
 
 setStructure ($a_structure)
 
 getStructure ()
 
 setTitle ($a_title)
 
 getTitle ()
 
 setTitleLanguage (&$lng_obj)
 
getTitleLanguage ()
 
 getTitleLanguageCode ()
 
 setCoverage ($a_coverage)
 
 getCoverage ()
 
 setCoverageLanguage (&$lng_obj)
 
getCoverageLanguage ()
 
 getCoverageLanguageCode ()
 
 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 _getId ($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 34 of file class.ilMD5295General.php.

Member Function Documentation

◆ __getFields()

ilMD5295General::__getFields ( )

Definition at line 314 of file class.ilMD5295General.php.

315 {
316 return array('rbac_id' => array('integer',$this->getRBACId()),
317 'obj_id' => array('integer',$this->getObjId()),
318 'obj_type' => array('text',$this->getObjType()),
319 'general_structure' => array('text',$this->getStructure()),
320 'title' => array('text',$this->getTitle()),
321 'title_language' => array('text',$this->getTitleLanguageCode()),
322 'coverage' => array('text',$this->getCoverage()),
323 'coverage_language' => array('text',$this->getCoverageLanguageCode()));
324 }

References getCoverage(), getCoverageLanguageCode(), ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), ilMD5295Base\getRBACId(), getStructure(), getTitle(), and getTitleLanguageCode().

Referenced by save().

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

◆ _getId()

static ilMD5295General::_getId (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 451 of file class.ilMD5295General.php.

452 {
453 global $DIC;
454
455 $ilDB = $DIC['ilDB'];
456
457 $query = "SELECT meta_general_id FROM il_meta_general " .
458 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
459 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
460
461
462 $res = $ilDB->query($query);
463 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
464 return $row->meta_general_id;
465 }
466 return false;
467 }
$query
foreach($_POST as $key=> $value) $res
global $ilDB
$DIC
Definition: xapitoken.php:46

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

Referenced by ilMD5295\getGeneral().

+ Here is the caller graph for this function:

◆ addDescription()

& ilMD5295General::addDescription ( )

Definition at line 123 of file class.ilMD5295General.php.

124 {
125 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php';
126
127 $des = new ilMD5295Description($this->getRBACId(), $this->getObjId(), $this->getObjType());
128 $des->setParentId($this->getMetaId());
129 $des->setParentType('meta_general');
130
131 return $des;
132 }

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

+ Here is the call graph for this function:

◆ addIdentifier()

& ilMD5295General::addIdentifier ( )

Definition at line 66 of file class.ilMD5295General.php.

67 {
68 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier.php';
69
70 $ide = new ilMD5295Identifier($this->getRBACId(), $this->getObjId(), $this->getObjType());
71 $ide->setParentId($this->getMetaId());
72 $ide->setParentType('meta_general');
73
74 return $ide;
75 }

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

+ Here is the call graph for this function:

◆ addKeyword()

& ilMD5295General::addKeyword ( )

Definition at line 151 of file class.ilMD5295General.php.

152 {
153 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Keyword.php';
154
155 $key = new ilMD5295Keyword($this->getRBACId(), $this->getObjId(), $this->getObjType());
156 $key->setParentId($this->getMetaId());
157 $key->setParentType('meta_general');
158
159 return $key;
160 }

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

Referenced by ilMD5295Keyword\updateKeywords().

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

◆ addLanguage()

& ilMD5295General::addLanguage ( )

Definition at line 94 of file class.ilMD5295General.php.

95 {
96 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Language.php';
97
98 $lan = new ilMD5295Language($this->getRBACId(), $this->getObjId(), $this->getObjType());
99 $lan->setParentId($this->getMetaId());
100 $lan->setParentType('meta_general');
101
102 return $lan;
103 }

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

+ Here is the call graph for this function:

◆ delete()

ilMD5295General::delete ( )

Reimplemented from ilMD5295Base.

Definition at line 269 of file class.ilMD5295General.php.

270 {
271 global $DIC;
272
273 $ilDB = $DIC['ilDB'];
274
275 if (!$this->getMetaId()) {
276 return false;
277 }
278 // Identifier
279 foreach ($this->getIdentifierIds() as $id) {
280 $ide = $this->getIdentifier($id);
281 $ide->delete();
282 }
283
284 // Language
285 foreach ($this->getLanguageIds() as $id) {
286 $lan = $this->getLanguage($id);
287 $lan->delete();
288 }
289
290 // Description
291 foreach ($this->getDescriptionIds() as $id) {
292 $des = $this->getDescription($id);
293 $des->delete();
294 }
295
296 // Keyword
297 foreach ($this->getKeywordIds() as $id) {
298 $key = $this->getKeyword($id);
299 $key->delete();
300 }
301
302 if ($this->getMetaId()) {
303 $query = "DELETE FROM il_meta_general " .
304 "WHERE meta_general_id = " . $ilDB->quote($this->getMetaId(), 'integer');
305 $res = $ilDB->manipulate($query);
306 return true;
307 }
308
309
310 return false;
311 }
& getDescription($a_description_id)
& getLanguage($a_language_id)
& getIdentifier($a_identifier_id)
& getKeyword($a_keyword_id)

References $DIC, $ilDB, $query, $res, getDescription(), getDescriptionIds(), getIdentifier(), getIdentifierIds(), getKeyword(), getKeywordIds(), getLanguage(), getLanguageIds(), and ilMD5295Base\getMetaId().

+ Here is the call graph for this function:

◆ getCoverage()

ilMD5295General::getCoverage ( )

Definition at line 211 of file class.ilMD5295General.php.

212 {
213 return $this->coverage;
214 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getCoverageLanguage()

& ilMD5295General::getCoverageLanguage ( )

Definition at line 222 of file class.ilMD5295General.php.

223 {
224 return is_object($this->coverage_language) ? $this->coverage_language : false;
225 }

◆ getCoverageLanguageCode()

ilMD5295General::getCoverageLanguageCode ( )

Definition at line 226 of file class.ilMD5295General.php.

227 {
228 return is_object($this->coverage_language) ? $this->coverage_language->getLanguageCode() : false;
229 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getDescription()

& ilMD5295General::getDescription (   $a_description_id)

Definition at line 110 of file class.ilMD5295General.php.

111 {
112 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php';
113
114
115 if (!$a_description_id) {
116 return false;
117 }
118 $des = new ilMD5295Description();
119 $des->setMetaId($a_description_id);
120
121 return $des;
122 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getDescriptionIds()

& ilMD5295General::getDescriptionIds ( )

Definition at line 104 of file class.ilMD5295General.php.

105 {
106 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php';
107
108 return ilMD5295Description::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_general');
109 }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)

References ilMD5295Description\_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:

◆ getIdentifier()

& ilMD5295General::getIdentifier (   $a_identifier_id)

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

55 {
56 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier.php';
57
58 if (!$a_identifier_id) {
59 return false;
60 }
61 $ide = new ilMD5295Identifier();
62 $ide->setMetaId($a_identifier_id);
63
64 return $ide;
65 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getIdentifierIds()

& ilMD5295General::getIdentifierIds ( )

Definition at line 48 of file class.ilMD5295General.php.

49 {
50 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier.php';
51
52 return ilMD5295Identifier::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_general');
53 }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)

References ilMD5295Identifier\_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:

◆ getKeyword()

& ilMD5295General::getKeyword (   $a_keyword_id)

Definition at line 139 of file class.ilMD5295General.php.

140 {
141 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Keyword.php';
142
143 if (!$a_keyword_id) {
144 return false;
145 }
146 $key = new ilMD5295Keyword();
147 $key->setMetaId($a_keyword_id);
148
149 return $key;
150 }

Referenced by delete(), toXML(), and ilMD5295Keyword\updateKeywords().

+ Here is the caller graph for this function:

◆ getKeywordIds()

& ilMD5295General::getKeywordIds ( )

Definition at line 133 of file class.ilMD5295General.php.

134 {
135 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Keyword.php';
136
137 return ilMD5295Keyword::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_general');
138 }
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(), toXML(), and ilMD5295Keyword\updateKeywords().

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

◆ getLanguage()

& ilMD5295General::getLanguage (   $a_language_id)

Definition at line 82 of file class.ilMD5295General.php.

83 {
84 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Language.php';
85
86 if (!$a_language_id) {
87 return false;
88 }
89 $lan = new ilMD5295Language();
90 $lan->setMetaId($a_language_id);
91
92 return $lan;
93 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getLanguageIds()

& ilMD5295General::getLanguageIds ( )

Definition at line 76 of file class.ilMD5295General.php.

77 {
78 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Language.php';
79
80 return ilMD5295Language::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_general');
81 }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)

References ilMD5295Language\_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:

◆ getPossibleSubelements()

ilMD5295General::getPossibleSubelements ( )

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

37 {
38 $subs['Keyword'] = 'meta_keyword';
39 $subs['Language'] = 'meta_language';
40 $subs['Identifier'] = 'meta_identifier';
41 $subs['Description'] = 'meta_description';
42
43 return $subs;
44 }

◆ getStructure()

ilMD5295General::getStructure ( )

Definition at line 180 of file class.ilMD5295General.php.

181 {
182 return $this->structure;
183 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTitle()

ilMD5295General::getTitle ( )

Definition at line 188 of file class.ilMD5295General.php.

189 {
190 return $this->title;
191 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTitleLanguage()

& ilMD5295General::getTitleLanguage ( )

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

199 {
200 return is_object($this->title_language) ? $this->title_language : false;
201 }

◆ getTitleLanguageCode()

ilMD5295General::getTitleLanguageCode ( )

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

203 {
204 return is_object($this->title_language) ? $this->title_language->getLanguageCode() : false;
205 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ read()

ilMD5295General::read ( )

Definition at line 326 of file class.ilMD5295General.php.

327 {
328 global $DIC;
329
330 $ilDB = $DIC['ilDB'];
331
332 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php';
333
334 if ($this->getMetaId()) {
335 $query = "SELECT * FROM il_meta_general " .
336 "WHERE meta_general_id = " . $ilDB->quote($this->getMetaId(), 'integer');
337
338 $res = $this->db->query($query);
339 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
340 $this->setRBACId($row->rbac_id);
341 $this->setObjId($row->obj_id);
342 $this->setObjType($row->obj_type);
343 $this->setStructure($row->general_structure);
344 $this->setTitle($row->title);
345 $this->setTitleLanguage(new ilMD5295LanguageItem($row->title_language));
346 $this->setCoverage($row->coverage);
347 $this->setCoverageLanguage(new ilMD5295LanguageItem($row->coverage_language));
348 }
349 }
350 return true;
351 }
setStructure($a_structure)

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilMD5295Base\getMetaId(), setCoverage(), setCoverageLanguage(), ilMD5295Base\setObjId(), ilMD5295Base\setObjType(), ilMD5295Base\setRBACId(), setStructure(), setTitle(), and setTitleLanguage().

+ Here is the call graph for this function:

◆ save()

ilMD5295General::save ( )

Reimplemented from ilMD5295Base.

Definition at line 232 of file class.ilMD5295General.php.

233 {
234 global $DIC;
235
236 $ilDB = $DIC['ilDB'];
237
238 $fields = $this->__getFields();
239 $fields['meta_general_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_general'));
240
241 //$this->log->debug("Insert General ".print_r($fields, true));
242 //ilUtil::printBacktrace(10);
243
244 if ($this->db->insert('il_meta_general', $fields)) {
245 $this->setMetaId($next_id);
246 return $this->getMetaId();
247 }
248 return false;
249 }
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:

◆ setCoverage()

ilMD5295General::setCoverage (   $a_coverage)

Definition at line 207 of file class.ilMD5295General.php.

208 {
209 $this->coverage = $a_coverage;
210 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCoverageLanguage()

ilMD5295General::setCoverageLanguage ( $lng_obj)

Definition at line 216 of file class.ilMD5295General.php.

217 {
218 if (is_object($lng_obj)) {
219 $this->coverage_language = $lng_obj;
220 }
221 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStructure()

ilMD5295General::setStructure (   $a_structure)

Definition at line 165 of file class.ilMD5295General.php.

166 {
167 switch ($a_structure) {
168 case 'Atomic':
169 case 'Collection':
170 case 'Networked':
171 case 'Hierarchical':
172 case 'Linear':
173 $this->structure = $a_structure;
174 return true;
175
176 default:
177 return false;
178 }
179 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilMD5295General::setTitle (   $a_title)

Definition at line 184 of file class.ilMD5295General.php.

185 {
186 $this->title = $a_title;
187 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitleLanguage()

ilMD5295General::setTitleLanguage ( $lng_obj)

Definition at line 192 of file class.ilMD5295General.php.

193 {
194 if (is_object($lng_obj)) {
195 $this->title_language = $lng_obj;
196 }
197 }

Referenced by read().

+ Here is the caller graph for this function:

◆ toXML()

ilMD5295General::toXML ( $writer)

Reimplemented from ilMD5295Base.

Definition at line 358 of file class.ilMD5295General.php.

359 {
360 $writer->xmlStartTag('General', array('Structure' => $this->getStructure() ?
361 $this->getStructure() :
362 'Atomic'));
363
364
365 // Identifier
366 $first = true;
367 $identifiers = array();
368 $identifiers = $this->getIdentifierIds();
369 foreach ($identifiers as $id) {
370 $ide = &$this->getIdentifier($id);
371 $ide->setExportMode($this->getExportMode());
372 $ide->toXML($writer);
373 $first = false;
374 }
375 if (!count($identifiers)) {
376 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier.php';
377 $ide = new ilMD5295Identifier(
378 $this->getRBACId(),
379 $this->getObjId(),
380 $this->getObjType()
381 ); // added type, alex, 31 Oct 2007
382 $ide->setExportMode(true);
383 $ide->toXML($writer, true);
384 }
385
386 // Title
387 $writer->xmlElement(
388 'Title',
389 array('Language' => $this->getTitleLanguageCode() ?
390 $this->getTitleLanguageCode() :
391 'en'),
392 $this->getTitle()
393 );
394
395 // Language
396 $languages = $this->getLanguageIds();
397 foreach ($languages as $id) {
398 $lan = &$this->getLanguage($id);
399 $lan->toXML($writer);
400 }
401 if (!count($languages)) {
402 // Default
403 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Language.php';
404 $lan = new ilMD5295Language($this->getRBACId(), $this->getObjId());
405 $lan->toXML($writer);
406 }
407
408 // Description
409 $descriptions = $this->getDescriptionIds();
410 foreach ($descriptions as $id) {
411 $des = &$this->getDescription($id);
412 $des->toXML($writer);
413 }
414 if (!count($descriptions)) {
415 // Default
416 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php';
417 $des = new ilMD5295Description($this->getRBACId(), $this->getObjId());
418 $des->toXML($writer);
419 }
420
421
422 // Keyword
423 $keywords = $this->getKeywordIds();
424 foreach ($keywords as $id) {
425 $key = &$this->getKeyword($id);
426 $key->toXML($writer);
427 }
428 if (!count($keywords)) {
429 // Default
430 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Keyword.php';
431 $key = new ilMD5295Keyword($this->getRBACId(), $this->getObjId());
432 $key->toXML($writer);
433 }
434
435 // Copverage
436 if (strlen($this->getCoverage())) {
437 $writer->xmlElement(
438 'Coverage',
439 array('Language' => $this->getCoverageLanguageCode() ?
440 $this->getCoverageLanguageCode() :
441 'en'),
442 $this->getCoverage()
443 );
444 }
445 $writer->xmlEndTag('General');
446 }

References getCoverage(), getCoverageLanguageCode(), getDescription(), getDescriptionIds(), ilMD5295Base\getExportMode(), getIdentifier(), getIdentifierIds(), getKeyword(), getKeywordIds(), getLanguage(), getLanguageIds(), ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), ilMD5295Base\getRBACId(), getStructure(), getTitle(), and getTitleLanguageCode().

+ Here is the call graph for this function:

◆ update()

ilMD5295General::update ( )

Reimplemented from ilMD5295Base.

Definition at line 251 of file class.ilMD5295General.php.

252 {
253 global $DIC;
254
255 $ilDB = $DIC['ilDB'];
256
257 if ($this->getMetaId()) {
258 if ($this->db->update(
259 'il_meta_general',
260 $this->__getFields(),
261 array("meta_general_id" => array('integer',$this->getMetaId()))
262 )) {
263 return true;
264 }
265 }
266 return false;
267 }

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: