ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilMD Class Reference
+ Inheritance diagram for ilMD:
+ Collaboration diagram for ilMD:

Public Member Functions

 read ()
 
 getGeneral ()
 
 addGeneral ()
 
 getLifecycle ()
 
 addLifecycle ()
 
 getMetaMetadata ()
 
 addMetaMetadata ()
 
 getTechnical ()
 
 addTechnical ()
 
 getEducational ()
 
 addEducational ()
 
 getRights ()
 
 addRights ()
 
 getRelationIds ()
 
 getRelation (int $a_relation_id)
 
 addRelation ()
 
 getAnnotationIds ()
 
 getAnnotation (int $a_annotation_id)
 
 addAnnotation ()
 
 getClassificationIds ()
 
 getClassification (int $a_classification_id)
 
 addClassification ()
 
 toXML (ilXmlWriter $writer)
 
 cloneMD (int $a_rbac_id, int $a_obj_id, string $a_obj_type)
 
 deleteAll ()
 
- Public Member Functions inherited from ilMDBase
 __construct (int $a_rbac_id=0, int $a_obj_id=0, string $a_type='')
 constructor More...
 
 read ()
 
 setRBACId (int $a_id)
 
 getRBACId ()
 
 setObjId (int $a_id)
 
 getObjId ()
 
 setObjType (string $a_type)
 
 getObjType ()
 
 setMetaId (int $a_meta_id, bool $a_read_data=true)
 
 getMetaId ()
 
 setParentType (string $a_parent_type)
 
 getParentType ()
 
 setParentId (int $a_id)
 
 getParentId ()
 
 setExportMode (bool $a_export_mode=true)
 
 getExportMode ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (ilXmlWriter $writer)
 

Additional Inherited Members

- Protected Attributes inherited from ilMDBase
ilLogger $log
 
ilDBInterface $db
 

Detailed Description

Definition at line 28 of file class.ilMD.php.

Member Function Documentation

◆ addAnnotation()

ilMD::addAnnotation ( )

Definition at line 189 of file class.ilMD.php.

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

190  {
191  $ann = new ilMDAnnotation($this->getRBACId(), $this->getObjId(), $this->getObjType());
192 
193  return $ann;
194  }
+ Here is the call graph for this function:

◆ addClassification()

ilMD::addClassification ( )

Definition at line 216 of file class.ilMD.php.

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

217  {
218  $cla = new ilMDClassification($this->getRBACId(), $this->getObjId(), $this->getObjType());
219 
220  return $cla;
221  }
+ Here is the call graph for this function:

◆ addEducational()

ilMD::addEducational ( )

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

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

118  {
119  $edu = new ilMDEducational($this->getRBACId(), $this->getObjId(), $this->getObjType());
120 
121  return $edu;
122  }
+ Here is the call graph for this function:

◆ addGeneral()

ilMD::addGeneral ( )

Definition at line 45 of file class.ilMD.php.

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

45  : ?ilMDGeneral
46  {
47  $gen = new ilMDGeneral($this->getRBACId(), $this->getObjId(), $this->getObjType());
48 
49  return $gen;
50  }
+ Here is the call graph for this function:

◆ addLifecycle()

ilMD::addLifecycle ( )

Definition at line 63 of file class.ilMD.php.

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

64  {
65  $lif = new ilMDLifecycle($this->getRBACId(), $this->getObjId(), $this->getObjType());
66 
67  return $lif;
68  }
+ Here is the call graph for this function:

◆ addMetaMetadata()

ilMD::addMetaMetadata ( )

Definition at line 81 of file class.ilMD.php.

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

82  {
83  $met = new ilMDMetaMetadata($this->getRBACId(), $this->getObjId(), $this->getObjType());
84 
85  return $met;
86  }
+ Here is the call graph for this function:

◆ addRelation()

ilMD::addRelation ( )

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

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

162  : ilMDRelation
163  {
164  $rel = new ilMDRelation($this->getRBACId(), $this->getObjId(), $this->getObjType());
165 
166  return $rel;
167  }
+ Here is the call graph for this function:

◆ addRights()

ilMD::addRights ( )

Definition at line 135 of file class.ilMD.php.

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

135  : ilMDRights
136  {
137  $rig = new ilMDRights($this->getRBACId(), $this->getObjId(), $this->getObjType());
138 
139  return $rig;
140  }
+ Here is the call graph for this function:

◆ addTechnical()

ilMD::addTechnical ( )

Definition at line 99 of file class.ilMD.php.

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

100  {
101  $tec = new ilMDTechnical($this->getRBACId(), $this->getObjId(), $this->getObjType());
102 
103  return $tec;
104  }
+ Here is the call graph for this function:

◆ cloneMD()

ilMD::cloneMD ( int  $a_rbac_id,
int  $a_obj_id,
string  $a_obj_type 
)

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

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), and ilMDXMLCopier\startParsing().

