ILIAS  release_4-4 Revision
ilMDClassification Class Reference
+ Inheritance diagram for ilMDClassification:
+ Collaboration diagram for ilMDClassification:

Public Member Functions

 ilMDClassification ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
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)
 
 ilMDClassification ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
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
 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 33 of file class.ilMDClassification.php.

Member Function Documentation

◆ __getFields() [1/2]

ilMDClassification::__getFields ( )

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

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

Referenced by save().

212  {
213  return array('rbac_id' => array('integer',$this->getRBACId()),
214  'obj_id' => array('integer',$this->getObjId()),
215  'obj_type' => array('text',$this->getObjType()),
216  'purpose' => array('text',$this->getPurpose()),
217  'description' => array('text',$this->getDescription()),
218  'description_language' => array('text',$this->getDescriptionLanguageCode()));
219  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDClassification::__getFields ( )

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

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

212  {
213  return array('rbac_id' => $this->getRBACId(),
214  'obj_id' => $this->getObjId(),
215  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
216  'purpose' => ilUtil::prepareDBString($this->getPurpose()),
217  'description' => ilUtil::prepareDBString($this->getDescription()),
218  'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
219  }
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 276 of file class.ilMDClassification.php.

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

277  {
278  global $ilDB;
279 
280  $query = "SELECT meta_classification_id FROM il_meta_classification ".
281  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
282  "AND obj_id = ".$ilDB->quote($a_obj_id);
283 
284 
285  $res = $ilDB->query($query);
286  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
287  {
288  $ids[] = $row->meta_classification_id;
289  }
290  return $ids ? $ids : array();
291  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

◆ _getIds() [2/2]

ilMDClassification::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

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

Referenced by ilMD\getClassificationIds().

297  {
298  global $ilDB;
299 
300  $query = "SELECT meta_classification_id FROM il_meta_classification ".
301  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
302  "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
303 
304 
305  $res = $ilDB->query($query);
306  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
307  {
308  $ids[] = $row->meta_classification_id;
309  }
310  return $ids ? $ids : array();
311  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ addKeyword() [1/2]

& ilMDClassification::addKeyword ( )

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

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

93  {
94  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
95 
96  $key =& new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
97  $key->setParentId($this->getMetaId());
98  $key->setParentType('meta_classification');
99 
100  return $key;
101  }
+ Here is the call graph for this function:

◆ addKeyword() [2/2]

& ilMDClassification::addKeyword ( )

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

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

93  {
94  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
95 
96  $key =& new ilMDKeyword($this->getRBACId(),$this->getObjId(),$this->getObjType());
97  $key->setParentId($this->getMetaId());
98  $key->setParentType('meta_classification');
99 
100  return $key;
101  }
+ Here is the call graph for this function:

◆ addTaxonPath() [1/2]

& ilMDClassification::addTaxonPath ( )

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

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

63  {
64  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
65 
66  $tax =& new ilMDTaxonPath($this->getRBACId(),$this->getObjId(),$this->getObjType());
67  $tax->setParentId($this->getMetaId());
68  $tax->setParentType('meta_classification');
69 
70  return $tax;
71  }
+ Here is the call graph for this function:

◆ addTaxonPath() [2/2]

& ilMDClassification::addTaxonPath ( )

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

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

63  {
64  include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
65 
66  $tax =& new ilMDTaxonPath($this->getRBACId(),$this->getObjId(),$this->getObjType());
67  $tax->setParentId($this->getMetaId());
68  $tax->setParentType('meta_classification');
69 
70  return $tax;
71  }
+ Here is the call graph for this function:

◆ delete() [1/2]

ilMDClassification::delete ( )

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

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

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

◆ delete() [2/2]

ilMDClassification::delete ( )

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

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

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

◆ getDescription() [1/2]

ilMDClassification::getDescription ( )

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

133  {
134  return $this->description;
135  }

◆ getDescription() [2/2]

ilMDClassification::getDescription ( )

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

Referenced by __getFields(), and toXML().

133  {
134  return $this->description;
135  }
+ Here is the caller graph for this function:

◆ getDescriptionLanguage() [1/2]

& ilMDClassification::getDescriptionLanguage ( )

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

144  {
145  return is_object($this->description_language) ? $this->description_language : false;
146  }

◆ getDescriptionLanguage() [2/2]

& ilMDClassification::getDescriptionLanguage ( )

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

144  {
145  return is_object($this->description_language) ? $this->description_language : false;
146  }

◆ getDescriptionLanguageCode() [1/2]

ilMDClassification::getDescriptionLanguageCode ( )

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

148  {
149  return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
150  }

◆ getDescriptionLanguageCode() [2/2]

ilMDClassification::getDescriptionLanguageCode ( )

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

Referenced by __getFields(), and toXML().

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

◆ getKeyword() [1/2]

& ilMDClassification::getKeyword (   $a_keyword_id)

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

80  {
81  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
82 
83  if(!$a_keyword_id)
84  {
85  return false;
86  }
87  $key =& new ilMDKeyword();
88  $key->setMetaId($a_keyword_id);
89 
90  return $key;
91  }

◆ getKeyword() [2/2]

& ilMDClassification::getKeyword (   $a_keyword_id)

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

Referenced by delete(), and toXML().

80  {
81  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
82 
83  if(!$a_keyword_id)
84  {
85  return false;
86  }
87  $key =& new ilMDKeyword();
88  $key->setMetaId($a_keyword_id);
89 
90  return $key;
91  }
+ Here is the caller graph for this function:

◆ getKeywordIds() [1/2]

& ilMDClassification::getKeywordIds ( )

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

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

Referenced by delete(), and toXML().

74  {
75  include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
76 
77  return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_classification');
78  }
_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 73 of file class.ilMDClassification.php.

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

74  {
75  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDKeyword.php';
76 
77  return ilMDKeyword::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_classification');
78  }
_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 124 of file class.ilMDClassification.php.

Referenced by __getFields(), and toXML().

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

◆ getPurpose() [2/2]

ilMDClassification::getPurpose ( )

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

125  {
126  return $this->purpose;
127  }

◆ getTaxonPath() [1/2]

& ilMDClassification::getTaxonPath (   $a_taxon_path_id)

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

Referenced by delete(), and toXML().

50  {
51  include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
52 
53  if(!$a_taxon_path_id)
54  {
55  return false;
56  }
57  $tax =& new ilMDTaxonPath();
58  $tax->setMetaId($a_taxon_path_id);
59 
60  return $tax;
61  }
+ Here is the caller graph for this function:

◆ getTaxonPath() [2/2]

& ilMDClassification::getTaxonPath (   $a_taxon_path_id)

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

50  {
51  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
52 
53  if(!$a_taxon_path_id)
54  {
55  return false;
56  }
57  $tax =& new ilMDTaxonPath();
58  $tax->setMetaId($a_taxon_path_id);
59 
60  return $tax;
61  }

◆ getTaxonPathIds() [1/2]

& ilMDClassification::getTaxonPathIds ( )

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

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

44  {
45  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php';
46 
47  return ilMDTaxonPath::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_classification');
48  }
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getTaxonPathIds() [2/2]

& ilMDClassification::getTaxonPathIds ( )

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

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

Referenced by delete(), and toXML().

44  {
45  include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php';
46 
47  return ilMDTaxonPath::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_classification');
48  }
_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:

◆ ilMDClassification() [1/2]

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

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

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

◆ ilMDClassification() [2/2]

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

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

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

◆ read() [1/2]

ilMDClassification::read ( )

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

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

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

◆ read() [2/2]

ilMDClassification::read ( )

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

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

222  {
223  global $ilDB;
224 
225  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
226 
227  if($this->getMetaId())
228  {
229  $query = "SELECT * FROM il_meta_classification ".
230  "WHERE meta_classification_id = ".$ilDB->quote($this->getMetaId());
231 
232  $res = $this->db->query($query);
233  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
234  {
235  $this->setRBACId($row->rbac_id);
236  $this->setObjId($row->obj_id);
237  $this->setObjType($row->obj_type);
238  $this->setPurpose(ilUtil::stripSlashes($row->purpose));
239  $this->setDescription(ilUtil::stripSlashes($row->description));
240  $this->description_language = new ilMDLanguageItem($row->description_language);
241  }
242  }
243  return true;
244  }
setObjType($a_type)
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setObjId($a_id)
setRBACId($a_id)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ save() [1/2]

ilMDClassification::save ( )

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

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

154  {
155  global $ilDB;
156 
157  $fields = $this->__getFields();
158  $fields['meta_classification_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_classification'));
159 
160  if($this->db->insert('il_meta_classification',$fields))
161  {
162  $this->setMetaId($next_id);
163  return $this->getMetaId();
164  }
165  return false;
166  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/2]

ilMDClassification::save ( )

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

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

154  {
155  if($this->db->autoExecute('il_meta_classification',
156  $this->__getFields(),
157  DB_AUTOQUERY_INSERT))
158  {
159  $this->setMetaId($this->db->getLastInsertId());
160 
161  return $this->getMetaId();
162  }
163  return false;
164  }
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 128 of file class.ilMDClassification.php.

129  {
130  $this->description = $a_description;
131  }

◆ setDescription() [2/2]

ilMDClassification::setDescription (   $a_description)

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

Referenced by read().

129  {
130  $this->description = $a_description;
131  }
+ Here is the caller graph for this function:

◆ setDescriptionLanguage() [1/2]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

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

137  {
138  if(is_object($lng_obj))
139  {
140  $this->description_language =& $lng_obj;
141  }
142  }

◆ setDescriptionLanguage() [2/2]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

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

137  {
138  if(is_object($lng_obj))
139  {
140  $this->description_language = $lng_obj;
141  }
142  }

◆ setPurpose() [1/2]

ilMDClassification::setPurpose (   $a_purpose)

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

Referenced by read().

105  {
106  switch($a_purpose)
107  {
108  case 'Discipline':
109  case 'Idea':
110  case 'Prerequisite':
111  case 'EducationalObjective':
112  case 'AccessibilityRestrictions':
113  case 'EducationalLevel':
114  case 'SkillLevel':
115  case 'SecurityLevel':
116  case 'Competency':
117  $this->purpose = $a_purpose;
118  return true;
119 
120  default:
121  return false;
122  }
123  }
+ Here is the caller graph for this function:

◆ setPurpose() [2/2]

ilMDClassification::setPurpose (   $a_purpose)

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

105  {
106  switch($a_purpose)
107  {
108  case 'Discipline':
109  case 'Idea':
110  case 'Prerequisite':
111  case 'EducationalObjective':
112  case 'AccessibilityRestrictions':
113  case 'EducationalLevel':
114  case 'SkillLevel':
115  case 'SecurityLevel':
116  case 'Competency':
117  $this->purpose = $a_purpose;
118  return true;
119 
120  default:
121  return false;
122  }
123  }

◆ toXML() [1/2]

ilMDClassification::toXML ( $writer)

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

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

252  {
253  $writer->xmlStartTag('Classification',array('Purpose' => $this->getPurpose()));
254 
255  // Taxon Path
256  foreach($this->getTaxonPathIds() as $id)
257  {
258  $tax =& $this->getTaxonPath($id);
259  $tax->toXML($writer);
260  }
261  // Description
262  $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()),$this->getDescription());
263 
264  // Keyword
265  foreach($this->getKeywordIds() as $id)
266  {
267  $key =& $this->getKeyword($id);
268  $key->toXML($writer);
269  }
270  $writer->xmlEndTag('Classification');
271  }
& getTaxonPath($a_taxon_path_id)
+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDClassification::toXML ( $writer)

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

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

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

◆ update() [1/2]

ilMDClassification::update ( )

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

References ilMDBase\getMetaId().

167  {
168  global $ilDB;
169 
170  if($this->getMetaId())
171  {
172  if($this->db->autoExecute('il_meta_classification',
173  $this->__getFields(),
174  DB_AUTOQUERY_UPDATE,
175  "meta_classification_id = ".$ilDB->quote($this->getMetaId())))
176  {
177  return true;
178  }
179  }
180  return false;
181  }
+ Here is the call graph for this function:

◆ update() [2/2]

ilMDClassification::update ( )

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

References ilMDBase\getMetaId().

169  {
170  global $ilDB;
171 
172  if($this->getMetaId())
173  {
174  if($this->db->update('il_meta_classification',
175  $this->__getFields(),
176  array("meta_classification_id" => array('integer',$this->getMetaId()))))
177  {
178  return true;
179  }
180  }
181  return false;
182  }
+ Here is the call graph for this function:

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