ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 
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)
 
- 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)
 
 __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)
 

Static Public Member Functions

static _getIds ($a_rbac_id, $a_obj_id)
 
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/3]

ilMDClassification::__getFields ( )

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

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

199  {
200  return array('rbac_id' => $this->getRBACId(),
201  'obj_id' => $this->getObjId(),
202  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
203  'purpose' => ilUtil::prepareDBString($this->getPurpose()),
204  'description' => ilUtil::prepareDBString($this->getDescription()),
205  'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
206  }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ __getFields() [2/3]

ilMDClassification::__getFields ( )

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

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

Referenced by save().

203  {
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()),
208  'description' => array('text',$this->getDescription()),
209  'description_language' => array('text',$this->getDescriptionLanguageCode()));
210  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [3/3]

ilMDClassification::__getFields ( )

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

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

203  {
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()),
208  'description' => array('text',$this->getDescription()),
209  'description_language' => array('text',$this->getDescriptionLanguageCode()));
210  }
+ Here is the call graph for this function:

◆ _getIds() [1/3]

ilMDClassification::_getIds (   $a_rbac_id,
  $a_obj_id 
)

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

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

260  {
261  global $ilDB;
262 
263  $query = "SELECT meta_classification_id FROM il_meta_classification " .
264  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
265  "AND obj_id = " . $ilDB->quote($a_obj_id);
266 
267 
268  $res = $ilDB->query($query);
269  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
270  $ids[] = $row->meta_classification_id;
271  }
272  return $ids ? $ids : array();
273  }
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getIds() [2/3]

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

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

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

Referenced by ilMD\getClassificationIds().

287  {
288  global $DIC;
289 
290  $ilDB = $DIC['ilDB'];
291 
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');
295 
296 
297  $res = $ilDB->query($query);
298  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
299  $ids[] = $row->meta_classification_id;
300  }
301  return $ids ? $ids : array();
302  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _getIds() [3/3]

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

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

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

287  {
288  global $DIC;
289 
290  $ilDB = $DIC['ilDB'];
291 
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');
295 
296 
297  $res = $ilDB->query($query);
298  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
299  $ids[] = $row->meta_classification_id;
300  }
301  return $ids ? $ids : array();
302  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ addKeyword() [1/3]

& ilMDClassification::addKeyword ( )

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

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

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

◆ addKeyword() [2/3]

& ilMDClassification::addKeyword ( )

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

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

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

◆ addKeyword() [3/3]

& ilMDClassification::addKeyword ( )

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

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

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

◆ addTaxonPath() [1/3]

& ilMDClassification::addTaxonPath ( )

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

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

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

◆ addTaxonPath() [2/3]

& ilMDClassification::addTaxonPath ( )

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

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

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

◆ addTaxonPath() [3/3]

& ilMDClassification::addTaxonPath ( )

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

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

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

◆ delete() [1/3]

ilMDClassification::delete ( )

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

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

174  {
175  global $ilDB;
176 
177  if ($this->getMetaId()) {
178  $query = "DELETE FROM il_meta_classification " .
179  "WHERE meta_classification_id = " . $ilDB->quote($this->getMetaId());
180 
181  $this->db->query($query);
182 
183  foreach ($this->getTaxonPathIds() as $id) {
184  $tax = &$this->getTaxonPath($id);
185  $tax->delete();
186  }
187  foreach ($this->getKeywordIds() as $id) {
188  $key = &$this->getKeyword($id);
189  $key->delete();
190  }
191 
192  return true;
193  }
194  return false;
195  }
if(!array_key_exists('StateId', $_REQUEST)) $id
$query
global $ilDB
$key
Definition: croninfo.php:18
& getTaxonPath($a_taxon_path_id)
+ Here is the call graph for this function:

◆ delete() [2/3]

ilMDClassification::delete ( )

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

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

177  {
178  global $DIC;
179 
180  $ilDB = $DIC['ilDB'];
181 
182  if ($this->getMetaId()) {
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  $tax = $this->getTaxonPath($id);
189  $tax->delete();
190  }
191  foreach ($this->getKeywordIds() as $id) {
192  $key = $this->getKeyword($id);
193  $key->delete();
194  }
195 
196  return true;
197  }
198  return false;
199  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$key
Definition: croninfo.php:18
& getTaxonPath($a_taxon_path_id)
+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDClassification::delete ( )

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

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

177  {
178  global $DIC;
179 
180  $ilDB = $DIC['ilDB'];
181 
182  if ($this->getMetaId()) {
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  $tax = $this->getTaxonPath($id);
189  $tax->delete();
190  }
191  foreach ($this->getKeywordIds() as $id) {
192  $key = $this->getKeyword($id);
193  $key->delete();
194  }
195 
196  return true;
197  }
198  return false;
199  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$key
Definition: croninfo.php:18
& getTaxonPath($a_taxon_path_id)
+ Here is the call graph for this function:

