ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMDGeneral Class Reference
+ Inheritance diagram for ilMDGeneral:
+ Collaboration diagram for ilMDGeneral:

Public Member Functions

 ilMDGeneral ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 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)
 
 ilMDGeneral ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 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
 ilMDBase ($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)
 
 ilMDBase ($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)
 

Additional Inherited Members

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

Detailed Description

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

Member Function Documentation

◆ __getFields() [1/2]

ilMDGeneral::__getFields ( )

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

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

Referenced by save().

327  {
328  return array('rbac_id' => array('integer',$this->getRBACId()),
329  'obj_id' => array('integer',$this->getObjId()),
330  'obj_type' => array('text',$this->getObjType()),
331  'general_structure' => array('text',$this->getStructure()),
332  'title' => array('text',$this->getTitle()),
333  'title_language' => array('text',$this->getTitleLanguageCode()),
334  'coverage' => array('text',$this->getCoverage()),
335  'coverage_language' => array('text',$this->getCoverageLanguageCode()));
336  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDGeneral::__getFields ( )

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

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

328  {
329  return array('rbac_id' => $this->getRBACId(),
330  'obj_id' => $this->getObjId(),
331  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
332  'general_structure' => ilUtil::prepareDBString($this->getStructure()),
333  'title' => ilUtil::prepareDBString($this->getTitle()),
334  'title_language' => ilUtil::prepareDBString($this->getTitleLanguageCode()),
335  'coverage' => ilUtil::prepareDBString($this->getCoverage()),
336  'coverage_language' => ilUtil::prepareDBString($this->getCoverageLanguageCode()));
337  }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ _getId() [1/2]

ilMDGeneral::_getId (   $a_rbac_id,
  $a_obj_id 
)

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

418  {
419  global $ilDB;
420 
421  $query = "SELECT meta_general_id FROM il_meta_general ".
422  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
423  "AND obj_id = ".$ilDB->quote($a_obj_id);
424 
425 
426  $res = $ilDB->query($query);
427  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
428  {
429  return $row->meta_general_id;
430  }
431  return false;
432  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

◆ _getId() [2/2]

ilMDGeneral::_getId (   $a_rbac_id,
  $a_obj_id 
)

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilMD\getGeneral().

464  {
465  global $ilDB;
466 
467  $query = "SELECT meta_general_id FROM il_meta_general ".
468  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
469  "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
470 
471 
472  $res = $ilDB->query($query);
473  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
474  {
475  return $row->meta_general_id;
476  }
477  return false;
478  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ addDescription() [1/2]

& ilMDGeneral::addDescription ( )

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

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

134  {
135  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
136 
137  $des =& new ilMDDescription($this->getRBACId(),$this->getObjId(),$this->getObjType());
138  $des->setParentId($this->getMetaId());
139  $des->setParentType('meta_general');
140 
141  return $des;
142  }
+ Here is the call graph for this function:

◆ addDescription() [2/2]

& ilMDGeneral::addDescription ( )

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

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

134  {
135  include_once 'Services/MetaData/classes/class.ilMDDescription.php';
136 
137  $des =& new ilMDDescription($this->getRBACId(),$this->getObjId(),$this->getObjType());
138  $des->setParentId($this->getMetaId());
139  $des->setParentType('meta_general');
140 
141  return $des;
142  }
+ Here is the call graph for this function:

◆ addIdentifier() [1/2]

& ilMDGeneral::addIdentifier ( )

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

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

74  {
75  include_once 'Services/MetaData/classes/class.ilMDIdentifier.php';
76 
77  $ide =& new ilMDIdentifier($this->getRBACId(),$this->getObjId(),$this->getObjType());
78  $ide->setParentId($this->getMetaId());
79  $ide->setParentType('meta_general');
80 
81  return $ide;
82  }
+ Here is the call graph for this function:

◆ addIdentifier() [2/2]

& ilMDGeneral::addIdentifier ( )

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

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

74  {
75  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier.php';
76 
77  $ide =& new ilMDIdentifier($this->getRBACId(),$this->getObjId(),$this->getObjType());
78  $ide->setParentId($this->getMetaId());
79  $ide->setParentType('meta_general');
80 
81  return $ide;
82  }
+ Here is the call graph for this function:

◆ addKeyword() [1/2]

& ilMDGeneral::addKeyword ( )

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

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

163  {
164  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
165 
166  $key =& new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
167  $key->setParentId($this->getMetaId());
168  $key->setParentType('meta_general');
169 
170  return $key;
171  }
+ Here is the call graph for this function:

◆ addKeyword() [2/2]

& ilMDGeneral::addKeyword ( )

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

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

Referenced by ilMDKeyword\updateKeywords().

163  {
164  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
165 
166  $key =& new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
167  $key->setParentId($this->getMetaId());
168  $key->setParentType('meta_general');
169 
170  return $key;
171  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLanguage() [1/2]

& ilMDGeneral::addLanguage ( )

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

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

104  {
105  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguage.php';
106 
107  $lan =& new ilMDLanguage($this->getRBACId(),$this->getObjId(),$this->getObjType());
108  $lan->setParentId($this->getMetaId());
109  $lan->setParentType('meta_general');
110 
111  return $lan;
112  }
+ Here is the call graph for this function:

◆ addLanguage() [2/2]

& ilMDGeneral::addLanguage ( )

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

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

104  {
105  include_once 'Services/MetaData/classes/class.ilMDLanguage.php';
106 
107  $lan =& new ilMDLanguage($this->getRBACId(),$this->getObjId(),$this->getObjType());
108  $lan->setParentId($this->getMetaId());
109  $lan->setParentType('meta_general');
110 
111  return $lan;
112  }
+ Here is the call graph for this function:

◆ delete() [1/2]

ilMDGeneral::delete ( )

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

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

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

◆ delete() [2/2]

ilMDGeneral::delete ( )

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

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

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

◆ getCoverage() [1/2]

ilMDGeneral::getCoverage ( )

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

Referenced by __getFields(), and toXML().

225  {
226  return $this->coverage;
227  }
+ Here is the caller graph for this function:

◆ getCoverage() [2/2]

ilMDGeneral::getCoverage ( )

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

225  {
226  return $this->coverage;
227  }

◆ getCoverageLanguage() [1/2]

& ilMDGeneral::getCoverageLanguage ( )

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

237  {
238  return is_object($this->coverage_language) ? $this->coverage_language : false;
239  }

◆ getCoverageLanguage() [2/2]

& ilMDGeneral::getCoverageLanguage ( )

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

237  {
238  return is_object($this->coverage_language) ? $this->coverage_language : false;
239  }

◆ getCoverageLanguageCode() [1/2]

ilMDGeneral::getCoverageLanguageCode ( )

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

241  {
242  return is_object($this->coverage_language) ? $this->coverage_language->getLanguageCode() : false;
243  }

◆ getCoverageLanguageCode() [2/2]

ilMDGeneral::getCoverageLanguageCode ( )

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

Referenced by __getFields(), and toXML().

241  {
242  return is_object($this->coverage_language) ? $this->coverage_language->getLanguageCode() : false;
243  }
+ Here is the caller graph for this function:

◆ getDescription() [1/2]

& ilMDGeneral::getDescription (   $a_description_id)

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

120  {
121  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
122 
123 
124  if(!$a_description_id)
125  {
126  return false;
127  }
128  $des =& new ilMDDescription();
129  $des->setMetaId($a_description_id);
130 
131  return $des;
132  }

◆ getDescription() [2/2]

& ilMDGeneral::getDescription (   $a_description_id)

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

Referenced by delete(), and toXML().

120  {
121  include_once 'Services/MetaData/classes/class.ilMDDescription.php';
122 
123 
124  if(!$a_description_id)
125  {
126  return false;
127  }
128  $des =& new ilMDDescription();
129  $des->setMetaId($a_description_id);
130 
131  return $des;
132  }
+ Here is the caller graph for this function:

◆ getDescriptionIds() [1/2]

& ilMDGeneral::getDescriptionIds ( )

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

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

Referenced by delete(), and toXML().

114  {
115  include_once 'Services/MetaData/classes/class.ilMDDescription.php';
116 
117  return ilMDDescription::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
118  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescriptionIds() [2/2]

& ilMDGeneral::getDescriptionIds ( )

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

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

114  {
115  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
116 
117  return ilMDDescription::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
118  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getIdentifier() [1/2]

& ilMDGeneral::getIdentifier (   $a_identifier_id)

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

61  {
62  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier.php';
63 
64  if(!$a_identifier_id)
65  {
66  return false;
67  }
68  $ide =& new ilMDIdentifier();
69  $ide->setMetaId($a_identifier_id);
70 
71  return $ide;
72  }

◆ getIdentifier() [2/2]

& ilMDGeneral::getIdentifier (   $a_identifier_id)

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

Referenced by delete(), and toXML().

61  {
62  include_once 'Services/MetaData/classes/class.ilMDIdentifier.php';
63 
64  if(!$a_identifier_id)
65  {
66  return false;
67  }
68  $ide =& new ilMDIdentifier();
69  $ide->setMetaId($a_identifier_id);
70 
71  return $ide;
72  }
+ Here is the caller graph for this function:

◆ getIdentifierIds() [1/2]

& ilMDGeneral::getIdentifierIds ( )

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

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

55  {
56  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier.php';
57 
58  return ilMDIdentifier::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
59  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getIdentifierIds() [2/2]

& ilMDGeneral::getIdentifierIds ( )

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

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

Referenced by delete(), and toXML().

55  {
56  include_once 'Services/MetaData/classes/class.ilMDIdentifier.php';
57 
58  return ilMDIdentifier::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
59  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getKeyword() [1/2]

& ilMDGeneral::getKeyword (   $a_keyword_id)

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

150  {
151  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
152 
153  if(!$a_keyword_id)
154  {
155  return false;
156  }
157  $key =& new ilMDKeyword();
158  $key->setMetaId($a_keyword_id);
159 
160  return $key;
161  }

◆ getKeyword() [2/2]

& ilMDGeneral::getKeyword (   $a_keyword_id)

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

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

150  {
151  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
152 
153  if(!$a_keyword_id)
154  {
155  return false;
156  }
157  $key =& new ilMDKeyword();
158  $key->setMetaId($a_keyword_id);
159 
160  return $key;
161  }
+ Here is the caller graph for this function:

◆ getKeywordIds() [1/2]

& ilMDGeneral::getKeywordIds ( )

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

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

144  {
145  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
146 
147  return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
148  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getKeywordIds() [2/2]

& ilMDGeneral::getKeywordIds ( )

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

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

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

144  {
145  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
146 
147  return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
148  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLanguage() [1/2]

& ilMDGeneral::getLanguage (   $a_language_id)

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

90  {
91  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguage.php';
92 
93  if(!$a_language_id)
94  {
95  return false;
96  }
97  $lan =& new ilMDLanguage();
98  $lan->setMetaId($a_language_id);
99 
100  return $lan;
101 
102  }

◆ getLanguage() [2/2]

& ilMDGeneral::getLanguage (   $a_language_id)

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

Referenced by delete(), and toXML().

90  {
91  include_once 'Services/MetaData/classes/class.ilMDLanguage.php';
92 
93  if(!$a_language_id)
94  {
95  return false;
96  }
97  $lan =& new ilMDLanguage();
98  $lan->setMetaId($a_language_id);
99 
100  return $lan;
101 
102  }
+ Here is the caller graph for this function:

◆ getLanguageIds() [1/2]

& ilMDGeneral::getLanguageIds ( )

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

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

84  {
85  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguage.php';
86 
87  return ilMDLanguage::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
88  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getLanguageIds() [2/2]

& ilMDGeneral::getLanguageIds ( )

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

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

Referenced by delete(), and toXML().

84  {
85  include_once 'Services/MetaData/classes/class.ilMDLanguage.php';
86 
87  return ilMDLanguage::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');
88  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPossibleSubelements() [1/2]

ilMDGeneral::getPossibleSubelements ( )

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

43  {
44  $subs['Identifier'] = 'meta_identifier';
45  $subs['Language'] = 'meta_language';
46  $subs['Description'] = 'meta_description';
47  $subs['Keyword'] = 'meta_keyword';
48 
49  return $subs;
50  }

◆ getPossibleSubelements() [2/2]

ilMDGeneral::getPossibleSubelements ( )

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

43  {
44  $subs['Keyword'] = 'meta_keyword';
45  $subs['Language'] = 'meta_language';
46  $subs['Identifier'] = 'meta_identifier';
47  $subs['Description'] = 'meta_description';
48 
49  return $subs;
50  }

◆ getStructure() [1/2]

ilMDGeneral::getStructure ( )

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

Referenced by __getFields(), and toXML().

193  {
194  return $this->structure;
195  }
+ Here is the caller graph for this function:

◆ getStructure() [2/2]

ilMDGeneral::getStructure ( )

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

193  {
194  return $this->structure;
195  }

◆ getTitle() [1/2]

ilMDGeneral::getTitle ( )

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

Referenced by __getFields(), and toXML().

201  {
202  return $this->title;
203  }
+ Here is the caller graph for this function:

◆ getTitle() [2/2]

ilMDGeneral::getTitle ( )

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

201  {
202  return $this->title;
203  }

◆ getTitleLanguage() [1/2]

& ilMDGeneral::getTitleLanguage ( )

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

212  {
213  return is_object($this->title_language) ? $this->title_language : false;
214  }

◆ getTitleLanguage() [2/2]

& ilMDGeneral::getTitleLanguage ( )

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

212  {
213  return is_object($this->title_language) ? $this->title_language : false;
214  }

◆ getTitleLanguageCode() [1/2]

ilMDGeneral::getTitleLanguageCode ( )

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

Referenced by __getFields(), and toXML().

216  {
217  return is_object($this->title_language) ? $this->title_language->getLanguageCode() : false;
218  }
+ Here is the caller graph for this function:

◆ getTitleLanguageCode() [2/2]

ilMDGeneral::getTitleLanguageCode ( )

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

216  {
217  return is_object($this->title_language) ? $this->title_language->getLanguageCode() : false;
218  }

◆ ilMDGeneral() [1/2]

ilMDGeneral::ilMDGeneral (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

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

37  {
38  parent::ilMDBase($a_rbac_id,
39  $a_obj_id,
40  $a_obj_type);
41  }

◆ ilMDGeneral() [2/2]

ilMDGeneral::ilMDGeneral (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

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

37  {
38  parent::ilMDBase($a_rbac_id,
39  $a_obj_id,
40  $a_obj_type);
41  }

◆ read() [1/2]

ilMDGeneral::read ( )

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

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

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

◆ read() [2/2]

ilMDGeneral::read ( )

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

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

340  {
341  global $ilDB;
342 
343  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
344 
345  if($this->getMetaId())
346  {
347  $query = "SELECT * FROM il_meta_general ".
348  "WHERE meta_general_id = ".$ilDB->quote($this->getMetaId());
349 
350  $res = $this->db->query($query);
351  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
352  {
353  $this->setRBACId($row->rbac_id);
354  $this->setObjId($row->obj_id);
355  $this->setObjType($row->obj_type);
356  $this->setStructure(ilUtil::stripSlashes($row->general_structure));
357  $this->setTitle(ilUtil::stripSlashes($row->title));
358  $this->setTitleLanguage(new ilMDLanguageItem($row->title_language));
359  $this->setCoverage(ilUtil::stripSlashes($row->coverage));
360  $this->setCoverageLanguage(new ilMDLanguageItem($row->coverage_language));
361  }
362  }
363  return true;
364  }
setCoverageLanguage(&$lng_obj)
setStructure($a_structure)
setObjType($a_type)
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setTitle($a_title)
setObjId($a_id)
setRBACId($a_id)
setCoverage($a_coverage)
setTitleLanguage(&$lng_obj)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilDB
+ Here is the call graph for this function:

◆ save() [1/2]

ilMDGeneral::save ( )

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

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

247  {
248  if($this->db->autoExecute('il_meta_general',
249  $this->__getFields(),
250  DB_AUTOQUERY_INSERT))
251  {
252  $this->setMetaId($this->db->getLastInsertId());
253 
254  return $this->getMetaId();
255  }
256  return false;
257  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/2]

ilMDGeneral::save ( )

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

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

247  {
248  global $ilDB;
249 
250  $fields = $this->__getFields();
251  $fields['meta_general_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_general'));
252 
253  if($this->db->insert('il_meta_general',$fields))
254  {
255  $this->setMetaId($next_id);
256  return $this->getMetaId();
257  }
258  return false;
259  }
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ setCoverage() [1/2]

ilMDGeneral::setCoverage (   $a_coverage)

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

221  {
222  $this->coverage = $a_coverage;
223  }

◆ setCoverage() [2/2]

ilMDGeneral::setCoverage (   $a_coverage)

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

Referenced by read().

221  {
222  $this->coverage = $a_coverage;
223  }
+ Here is the caller graph for this function:

◆ setCoverageLanguage() [1/2]

ilMDGeneral::setCoverageLanguage ( $lng_obj)

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

Referenced by read().

230  {
231  if(is_object($lng_obj))
232  {
233  $this->coverage_language = $lng_obj;
234  }
235  }
+ Here is the caller graph for this function:

◆ setCoverageLanguage() [2/2]

ilMDGeneral::setCoverageLanguage ( $lng_obj)

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

230  {
231  if(is_object($lng_obj))
232  {
233  $this->coverage_language =& $lng_obj;
234  }
235  }

◆ setStructure() [1/2]

ilMDGeneral::setStructure (   $a_structure)

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

177  {
178  switch($a_structure)
179  {
180  case 'Atomic':
181  case 'Collection':
182  case 'Networked':
183  case 'Hierarchical':
184  case 'Linear':
185  $this->structure = $a_structure;
186  return true;
187 
188  default:
189  return false;
190  }
191  }

◆ setStructure() [2/2]

ilMDGeneral::setStructure (   $a_structure)

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

Referenced by read().

177  {
178  switch($a_structure)
179  {
180  case 'Atomic':
181  case 'Collection':
182  case 'Networked':
183  case 'Hierarchical':
184  case 'Linear':
185  $this->structure = $a_structure;
186  return true;
187 
188  default:
189  return false;
190  }
191  }
+ Here is the caller graph for this function:

◆ setTitle() [1/2]

ilMDGeneral::setTitle (   $a_title)

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

197  {
198  $this->title = $a_title;
199  }

◆ setTitle() [2/2]

ilMDGeneral::setTitle (   $a_title)

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

Referenced by read().

197  {
198  $this->title = $a_title;
199  }
+ Here is the caller graph for this function:

◆ setTitleLanguage() [1/2]

ilMDGeneral::setTitleLanguage ( $lng_obj)

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

Referenced by read().

205  {
206  if(is_object($lng_obj))
207  {
208  $this->title_language = $lng_obj;
209  }
210  }
+ Here is the caller graph for this function:

◆ setTitleLanguage() [2/2]

ilMDGeneral::setTitleLanguage ( $lng_obj)

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

205  {
206  if(is_object($lng_obj))
207  {
208  $this->title_language = $lng_obj;
209  }
210  }

◆ toXML() [1/2]

ilMDGeneral::toXML ( $writer)

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

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

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

◆ toXML() [2/2]

ilMDGeneral::toXML ( $writer)

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

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

372  {
373  $writer->xmlStartTag('General',array('Structure' => $this->getStructure()));
374 
375  // Identifier
376  foreach($this->getIdentifierIds() as $id)
377  {
378  $ide =& $this->getIdentifier($id);
379  $ide->toXML($writer);
380  }
381 
382  // TItle
383  $writer->xmlElement('Title',array('Language' => $this->getTitleLanguageCode()),$this->getTitle());
384 
385  // Language
386  foreach($this->getLanguageIds() as $id)
387  {
388  $lan =& $this->getLanguage($id);
389  $lan->toXML($writer);
390  }
391 
392  // Description
393  foreach($this->getDescriptionIds() as $id)
394  {
395  $des =& $this->getDescription($id);
396  $des->toXML($writer);
397  }
398 
399  // Keyword
400  foreach($this->getKeywordIds() as $id)
401  {
402  $key =& $this->getKeyword($id);
403  $key->toXML($writer);
404  }
405 
406  // Copverage
407  if(strlen($this->getCoverage()))
408  {
409  $writer->xmlElement('Coverage',array('Language' => $this->getCoverageLanguageCode()),$this->getCoverage());
410  }
411  $writer->xmlEndTag('General');
412  }
& getLanguage($a_language_id)
& getKeyword($a_keyword_id)
& getIdentifier($a_identifier_id)
& getDescription($a_description_id)
+ Here is the call graph for this function:

◆ update() [1/2]

ilMDGeneral::update ( )

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

References $ilDB, and ilMDBase\getMetaId().

260  {
261  global $ilDB;
262 
263  if($this->getMetaId())
264  {
265  if($this->db->autoExecute('il_meta_general',
266  $this->__getFields(),
267  DB_AUTOQUERY_UPDATE,
268  "meta_general_id = ".$ilDB->quote($this->getMetaId())))
269  {
270  return true;
271  }
272  }
273  return false;
274  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/2]

ilMDGeneral::update ( )

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

References $ilDB, and ilMDBase\getMetaId().

262  {
263  global $ilDB;
264 
265  if($this->getMetaId())
266  {
267  if($this->db->update('il_meta_general',
268  $this->__getFields(),
269  array("meta_general_id" => array('integer',$this->getMetaId()))))
270  {
271  return true;
272  }
273  }
274  return false;
275  }
global $ilDB
+ Here is the call graph for this function:

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