ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMDGeneral Class Reference
+ Inheritance diagram for ilMDGeneral:
+ Collaboration diagram for ilMDGeneral:

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)
 
 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)
 
 _getId ($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 _getId ($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 34 of file class.ilMDGeneral.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDGeneral::__getFields ( )

Definition at line 323 of file class.ilMDGeneral.php.

324 {
325 return array('rbac_id' => array('integer',$this->getRBACId()),
326 'obj_id' => array('integer',$this->getObjId()),
327 'obj_type' => array('text',$this->getObjType()),
328 'general_structure' => array('text',$this->getStructure()),
329 'title' => array('text',$this->getTitle()),
330 'title_language' => array('text',$this->getTitleLanguageCode()),
331 'coverage' => array('text',$this->getCoverage()),
332 'coverage_language' => array('text',$this->getCoverageLanguageCode()));
333 }

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

Referenced by save().

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

◆ __getFields() [2/2]

ilMDGeneral::__getFields ( )

Definition at line 321 of file class.ilMDGeneral.php.

322 {
323 return array('rbac_id' => $this->getRBACId(),
324 'obj_id' => $this->getObjId(),
325 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
326 'general_structure' => ilUtil::prepareDBString($this->getStructure()),
327 'title' => ilUtil::prepareDBString($this->getTitle()),
328 'title_language' => ilUtil::prepareDBString($this->getTitleLanguageCode()),
329 'coverage' => ilUtil::prepareDBString($this->getCoverage()),
330 'coverage_language' => ilUtil::prepareDBString($this->getCoverageLanguageCode()));
331 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

References getCoverage(), getCoverageLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), getStructure(), getTitle(), getTitleLanguageCode(), and ilUtil\prepareDBString().

+ Here is the call graph for this function:

◆ _getId() [1/2]

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

Definition at line 460 of file class.ilMDGeneral.php.

461 {
462 global $ilDB;
463
464 $query = "SELECT meta_general_id FROM il_meta_general ".
465 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
466 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
467
468
469 $res = $ilDB->query($query);
470 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
471 {
472 return $row->meta_general_id;
473 }
474 return false;
475 }
global $ilDB

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

Referenced by ilMD\getGeneral().

+ Here is the caller graph for this function:

◆ _getId() [2/2]

ilMDGeneral::_getId (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 411 of file class.ilMDGeneral.php.

412 {
413 global $ilDB;
414
415 $query = "SELECT meta_general_id FROM il_meta_general ".
416 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
417 "AND obj_id = ".$ilDB->quote($a_obj_id);
418
419
420 $res = $ilDB->query($query);
421 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
422 {
423 return $row->meta_general_id;
424 }
425 return false;
426 }

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

◆ addDescription() [1/2]

& ilMDGeneral::addDescription ( )

Definition at line 127 of file class.ilMDGeneral.php.

128 {
129 include_once 'Services/MetaData/classes/class.ilMDDescription.php';
130
131 $des = new ilMDDescription($this->getRBACId(),$this->getObjId(),$this->getObjType());
132 $des->setParentId($this->getMetaId());
133 $des->setParentType('meta_general');
134
135 return $des;
136 }

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

+ Here is the call graph for this function:

◆ addDescription() [2/2]

& ilMDGeneral::addDescription ( )

Definition at line 127 of file class.ilMDGeneral.php.

128 {
129 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
130
131 $des = new ilMDDescription($this->getRBACId(),$this->getObjId(),$this->getObjType());
132 $des->setParentId($this->getMetaId());
133 $des->setParentType('meta_general');
134
135 return $des;
136 }

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

+ Here is the call graph for this function:

◆ addIdentifier() [1/2]

& ilMDGeneral::addIdentifier ( )

Definition at line 67 of file class.ilMDGeneral.php.

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

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

+ Here is the call graph for this function:

◆ addIdentifier() [2/2]

& ilMDGeneral::addIdentifier ( )

Definition at line 67 of file class.ilMDGeneral.php.

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

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

+ Here is the call graph for this function:

◆ addKeyword() [1/2]

& ilMDGeneral::addKeyword ( )

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

157 {
158 include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
159
160 $key = new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
161 $key->setParentId($this->getMetaId());
162 $key->setParentType('meta_general');
163
164 return $key;
165 }

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

Referenced by ilMDKeyword\updateKeywords().

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

◆ addKeyword() [2/2]

& ilMDGeneral::addKeyword ( )

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

157 {
158 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
159
160 $key = new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
161 $key->setParentId($this->getMetaId());
162 $key->setParentType('meta_general');
163
164 return $key;
165 }

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

+ Here is the call graph for this function:

◆ addLanguage() [1/2]

& ilMDGeneral::addLanguage ( )

Definition at line 97 of file class.ilMDGeneral.php.

98 {
99 include_once 'Services/MetaData/classes/class.ilMDLanguage.php';
100
101 $lan = new ilMDLanguage($this->getRBACId(),$this->getObjId(),$this->getObjType());
102 $lan->setParentId($this->getMetaId());
103 $lan->setParentType('meta_general');
104
105 return $lan;
106 }

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

+ Here is the call graph for this function:

◆ addLanguage() [2/2]

& ilMDGeneral::addLanguage ( )

Definition at line 97 of file class.ilMDGeneral.php.

98 {
99 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguage.php';
100
101 $lan = new ilMDLanguage($this->getRBACId(),$this->getObjId(),$this->getObjType());
102 $lan->setParentId($this->getMetaId());
103 $lan->setParentType('meta_general');
104
105 return $lan;
106 }

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

+ Here is the call graph for this function:

◆ delete() [1/2]

ilMDGeneral::delete ( )

Reimplemented from ilMDBase.

Definition at line 274 of file class.ilMDGeneral.php.

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

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

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDGeneral::delete ( )

Reimplemented from ilMDBase.

Definition at line 270 of file class.ilMDGeneral.php.

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

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

+ Here is the call graph for this function:

◆ getCoverage() [1/2]

ilMDGeneral::getCoverage ( )

Definition at line 218 of file class.ilMDGeneral.php.

219 {
220 return $this->coverage;
221 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getCoverage() [2/2]

ilMDGeneral::getCoverage ( )

Definition at line 218 of file class.ilMDGeneral.php.

219 {
220 return $this->coverage;
221 }

◆ getCoverageLanguage() [1/2]

& ilMDGeneral::getCoverageLanguage ( )

Definition at line 230 of file class.ilMDGeneral.php.

231 {
232 return is_object($this->coverage_language) ? $this->coverage_language : false;
233 }

◆ getCoverageLanguage() [2/2]

& ilMDGeneral::getCoverageLanguage ( )

Definition at line 230 of file class.ilMDGeneral.php.

231 {
232 return is_object($this->coverage_language) ? $this->coverage_language : false;
233 }

◆ getCoverageLanguageCode() [1/2]

ilMDGeneral::getCoverageLanguageCode ( )

Definition at line 234 of file class.ilMDGeneral.php.

235 {
236 return is_object($this->coverage_language) ? $this->coverage_language->getLanguageCode() : false;
237 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getCoverageLanguageCode() [2/2]

ilMDGeneral::getCoverageLanguageCode ( )

Definition at line 234 of file class.ilMDGeneral.php.

235 {
236 return is_object($this->coverage_language) ? $this->coverage_language->getLanguageCode() : false;
237 }

◆ getDescription() [1/2]

& ilMDGeneral::getDescription (   $a_description_id)

Definition at line 113 of file class.ilMDGeneral.php.

114 {
115 include_once 'Services/MetaData/classes/class.ilMDDescription.php';
116
117
118 if(!$a_description_id)
119 {
120 return false;
121 }
122 $des = new ilMDDescription();
123 $des->setMetaId($a_description_id);
124
125 return $des;
126 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getDescription() [2/2]

& ilMDGeneral::getDescription (   $a_description_id)

Definition at line 113 of file class.ilMDGeneral.php.

114 {
115 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
116
117
118 if(!$a_description_id)
119 {
120 return false;
121 }
122 $des = new ilMDDescription();
123 $des->setMetaId($a_description_id);
124
125 return $des;
126 }

◆ getDescriptionIds() [1/2]

& ilMDGeneral::getDescriptionIds ( )

Definition at line 107 of file class.ilMDGeneral.php.

108 {
109 include_once 'Services/MetaData/classes/class.ilMDDescription.php';
110
111 return ilMDDescription::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
112 }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)

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

◆ getDescriptionIds() [2/2]

& ilMDGeneral::getDescriptionIds ( )

Definition at line 107 of file class.ilMDGeneral.php.

108 {
109 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
110
111 return ilMDDescription::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
112 }

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

+ Here is the call graph for this function:

◆ getIdentifier() [1/2]

& ilMDGeneral::getIdentifier (   $a_identifier_id)

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

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

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getIdentifier() [2/2]

& ilMDGeneral::getIdentifier (   $a_identifier_id)

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

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

◆ getIdentifierIds() [1/2]

& ilMDGeneral::getIdentifierIds ( )

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

49 {
50 include_once 'Services/MetaData/classes/class.ilMDIdentifier.php';
51
52 return ilMDIdentifier::_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 ilMDIdentifier\_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:

◆ getIdentifierIds() [2/2]

& ilMDGeneral::getIdentifierIds ( )

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

49 {
50 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier.php';
51
52 return ilMDIdentifier::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
53 }

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

+ Here is the call graph for this function:

◆ getKeyword() [1/2]

& ilMDGeneral::getKeyword (   $a_keyword_id)

Definition at line 143 of file class.ilMDGeneral.php.

144 {
145 include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
146
147 if(!$a_keyword_id)
148 {
149 return false;
150 }
151 $key = new ilMDKeyword();
152 $key->setMetaId($a_keyword_id);
153
154 return $key;
155 }

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

+ Here is the caller graph for this function:

◆ getKeyword() [2/2]

& ilMDGeneral::getKeyword (   $a_keyword_id)

Definition at line 143 of file class.ilMDGeneral.php.

144 {
145 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
146
147 if(!$a_keyword_id)
148 {
149 return false;
150 }
151 $key = new ilMDKeyword();
152 $key->setMetaId($a_keyword_id);
153
154 return $key;
155 }

◆ getKeywordIds() [1/2]

& ilMDGeneral::getKeywordIds ( )

Definition at line 137 of file class.ilMDGeneral.php.

138 {
139 include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
140
141 return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
142 }
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(), toXML(), and ilMDKeyword\updateKeywords().

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

◆ getKeywordIds() [2/2]

& ilMDGeneral::getKeywordIds ( )

Definition at line 137 of file class.ilMDGeneral.php.

138 {
139 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
140
141 return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
142 }

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

+ Here is the call graph for this function:

◆ getLanguage() [1/2]

& ilMDGeneral::getLanguage (   $a_language_id)

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

84 {
85 include_once 'Services/MetaData/classes/class.ilMDLanguage.php';
86
87 if(!$a_language_id)
88 {
89 return false;
90 }
91 $lan = new ilMDLanguage();
92 $lan->setMetaId($a_language_id);
93
94 return $lan;
95
96 }

Referenced by delete(), and toXML().

+ Here is the caller graph for this function:

◆ getLanguage() [2/2]

& ilMDGeneral::getLanguage (   $a_language_id)

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

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

◆ getLanguageIds() [1/2]

& ilMDGeneral::getLanguageIds ( )

Definition at line 77 of file class.ilMDGeneral.php.

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

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

◆ getLanguageIds() [2/2]

& ilMDGeneral::getLanguageIds ( )

Definition at line 77 of file class.ilMDGeneral.php.

78 {
79 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguage.php';
80
81 return ilMDLanguage::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
82 }

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

+ Here is the call graph for this function:

◆ getPossibleSubelements() [1/2]

ilMDGeneral::getPossibleSubelements ( )

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

◆ getPossibleSubelements() [2/2]

ilMDGeneral::getPossibleSubelements ( )

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

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

◆ getStructure() [1/2]

ilMDGeneral::getStructure ( )

Definition at line 186 of file class.ilMDGeneral.php.

187 {
188 return $this->structure;
189 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getStructure() [2/2]

ilMDGeneral::getStructure ( )

Definition at line 186 of file class.ilMDGeneral.php.

187 {
188 return $this->structure;
189 }

◆ getTitle() [1/2]

ilMDGeneral::getTitle ( )

Definition at line 194 of file class.ilMDGeneral.php.

195 {
196 return $this->title;
197 }

References $title.

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTitle() [2/2]

ilMDGeneral::getTitle ( )

Definition at line 194 of file class.ilMDGeneral.php.

195 {
196 return $this->title;
197 }

References $title.

◆ getTitleLanguage() [1/2]

& ilMDGeneral::getTitleLanguage ( )

Definition at line 205 of file class.ilMDGeneral.php.

206 {
207 return is_object($this->title_language) ? $this->title_language : false;
208 }

◆ getTitleLanguage() [2/2]

& ilMDGeneral::getTitleLanguage ( )

Definition at line 205 of file class.ilMDGeneral.php.

206 {
207 return is_object($this->title_language) ? $this->title_language : false;
208 }

◆ getTitleLanguageCode() [1/2]

ilMDGeneral::getTitleLanguageCode ( )

Definition at line 209 of file class.ilMDGeneral.php.

210 {
211 return is_object($this->title_language) ? $this->title_language->getLanguageCode() : false;
212 }

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getTitleLanguageCode() [2/2]

ilMDGeneral::getTitleLanguageCode ( )

Definition at line 209 of file class.ilMDGeneral.php.

210 {
211 return is_object($this->title_language) ? $this->title_language->getLanguageCode() : false;
212 }

◆ read() [1/2]

ilMDGeneral::read ( )

Definition at line 335 of file class.ilMDGeneral.php.

336 {
337 global $ilDB;
338
339 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
340
341 if($this->getMetaId())
342 {
343 $query = "SELECT * FROM il_meta_general ".
344 "WHERE meta_general_id = ".$ilDB->quote($this->getMetaId() ,'integer');
345
346 $res = $this->db->query($query);
347 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
348 {
349 $this->setRBACId($row->rbac_id);
350 $this->setObjId($row->obj_id);
351 $this->setObjType($row->obj_type);
352 $this->setStructure($row->general_structure);
353 $this->setTitle($row->title);
354 $this->setTitleLanguage(new ilMDLanguageItem($row->title_language));
355 $this->setCoverage($row->coverage);
356 $this->setCoverageLanguage(new ilMDLanguageItem($row->coverage_language));
357 }
358 }
359 return true;
360 }
setObjId($a_id)
setObjType($a_type)
setRBACId($a_id)
setStructure($a_structure)
setCoverage($a_coverage)
setTitle($a_title)
setCoverageLanguage(&$lng_obj)
setTitleLanguage(&$lng_obj)

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

+ Here is the call graph for this function:

◆ read() [2/2]

ilMDGeneral::read ( )

Definition at line 333 of file class.ilMDGeneral.php.

334 {
335 global $ilDB;
336
337 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
338
339 if($this->getMetaId())
340 {
341 $query = "SELECT * FROM il_meta_general ".
342 "WHERE meta_general_id = ".$ilDB->quote($this->getMetaId());
343
344 $res = $this->db->query($query);
345 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
346 {
347 $this->setRBACId($row->rbac_id);
348 $this->setObjId($row->obj_id);
349 $this->setObjType($row->obj_type);
350 $this->setStructure(ilUtil::stripSlashes($row->general_structure));
351 $this->setTitle(ilUtil::stripSlashes($row->title));
352 $this->setTitleLanguage(new ilMDLanguageItem($row->title_language));
353 $this->setCoverage(ilUtil::stripSlashes($row->coverage));
354 $this->setCoverageLanguage(new ilMDLanguageItem($row->coverage_language));
355 }
356 }
357 return true;
358 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setCoverage(), setCoverageLanguage(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), setStructure(), setTitle(), setTitleLanguage(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ save() [1/2]

ilMDGeneral::save ( )

Reimplemented from ilMDBase.

Definition at line 240 of file class.ilMDGeneral.php.

241 {
242 global $ilDB;
243
244 $fields = $this->__getFields();
245 $fields['meta_general_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_general'));
246
247 //$this->log->debug("Insert General ".print_r($fields, true));
248 //ilUtil::printBacktrace(10);
249
250 if($this->db->insert('il_meta_general',$fields))
251 {
252 $this->setMetaId($next_id);
253 return $this->getMetaId();
254 }
255 return false;
256 }
setMetaId($a_meta_id, $a_read_data=true)

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

+ Here is the call graph for this function:

◆ save() [2/2]

ilMDGeneral::save ( )

Reimplemented from ilMDBase.

Definition at line 240 of file class.ilMDGeneral.php.

241 {
242 if($this->db->autoExecute('il_meta_general',
243 $this->__getFields(),
245 {
246 $this->setMetaId($this->db->getLastInsertId());
247
248 return $this->getMetaId();
249 }
250 return false;
251 }

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

+ Here is the call graph for this function:

◆ setCoverage() [1/2]

ilMDGeneral::setCoverage (   $a_coverage)

Definition at line 214 of file class.ilMDGeneral.php.

215 {
216 $this->coverage = $a_coverage;
217 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCoverage() [2/2]

ilMDGeneral::setCoverage (   $a_coverage)

Definition at line 214 of file class.ilMDGeneral.php.

215 {
216 $this->coverage = $a_coverage;
217 }

◆ setCoverageLanguage() [1/2]

ilMDGeneral::setCoverageLanguage ( $lng_obj)

Definition at line 223 of file class.ilMDGeneral.php.

224 {
225 if(is_object($lng_obj))
226 {
227 $this->coverage_language = $lng_obj;
228 }
229 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCoverageLanguage() [2/2]

ilMDGeneral::setCoverageLanguage ( $lng_obj)

Definition at line 223 of file class.ilMDGeneral.php.

224 {
225 if(is_object($lng_obj))
226 {
227 $this->coverage_language =& $lng_obj;
228 }
229 }

◆ setStructure() [1/2]

ilMDGeneral::setStructure (   $a_structure)

Definition at line 170 of file class.ilMDGeneral.php.

171 {
172 switch($a_structure)
173 {
174 case 'Atomic':
175 case 'Collection':
176 case 'Networked':
177 case 'Hierarchical':
178 case 'Linear':
179 $this->structure = $a_structure;
180 return true;
181
182 default:
183 return false;
184 }
185 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStructure() [2/2]

ilMDGeneral::setStructure (   $a_structure)

Definition at line 170 of file class.ilMDGeneral.php.

171 {
172 switch($a_structure)
173 {
174 case 'Atomic':
175 case 'Collection':
176 case 'Networked':
177 case 'Hierarchical':
178 case 'Linear':
179 $this->structure = $a_structure;
180 return true;
181
182 default:
183 return false;
184 }
185 }

◆ setTitle() [1/2]

ilMDGeneral::setTitle (   $a_title)

Definition at line 190 of file class.ilMDGeneral.php.

191 {
192 $this->title = $a_title;
193 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle() [2/2]

ilMDGeneral::setTitle (   $a_title)

Definition at line 190 of file class.ilMDGeneral.php.

191 {
192 $this->title = $a_title;
193 }

◆ setTitleLanguage() [1/2]

ilMDGeneral::setTitleLanguage ( $lng_obj)

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

199 {
200 if(is_object($lng_obj))
201 {
202 $this->title_language = $lng_obj;
203 }
204 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitleLanguage() [2/2]

ilMDGeneral::setTitleLanguage ( $lng_obj)

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

199 {
200 if(is_object($lng_obj))
201 {
202 $this->title_language = $lng_obj;
203 }
204 }

◆ toXML() [1/2]

ilMDGeneral::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 367 of file class.ilMDGeneral.php.

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

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

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDGeneral::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 365 of file class.ilMDGeneral.php.

366 {
367 $writer->xmlStartTag('General',array('Structure' => $this->getStructure()));
368
369 // Identifier
370 foreach($this->getIdentifierIds() as $id)
371 {
372 $ide =& $this->getIdentifier($id);
373 $ide->toXML($writer);
374 }
375
376 // TItle
377 $writer->xmlElement('Title',array('Language' => $this->getTitleLanguageCode()),$this->getTitle());
378
379 // Language
380 foreach($this->getLanguageIds() as $id)
381 {
382 $lan =& $this->getLanguage($id);
383 $lan->toXML($writer);
384 }
385
386 // Description
387 foreach($this->getDescriptionIds() as $id)
388 {
389 $des =& $this->getDescription($id);
390 $des->toXML($writer);
391 }
392
393 // Keyword
394 foreach($this->getKeywordIds() as $id)
395 {
396 $key =& $this->getKeyword($id);
397 $key->toXML($writer);
398 }
399
400 // Copverage
401 if(strlen($this->getCoverage()))
402 {
403 $writer->xmlElement('Coverage',array('Language' => $this->getCoverageLanguageCode()),$this->getCoverage());
404 }
405 $writer->xmlEndTag('General');
406 }

References getCoverage(), getCoverageLanguageCode(), getDescription(), getDescriptionIds(), getIdentifier(), getIdentifierIds(), getKeyword(), getKeywordIds(), getLanguage(), getLanguageIds(), getStructure(), getTitle(), and getTitleLanguageCode().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDGeneral::update ( )

Reimplemented from ilMDBase.

Definition at line 258 of file class.ilMDGeneral.php.

259 {
260 global $ilDB;
261
262 if($this->getMetaId())
263 {
264 if($this->db->update('il_meta_general',
265 $this->__getFields(),
266 array("meta_general_id" => array('integer',$this->getMetaId()))))
267 {
268 return true;
269 }
270 }
271 return false;
272 }

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDGeneral::update ( )

Reimplemented from ilMDBase.

Definition at line 253 of file class.ilMDGeneral.php.

254 {
255 global $ilDB;
256
257 if($this->getMetaId())
258 {
259 if($this->db->autoExecute('il_meta_general',
260 $this->__getFields(),
262 "meta_general_id = ".$ilDB->quote($this->getMetaId())))
263 {
264 return true;
265 }
266 }
267 return false;
268 }

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

+ Here is the call graph for this function:

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