◆ getDescription() [1/3]

ilMDClassification::getDescription ( )

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

References $description.

Referenced by __getFields(), and toXML().

123  {
124  return $this->description;
125  }
+ Here is the caller graph for this function:

◆ getDescription() [2/3]

ilMDClassification::getDescription ( )

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

References $description.

123  {
124  return $this->description;
125  }

◆ getDescription() [3/3]

ilMDClassification::getDescription ( )

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

References $description.

123  {
124  return $this->description;
125  }

◆ getDescriptionLanguage() [1/3]

& ilMDClassification::getDescriptionLanguage ( )

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

133  {
134  return is_object($this->description_language) ? $this->description_language : false;
135  }

◆ getDescriptionLanguage() [2/3]

& ilMDClassification::getDescriptionLanguage ( )

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

133  {
134  return is_object($this->description_language) ? $this->description_language : false;
135  }

◆ getDescriptionLanguage() [3/3]

& ilMDClassification::getDescriptionLanguage ( )

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

133  {
134  return is_object($this->description_language) ? $this->description_language : false;
135  }

◆ getDescriptionLanguageCode() [1/3]

ilMDClassification::getDescriptionLanguageCode ( )

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

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

◆ getDescriptionLanguageCode() [2/3]

ilMDClassification::getDescriptionLanguageCode ( )

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

Referenced by __getFields(), and toXML().

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

◆ getDescriptionLanguageCode() [3/3]

ilMDClassification::getDescriptionLanguageCode ( )

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

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

◆ getKeyword() [1/3]

& ilMDClassification::getKeyword (   $a_keyword_id)

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

References $key.

Referenced by delete(), and toXML().

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

◆ getKeyword() [2/3]

& ilMDClassification::getKeyword (   $a_keyword_id)

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

References $key.

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

◆ getKeyword() [3/3]

& ilMDClassification::getKeyword (   $a_keyword_id)

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

References $key.

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

◆ getKeywordIds() [1/3]

& ilMDClassification::getKeywordIds ( )

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

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

Referenced by delete(), and toXML().

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

& ilMDClassification::getKeywordIds ( )

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

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

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

◆ getKeywordIds() [3/3]

& ilMDClassification::getKeywordIds ( )

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

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

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

◆ getPurpose() [1/3]

ilMDClassification::getPurpose ( )

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

Referenced by __getFields(), and toXML().

115  {
116  return $this->purpose;
117  }
+ Here is the caller graph for this function:

◆ getPurpose() [2/3]

ilMDClassification::getPurpose ( )

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

115  {
116  return $this->purpose;
117  }

◆ getPurpose() [3/3]

ilMDClassification::getPurpose ( )

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

115  {
116  return $this->purpose;
117  }

◆ getTaxonPath() [1/3]

& 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  return false;
48  }
49  $tax = new ilMDTaxonPath();
50  $tax->setMetaId($a_taxon_path_id);
51 
52  return $tax;
53  }
+ Here is the caller graph for this function:

◆ getTaxonPath() [2/3]

& ilMDClassification::getTaxonPath (   $a_taxon_path_id)

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

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

◆ getTaxonPath() [3/3]

& 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  return false;
48  }
49  $tax = new ilMDTaxonPath();
50  $tax->setMetaId($a_taxon_path_id);
51 
52  return $tax;
53  }

◆ getTaxonPathIds() [1/3]

& 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/3]

& 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_5295/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:

◆ getTaxonPathIds() [3/3]

& 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/3]

ilMDClassification::read ( )

Definition at line 208 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().

209  {
210  global $ilDB;
211 
212  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
213 
214  if ($this->getMetaId()) {
215  $query = "SELECT * FROM il_meta_classification " .
216  "WHERE meta_classification_id = " . $ilDB->quote($this->getMetaId());
217 
218  $res = $this->db->query($query);
219  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
220  $this->setRBACId($row->rbac_id);
221  $this->setObjId($row->obj_id);
222  $this->setObjType($row->obj_type);
223  $this->setPurpose(ilUtil::stripSlashes($row->purpose));
224  $this->setDescription(ilUtil::stripSlashes($row->description));
225  $this->description_language = new ilMDLanguageItem($row->description_language);
226  }
227  }
228  return true;
229  }
setObjType($a_type)
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$row
global $ilDB
+ Here is the call graph for this function:

◆ read() [2/3]

ilMDClassification::read ( )

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

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

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

