31 include_once
'class.ilMDBase.php';
38 include_once
'Services/MetaData/classes/class.ilMDTaxonPath.php';
44 include_once
'Services/MetaData/classes/class.ilMDTaxonPath.php';
46 if (!$a_taxon_path_id) {
50 $tax->setMetaId($a_taxon_path_id);
56 include_once
'Services/MetaData/classes/class.ilMDTaxonPath.php';
60 $tax->setParentType(
'meta_classification');
67 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
73 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
79 $key->setMetaId($a_keyword_id);
85 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
89 $key->setParentType(
'meta_classification');
101 case 'EducationalObjective':
102 case 'AccessibilityRestrictions':
103 case 'EducationalLevel':
105 case 'SecurityLevel':
107 $this->purpose = $a_purpose;
116 return $this->purpose;
120 $this->description = $a_description;
128 if (is_object($lng_obj)) {
129 $this->description_language = $lng_obj;
134 return is_object($this->description_language) ? $this->description_language :
false;
138 return is_object($this->description_language) ? $this->description_language->getLanguageCode() :
false;
146 $ilDB = $DIC[
'ilDB'];
149 $fields[
'meta_classification_id'] = array(
'integer',$next_id =
$ilDB->nextId(
'il_meta_classification'));
151 if ($this->db->insert(
'il_meta_classification', $fields)) {
162 $ilDB = $DIC[
'ilDB'];
165 if ($this->db->update(
166 'il_meta_classification',
167 $this->__getFields(),
168 array(
"meta_classification_id" => array(
'integer',$this->
getMetaId()))
176 public function delete()
180 $ilDB = $DIC[
'ilDB'];
183 $query =
"DELETE FROM il_meta_classification " .
184 "WHERE meta_classification_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
204 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
205 'obj_id' => array(
'integer',$this->
getObjId()),
206 'obj_type' => array(
'text',$this->
getObjType()),
207 'purpose' => array(
'text',$this->
getPurpose()),
216 $ilDB = $DIC[
'ilDB'];
218 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
221 $query =
"SELECT * FROM il_meta_classification " .
222 "WHERE meta_classification_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
244 $writer->xmlStartTag(
'Classification', array(
'Purpose' => $this->
getPurpose()
250 foreach ($taxs as
$id) {
252 $tax->toXML($writer);
255 include_once
'Services/MetaData/classes/class.ilMDTaxonPath.php';
257 $tax->toXML($writer);
271 foreach (
$keys as $id) {
273 $key->toXML($writer);
276 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
278 $key->toXML($writer);
280 $writer->xmlEndTag(
'Classification');
286 public static function _getIds($a_rbac_id, $a_obj_id)
290 $ilDB = $DIC[
'ilDB'];
292 $query =
"SELECT meta_classification_id FROM il_meta_classification " .
293 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
294 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
299 $ids[] =
$row->meta_classification_id;
301 return $ids ? $ids : array();
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
if(!array_key_exists('StateId', $_REQUEST)) $id
static _getIds($a_rbac_id, $a_obj_id)
setDescriptionLanguage(&$lng_obj)
& getDescriptionLanguage()
getDescriptionLanguageCode()
setMetaId($a_meta_id, $a_read_data=true)
foreach($_POST as $key=> $value) $res
setDescription($a_description)
& getKeyword($a_keyword_id)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
& getTaxonPath($a_taxon_path_id)