289  : ilMD
290  {
291  // this method makes an xml export of the original meta data set
292  // and uses this xml string to clone the object
293  $md2xml = new ilMD2XML($this->getRBACId(), $this->getObjId(), $this->getObjType());
294  $md2xml->startExport();
295 
296  $mdxmlcopier = new ilMDXMLCopier($md2xml->getXML(), $a_rbac_id, $a_obj_id, $a_obj_type);
297  $mdxmlcopier->startParsing();
298 
299  return $mdxmlcopier->getMDObject();
300  }
+ Here is the call graph for this function:

◆ deleteAll()

ilMD::deleteAll ( )

Definition at line 302 of file class.ilMD.php.

References ilMDBase\getObjId(), ilMDBase\getRBACId(), and ilDBConstants\T_INTEGER.

Referenced by ilSoapCourseAdministration\excludeCourseMember(), and ilWebLinkXmlParser\handlerBeginTag().

302  : bool
303  {
304  $tables = [
305  'il_meta_annotation',
306  'il_meta_classification',
307  'il_meta_contribute',
308  'il_meta_description',
309  'il_meta_educational',
310  'il_meta_entity',
311  'il_meta_format',
312  'il_meta_general',
313  'il_meta_identifier',
314  'il_meta_identifier_',
315  'il_meta_keyword',
316  'il_meta_language',
317  'il_meta_lifecycle',
318  'il_meta_location',
319  'il_meta_meta_data',
320  'il_meta_relation',
321  'il_meta_requirement',
322  'il_meta_rights',
323  'il_meta_taxon',
324  'il_meta_taxon_path',
325  'il_meta_technical',
326  'il_meta_tar'
327  ];
328 
329  foreach ($tables as $table) {
330  $query = "DELETE FROM " . $table . " " .
331  "WHERE rbac_id = " . $this->db->quote($this->getRBACId(), ilDBConstants::T_INTEGER) . " " .
332  "AND obj_id = " . $this->db->quote($this->getObjId(), ilDBConstants::T_INTEGER);
333 
334  $this->db->query($query);
335  }
336 
337  return true;
338  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAnnotation()

ilMD::getAnnotation ( int  $a_annotation_id)

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

Referenced by toXML().

177  : ?ilMDAnnotation
178  {
179  if (!$a_annotation_id) {
180  return null;
181  }
182 
183  $ann = new ilMDAnnotation();
184  $ann->setMetaId($a_annotation_id);
185 
186  return $ann;
187  }
+ Here is the caller graph for this function:

◆ getAnnotationIds()

ilMD::getAnnotationIds ( )
Returns
int[]

Definition at line 172 of file class.ilMD.php.

References ilMDAnnotation\_getIds(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

172  : array
173  {
174  return ilMDAnnotation::_getIds($this->getRBACId(), $this->getObjId());
175  }
static _getIds(int $a_rbac_id, int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClassification()

ilMD::getClassification ( int  $a_classification_id)

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

Referenced by toXML().

205  {
206  if (!$a_classification_id) {
207  return null;
208  }
209 
210  $cla = new ilMDClassification();
211  $cla->setMetaId($a_classification_id);
212 
213  return $cla;
214  }
+ Here is the caller graph for this function:

◆ getClassificationIds()

ilMD::getClassificationIds ( )
Returns
int[]

Definition at line 199 of file class.ilMD.php.

References ilMDClassification\_getIds(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

199  : array
200  {
201  return ilMDClassification::_getIds($this->getRBACId(), $this->getObjId());
202  }
static _getIds(int $a_rbac_id, int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEducational()

ilMD::getEducational ( )

Definition at line 106 of file class.ilMD.php.

References $id, ilMDEducational\_getId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

106  : ?ilMDEducational
107  {
108  if ($id = ilMDEducational::_getId($this->getRBACId(), $this->getObjId())) {
109  $edu = new ilMDEducational();
110  $edu->setMetaId($id);
111 
112  return $edu;
113  }
114  return null;
115  }
static _getId(int $a_rbac_id, int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneral()

ilMD::getGeneral ( )

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

References $id, ilMDGeneral\_getId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

35  : ?ilMDGeneral
36  {
37  if ($id = ilMDGeneral::_getId($this->getRBACId(), $this->getObjId())) {
38  $gen = new ilMDGeneral();
39  $gen->setMetaId($id);
40  return $gen;
41  }
42  return null;
43  }
static _getId(int $a_rbac_id, int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLifecycle()

ilMD::getLifecycle ( )

Definition at line 52 of file class.ilMD.php.

References $id, ilMDLifecycle\_getId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

52  : ?ilMDLifecycle
53  {
54  if ($id = ilMDLifecycle::_getId($this->getRBACId(), $this->getObjId())) {
55  $lif = new ilMDLifecycle();
56  $lif->setMetaId($id);
57 
58  return $lif;
59  }
60  return null;
61  }
static _getId(int $a_rbac_id, int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMetaMetadata()

ilMD::getMetaMetadata ( )

Definition at line 70 of file class.ilMD.php.

References $id, ilMDMetaMetadata\_getId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

71  {
72  if ($id = ilMDMetaMetadata::_getId($this->getRBACId(), $this->getObjId())) {
73  $met = new ilMDMetaMetadata();
74  $met->setMetaId($id);
75 
76  return $met;
77  }
78  return null;
79  }
static _getId(int $a_rbac_id, int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRelation()

ilMD::getRelation ( int  $a_relation_id)

Definition at line 150 of file class.ilMD.php.

Referenced by toXML().

150  : ?ilMDRelation
151  {
152  if (!$a_relation_id) {
153  return null;
154  }
155 
156  $rel = new ilMDRelation();
157  $rel->setMetaId($a_relation_id);
158 
159  return $rel;
160  }
+ Here is the caller graph for this function:

◆ getRelationIds()

ilMD::getRelationIds ( )
Returns
int[]

Definition at line 145 of file class.ilMD.php.

References ilMDRelation\_getIds(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

145  : array
146  {
147  return ilMDRelation::_getIds($this->getRBACId(), $this->getObjId());
148  }
static _getIds(int $a_rbac_id, int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRights()

ilMD::getRights ( )

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

References $id, ilMDRights\_getId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

124  : ?ilMDRights
125  {
126  if ($id = ilMDRights::_getId($this->getRBACId(), $this->getObjId())) {
127  $rig = new ilMDRights();
128  $rig->setMetaId($id);
129 
130  return $rig;
131  }
132  return null;
133  }
static _getId(int $a_rbac_id, int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTechnical()

ilMD::getTechnical ( )

Definition at line 88 of file class.ilMD.php.

References $id, ilMDTechnical\_getId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by toXML().

88  : ?ilMDTechnical
89  {
90  if ($id = ilMDTechnical::_getId($this->getRBACId(), $this->getObjId())) {
91  $tec = new ilMDTechnical();
92  $tec->setMetaId($id);
93 
94  return $tec;
95  }
96  return null;
97  }
static _getId(int $a_rbac_id, int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilMD::read ( )

Definition at line 30 of file class.ilMD.php.

30  : bool
31  {
32  return true;
33  }

◆ toXML()

ilMD::toXML ( ilXmlWriter  $writer)

Definition at line 223 of file class.ilMD.php.

References $id, getAnnotation(), getAnnotationIds(), getClassification(), getClassificationIds(), getEducational(), ilMDBase\getExportMode(), getGeneral(), getLifecycle(), getMetaMetadata(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), getRelation(), getRelationIds(), getRights(), getTechnical(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

223  : void
224  {
225  $writer->xmlStartTag('MetaData');
226 
227  // General
228  if (is_object($gen = $this->getGeneral())) {
229  $gen->setExportMode($this->getExportMode());
230  $gen->toXML($writer);
231  } else {
232  // Defaults
233 
234  $gen = new ilMDGeneral(
235  $this->getRBACId(),
236  $this->getObjId(),
237  $this->getObjType()
238  ); // added type, alex, 31 Oct 2007
239  $gen->setExportMode($this->getExportMode());
240  $gen->toXML($writer);
241  }
242 
243  // Lifecycle
244  if (is_object($lif = $this->getLifecycle())) {
245  $lif->toXML($writer);
246  }
247 
248  // Meta-Metadata
249  if (is_object($met = $this->getMetaMetadata())) {
250  $met->toXML($writer);
251  }
252 
253  // Technical
254  if (is_object($tec = $this->getTechnical())) {
255  $tec->toXML($writer);
256  }
257 
258  // Educational
259  if (is_object($edu = $this->getEducational())) {
260  $edu->toXML($writer);
261  }
262 
263  // Rights
264  if (is_object($rig = $this->getRights())) {
265  $rig->toXML($writer);
266  }
267 
268  // Relations
269  foreach ($this->getRelationIds() as $id) {
270  $rel = $this->getRelation($id);
271  $rel->toXML($writer);
272  }
273 
274  // Annotations
275  foreach ($this->getAnnotationIds() as $id) {
276  $ann = $this->getAnnotation($id);
277  $ann->toXML($writer);
278  }
279 
280  // Classification
281  foreach ($this->getClassificationIds() as $id) {
282  $cla = $this->getClassification($id);
283  $cla->toXML($writer);
284  }
285 
286  $writer->xmlEndTag('MetaData');
287  }
getTechnical()
Definition: class.ilMD.php:88
getMetaMetadata()
Definition: class.ilMD.php:70
getAnnotationIds()
Definition: class.ilMD.php:172
getRelationIds()
Definition: class.ilMD.php:145
getAnnotation(int $a_annotation_id)
Definition: class.ilMD.php:177
getLifecycle()
Definition: class.ilMD.php:52
xmlEndTag(string $tag)
Writes an endtag.
getRelation(int $a_relation_id)
Definition: class.ilMD.php:150
getRights()
Definition: class.ilMD.php:124
getClassificationIds()
Definition: class.ilMD.php:199
getEducational()
Definition: class.ilMD.php:106
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
getGeneral()
Definition: class.ilMD.php:35
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
getClassification(int $a_classification_id)
Definition: class.ilMD.php:204
+ Here is the call graph for this function:

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