◆ read() [3/3]

ilMDClassification::read ( )

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

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

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

◆ save() [1/3]

ilMDClassification::save ( )

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

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

143  {
144  global $DIC;
145 
146  $ilDB = $DIC['ilDB'];
147 
148  $fields = $this->__getFields();
149  $fields['meta_classification_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_classification'));
150 
151  if ($this->db->insert('il_meta_classification', $fields)) {
152  $this->setMetaId($next_id);
153  return $this->getMetaId();
154  }
155  return false;
156  }
global $DIC
Definition: saml.php:7
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ save() [2/3]

ilMDClassification::save ( )

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

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

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

◆ save() [3/3]

ilMDClassification::save ( )

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

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

143  {
144  global $DIC;
145 
146  $ilDB = $DIC['ilDB'];
147 
148  $fields = $this->__getFields();
149  $fields['meta_classification_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_classification'));
150 
151  if ($this->db->insert('il_meta_classification', $fields)) {
152  $this->setMetaId($next_id);
153  return $this->getMetaId();
154  }
155  return false;
156  }
global $DIC
Definition: saml.php:7
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ setDescription() [1/3]

ilMDClassification::setDescription (   $a_description)

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

119  {
120  $this->description = $a_description;
121  }

◆ setDescription() [2/3]

ilMDClassification::setDescription (   $a_description)

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

119  {
120  $this->description = $a_description;
121  }

◆ setDescription() [3/3]

ilMDClassification::setDescription (   $a_description)

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

Referenced by read().

119  {
120  $this->description = $a_description;
121  }
+ Here is the caller graph for this function:

◆ setDescriptionLanguage() [1/3]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

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

127  {
128  if (is_object($lng_obj)) {
129  $this->description_language = $lng_obj;
130  }
131  }

◆ setDescriptionLanguage() [2/3]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

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

127  {
128  if (is_object($lng_obj)) {
129  $this->description_language = $lng_obj;
130  }
131  }

◆ setDescriptionLanguage() [3/3]

ilMDClassification::setDescriptionLanguage ( $lng_obj)

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

127  {
128  if (is_object($lng_obj)) {
129  $this->description_language = &$lng_obj;
130  }
131  }

◆ setPurpose() [1/3]

ilMDClassification::setPurpose (   $a_purpose)

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

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

◆ setPurpose() [2/3]

ilMDClassification::setPurpose (   $a_purpose)

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

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

◆ setPurpose() [3/3]

ilMDClassification::setPurpose (   $a_purpose)

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

Referenced by read().

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

◆ toXML() [1/3]

ilMDClassification::toXML ( $writer)

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

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

237  {
238  $writer->xmlStartTag('Classification', array('Purpose' => $this->getPurpose()));
239 
240  // Taxon Path
241  foreach ($this->getTaxonPathIds() as $id) {
242  $tax = &$this->getTaxonPath($id);
243  $tax->toXML($writer);
244  }
245  // Description
246  $writer->xmlElement('Description', array('Language' => $this->getDescriptionLanguageCode()), $this->getDescription());
247 
248  // Keyword
249  foreach ($this->getKeywordIds() as $id) {
250  $key = &$this->getKeyword($id);
251  $key->toXML($writer);
252  }
253  $writer->xmlEndTag('Classification');
254  }
if(!array_key_exists('StateId', $_REQUEST)) $id
$key
Definition: croninfo.php:18
& getTaxonPath($a_taxon_path_id)
+ Here is the call graph for this function:

◆ toXML() [2/3]

ilMDClassification::toXML ( $writer)

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

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

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

◆ toXML() [3/3]

ilMDClassification::toXML ( $writer)

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

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

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

◆ update() [1/3]

ilMDClassification::update ( )

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

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

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

◆ update() [2/3]

ilMDClassification::update ( )

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

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

159  {
160  global $DIC;
161 
162  $ilDB = $DIC['ilDB'];
163 
164  if ($this->getMetaId()) {
165  if ($this->db->update(
166  'il_meta_classification',
167  $this->__getFields(),
168  array("meta_classification_id" => array('integer',$this->getMetaId()))
169  )) {
170  return true;
171  }
172  }
173  return false;
174  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ update() [3/3]

ilMDClassification::update ( )

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

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

159  {
160  global $DIC;
161 
162  $ilDB = $DIC['ilDB'];
163 
164  if ($this->getMetaId()) {
165  if ($this->db->update(
166  'il_meta_classification',
167  $this->__getFields(),
168  array("meta_classification_id" => array('integer',$this->getMetaId()))
169  )) {
170  return true;
171  }
172  }
173  return false;
174  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

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