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

Public Member Functions

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

Static Public Member Functions

static _getIds ($a_rbac_id, $a_obj_id)
 

Additional Inherited Members

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

Detailed Description

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

Member Function Documentation

◆ __getFields() [1/2]

ilMDClassification::__getFields ( )

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

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

Referenced by save().

205  {
206  return array('rbac_id' => array('integer',$this->getRBACId()),
207  'obj_id' => array('integer',$this->getObjId()),
208  'obj_type' => array('text',$this->getObjType()),
209  'purpose' => array('text',$this->getPurpose()),
210  'description' => array('text',$this->getDescription()),
211  'description_language' => array('text',$this->getDescriptionLanguageCode()));
212  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDClassification::__getFields ( )

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

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

205  {
206  return array('rbac_id' => $this->getRBACId(),
207  'obj_id' => $this->getObjId(),
208  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
209  'purpose' => ilUtil::prepareDBString($this->getPurpose()),
210  'description' => ilUtil::prepareDBString($this->getDescription()),
211  'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
212  }
Create styles array
The data for the language used.
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ _getIds() [1/2]

ilMDClassification::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

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

270  {
271  global $ilDB;
272 
273  $query = "SELECT meta_classification_id FROM il_meta_classification ".
274  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
275  "AND obj_id = ".$ilDB->quote($a_obj_id);
276 
277 
278  $res = $ilDB->query($query);
279  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
280  {
281  $ids[] = $row->meta_classification_id;
282  }
283  return $ids ? $ids : array();
284  }
Create styles array
The data for the language used.
global $ilDB

◆ _getIds() [2/2]

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

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

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

Referenced by ilMD\getClassificationIds().

290  {
291  global $ilDB;
292 
293  $query = "SELECT meta_classification_id FROM il_meta_classification ".
294  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
295  "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
296 
297 
298  $res = $ilDB->query($query);
299  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
300  {
301  $ids[] = $row->meta_classification_id;
302  }
303  return $ids ? $ids : array();
304  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ addKeyword() [1/2]

& ilMDClassification::addKeyword ( )

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

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

86  {
87  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
88 
89  $key = new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
90  $key->setParentId($this->getMetaId());
91  $key->setParentType('meta_classification');
92 
93  return $key;
94  }
+ Here is the call graph for this function:

◆ addKeyword() [2/2]

& ilMDClassification::addKeyword ( )

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

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

86  {
87  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
88 
89  $key = new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
90  $key->setParentId($this->getMetaId());
91  $key->setParentType('meta_classification');
92 
93  return $key;
94  }
+ Here is the call graph for this function:

◆ addTaxonPath() [1/2]

& ilMDClassification::addTaxonPath ( )

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

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

56  {
57  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
58 
59  $tax = new ilMDTaxonPath($this->getRBACId(),$this->getObjId(),$this->getObjType());
60  $tax->setParentId($this->getMetaId());
61  $tax->setParentType('meta_classification');
62 
63  return $tax;
64  }
+ Here is the call graph for this function:

◆ addTaxonPath() [2/2]

& ilMDClassification::addTaxonPath ( )

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

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

56  {
57  include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
58 
59  $tax = new ilMDTaxonPath($this->getRBACId(),$this->getObjId(),$this->getObjType());
60  $tax->setParentId($this->getMetaId());
61  $tax->setParentType('meta_classification');
62 
63  return $tax;
64  }
+ Here is the call graph for this function:

◆ delete() [1/2]

ilMDClassification::delete ( )

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

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

177  {
178  global $ilDB;
179 
180  if($this->getMetaId())
181  {
182  $query = "DELETE FROM il_meta_classification ".
183  "WHERE meta_classification_id = ".$ilDB->quote($this->getMetaId());
184 
185  $this->db->query($query);
186 
187  foreach($this->getTaxonPathIds() as $id)
188  {
189  $tax =& $this->getTaxonPath($id);
190  $tax->delete();
191  }
192  foreach($this->getKeywordIds() as $id)
193  {
194  $key =& $this->getKeyword($id);
195  $key->delete();
196  }
197 
198  return true;
199  }
200  return false;
201  }
global $ilDB
& getTaxonPath($a_taxon_path_id)
+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDClassification::delete ( )

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

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

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

◆ getDescription() [1/2]

ilMDClassification::getDescription ( )

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

Referenced by __getFields(), and toXML().

126  {
127  return $this->description;
128  }
+ Here is the caller graph for this function:

◆ getDescription() [2/2]

ilMDClassification::getDescription ( )

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

126  {
127  return $this->description;
128  }

◆ getDescriptionLanguage() [1/2]

& ilMDClassification::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguage() [2/2]

& ilMDClassification::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguageCode() [1/2]

ilMDClassification::getDescriptionLanguageCode ( )

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

141  {
142  return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
143  }

◆ getDescriptionLanguageCode() [2/2]

ilMDClassification::getDescriptionLanguageCode ( )

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

Referenced by __getFields(), and toXML().

141  {
142  return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
143  }
+ Here is the caller graph for this function:

◆ getKeyword() [1/2]

& ilMDClassification::getKeyword (   $a_keyword_id)

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

Referenced by delete(), and toXML().

73  {
74  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
75 
76  if(!$a_keyword_id)
77  {
78  return false;
79  }
80  $key = new ilMDKeyword();
81  $key->setMetaId($a_keyword_id);
82 
83  return $key;
84  }
+ Here is the caller graph for this function:

◆ getKeyword() [2/2]

& ilMDClassification::getKeyword (   $a_keyword_id)

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

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

◆ getKeywordIds() [1/2]

& ilMDClassification::getKeywordIds ( )

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

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

Referenced by delete(), and toXML().

67  {
68  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
69 
70  return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_classification');
71  }
static _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:

◆ getKeywordIds() [2/2]

& ilMDClassification::getKeywordIds ( )

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

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

67  {
68  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
69 
70  return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_classification');
71  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getPurpose() [1/2]

ilMDClassification::getPurpose ( )

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

Referenced by __getFields(), and toXML().

118  {
119  return $this->purpose;
120  }
+ Here is the caller graph for this function:

◆ getPurpose() [2/2]

ilMDClassification::getPurpose ( )

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

118  {
119  return $this->purpose;
120  }

◆ getTaxonPath() [1/2]

& ilMDClassification::getTaxonPath (   $a_taxon_path_id)

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

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

◆ getTaxonPath() [2/2]

& ilMDClassification::getTaxonPath (   $a_taxon_path_id)

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

Referenced by delete(), and toXML().

43  {
44  include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
45 
46  if(!$a_taxon_path_id)
47  {
48  return false;
49  }
50  $tax = new ilMDTaxonPath();
51  $tax->setMetaId($a_taxon_path_id);
52 
53  return $tax;
54  }
+ Here is the caller graph for this function:

◆ getTaxonPathIds() [1/2]

& ilMDClassification::getTaxonPathIds ( )

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

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

Referenced by delete(), and toXML().

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

◆ getTaxonPathIds() [2/2]

& ilMDClassification::getTaxonPathIds ( )

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

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

37  {
38  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
39 
40  return ilMDTaxonPath::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_classification');
41  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ read() [1/2]

ilMDClassification::read ( )

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

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

215  {
216  global $ilDB;
217 
218  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
219 
220  if($this->getMetaId())
221  {
222  $query = "SELECT * FROM il_meta_classification ".
223  "WHERE meta_classification_id = ".$ilDB->quote($this->getMetaId());
224 
225  $res = $this->db->query($query);
226  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
227  {
228  $this->setRBACId($row->rbac_id);
229  $this->setObjId($row->obj_id);
230  $this->setObjType($row->obj_type);
231  $this->setPurpose(ilUtil::stripSlashes($row->purpose));
232  $this->setDescription(ilUtil::stripSlashes($row->description));
233  $this->description_language = new ilMDLanguageItem($row->description_language);
234  }
235  }
236  return true;
237  }
setObjType($a_type)
setObjId($a_id)
setRBACId($a_id)
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:

◆ read() [2/2]

ilMDClassification::read ( )

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

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

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

◆ save() [1/2]

ilMDClassification::save ( )

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

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

147  {
148  global $ilDB;
149 
150  $fields = $this->__getFields();
151  $fields['meta_classification_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_classification'));
152 
153  if($this->db->insert('il_meta_classification',$fields))
154  {
155  $this->setMetaId($next_id);
156  return $this->getMetaId();
157  }
158  return false;
159  }
setMetaId($a_meta_id, $a_read_data=true)
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ save() [2/2]

ilMDClassification::save ( )

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

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

147  {
148  if($this->db->autoExecute('il_meta_classification',
149  $this->__getFields(),
151  {
152  $this->setMetaId($this->db->getLastInsertId());
153 
154  return $this->getMetaId();
155  }
156  return false;
157  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setDescription() [1/2]

ilMDClassification::setDescription (   $a_description)

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

122  {
123  $this->description = $a_description;
124  }

◆ setDescription() [2/2]

ilMDClassification::setDescription (   $a_description)

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

Referenced by read().

122  {
123  $this->description = $a_description;
124  }
+ Here is the caller graph for this function:

◆ setDescriptionLanguage() [1/2]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

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

130  {
131  if(is_object($lng_obj))
132  {
133  $this->description_language = $lng_obj;
134  }
135  }

◆ setDescriptionLanguage() [2/2]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

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

130  {
131  if(is_object($lng_obj))
132  {
133  $this->description_language =& $lng_obj;
134  }
135  }

◆ setPurpose() [1/2]

ilMDClassification::setPurpose (   $a_purpose)

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

Referenced by read().

98  {
99  switch($a_purpose)
100  {
101  case 'Discipline':
102  case 'Idea':
103  case 'Prerequisite':
104  case 'EducationalObjective':
105  case 'AccessibilityRestrictions':
106  case 'EducationalLevel':
107  case 'SkillLevel':
108  case 'SecurityLevel':
109  case 'Competency':
110  $this->purpose = $a_purpose;
111  return true;
112 
113  default:
114  return false;
115  }
116  }
+ Here is the caller graph for this function:

◆ setPurpose() [2/2]

ilMDClassification::setPurpose (   $a_purpose)

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

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

◆ toXML() [1/2]

ilMDClassification::toXML ( $writer)

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

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

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

◆ toXML() [2/2]

ilMDClassification::toXML ( $writer)

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

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

245  {
246  $writer->xmlStartTag('Classification',array('Purpose' => $this->getPurpose()));
247 
248  // Taxon Path
249  foreach($this->getTaxonPathIds() as $id)
250  {
251  $tax =& $this->getTaxonPath($id);
252  $tax->toXML($writer);
253  }
254  // Description
255  $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()),$this->getDescription());
256 
257  // Keyword
258  foreach($this->getKeywordIds() as $id)
259  {
260  $key =& $this->getKeyword($id);
261  $key->toXML($writer);
262  }
263  $writer->xmlEndTag('Classification');
264  }
Create styles array
The data for the language used.
& getTaxonPath($a_taxon_path_id)
+ Here is the call graph for this function:

◆ update() [1/2]

ilMDClassification::update ( )

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

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

160  {
161  global $ilDB;
162 
163  if($this->getMetaId())
164  {
165  if($this->db->autoExecute('il_meta_classification',
166  $this->__getFields(),
168  "meta_classification_id = ".$ilDB->quote($this->getMetaId())))
169  {
170  return true;
171  }
172  }
173  return false;
174  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/2]

ilMDClassification::update ( )

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

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

162  {
163  global $ilDB;
164 
165  if($this->getMetaId())
166  {
167  if($this->db->update('il_meta_classification',
168  $this->__getFields(),
169  array("meta_classification_id" => array('integer',$this->getMetaId()))))
170  {
171  return true;
172  }
173  }
174  return false;
175  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

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