ILIAS  release_8 Revision v8.24
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 27 of file class.ilMD.php.

Member Function Documentation

◆ addAnnotation()

ilMD::addAnnotation ( )

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

189 {
190 $ann = new ilMDAnnotation($this->getRBACId(), $this->getObjId(), $this->getObjType());
191
192 return $ann;
193 }

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

+ Here is the call graph for this function:

◆ addClassification()

ilMD::addClassification ( )

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

216 {
217 $cla = new ilMDClassification($this->getRBACId(), $this->getObjId(), $this->getObjType());
218
219 return $cla;
220 }

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

+ Here is the call graph for this function:

◆ addEducational()

ilMD::addEducational ( )

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

117 {
118 $edu = new ilMDEducational($this->getRBACId(), $this->getObjId(), $this->getObjType());
119
120 return $edu;
121 }

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

+ Here is the call graph for this function:

◆ addGeneral()

ilMD::addGeneral ( )

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

45 {
46 $gen = new ilMDGeneral($this->getRBACId(), $this->getObjId(), $this->getObjType());
47
48 return $gen;
49 }

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

+ Here is the call graph for this function:

◆ addLifecycle()

ilMD::addLifecycle ( )

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

63 {
64 $lif = new ilMDLifecycle($this->getRBACId(), $this->getObjId(), $this->getObjType());
65
66 return $lif;
67 }

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

+ Here is the call graph for this function:

◆ addMetaMetadata()

ilMD::addMetaMetadata ( )

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

81 {
82 $met = new ilMDMetaMetadata($this->getRBACId(), $this->getObjId(), $this->getObjType());
83
84 return $met;
85 }

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

+ Here is the call graph for this function:

◆ addRelation()

ilMD::addRelation ( )

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

162 {
163 $rel = new ilMDRelation($this->getRBACId(), $this->getObjId(), $this->getObjType());
164
165 return $rel;
166 }

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

+ Here is the call graph for this function:

◆ addRights()

ilMD::addRights ( )

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

134 : ilMDRights
135 {
136 $rig = new ilMDRights($this->getRBACId(), $this->getObjId(), $this->getObjType());
137
138 return $rig;
139 }

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

+ Here is the call graph for this function:

◆ addTechnical()

ilMD::addTechnical ( )

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

99 {
100 $tec = new ilMDTechnical($this->getRBACId(), $this->getObjId(), $this->getObjType());
101
102 return $tec;
103 }

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

+ 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 288 of file class.ilMD.php.

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

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

+ Here is the call graph for this function:

◆ deleteAll()

ilMD::deleteAll ( )

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

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

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

+ Here is the call graph for this function:

◆ getAnnotation()

ilMD::getAnnotation ( int  $a_annotation_id)

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

177 {
178 if (!$a_annotation_id) {
179 return null;
180 }
181
182 $ann = new ilMDAnnotation();
183 $ann->setMetaId($a_annotation_id);
184
185 return $ann;
186 }

Referenced by toXML().

+ Here is the caller graph for this function:

◆ getAnnotationIds()

ilMD::getAnnotationIds ( )
Returns
int[]

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

171 : array
172 {
173 return ilMDAnnotation::_getIds($this->getRBACId(), $this->getObjId());
174 }
static _getIds(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ 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 203 of file class.ilMD.php.

204 {
205 if (!$a_classification_id) {
206 return null;
207 }
208
209 $cla = new ilMDClassification();
210 $cla->setMetaId($a_classification_id);
211
212 return $cla;
213 }

Referenced by toXML().

+ Here is the caller graph for this function:

◆ getClassificationIds()

ilMD::getClassificationIds ( )
Returns
int[]

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

198 : array
199 {
200 return ilMDClassification::_getIds($this->getRBACId(), $this->getObjId());
201 }
static _getIds(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEducational()

ilMD::getEducational ( )

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

106 {
107 if ($id = ilMDEducational::_getId($this->getRBACId(), $this->getObjId())) {
108 $edu = new ilMDEducational();
109 $edu->setMetaId($id);
110
111 return $edu;
112 }
113 return null;
114 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _getId(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneral()

ilMD::getGeneral ( )

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

35 {
36 if ($id = ilMDGeneral::_getId($this->getRBACId(), $this->getObjId())) {
37 $gen = new ilMDGeneral();
38 $gen->setMetaId($id);
39 return $gen;
40 }
41 return null;
42 }
static _getId(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLifecycle()

ilMD::getLifecycle ( )

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

52 {
53 if ($id = ilMDLifecycle::_getId($this->getRBACId(), $this->getObjId())) {
54 $lif = new ilMDLifecycle();
55 $lif->setMetaId($id);
56
57 return $lif;
58 }
59 return null;
60 }
static _getId(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMetaMetadata()

ilMD::getMetaMetadata ( )

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

70 {
71 if ($id = ilMDMetaMetadata::_getId($this->getRBACId(), $this->getObjId())) {
72 $met = new ilMDMetaMetadata();
73 $met->setMetaId($id);
74
75 return $met;
76 }
77 return null;
78 }
static _getId(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ 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 149 of file class.ilMD.php.

149 : ?ilMDRelation
150 {
151 if (!$a_relation_id) {
152 return null;
153 }
154
155 $rel = new ilMDRelation();
156 $rel->setMetaId($a_relation_id);
157
158 return $rel;
159 }

Referenced by toXML().

+ Here is the caller graph for this function:

◆ getRelationIds()

ilMD::getRelationIds ( )
Returns
int[]

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

144 : array
145 {
146 return ilMDRelation::_getIds($this->getRBACId(), $this->getObjId());
147 }
static _getIds(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRights()

ilMD::getRights ( )

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

123 : ?ilMDRights
124 {
125 if ($id = ilMDRights::_getId($this->getRBACId(), $this->getObjId())) {
126 $rig = new ilMDRights();
127 $rig->setMetaId($id);
128
129 return $rig;
130 }
131 return null;
132 }
static _getId(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTechnical()

ilMD::getTechnical ( )

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

88 {
89 if ($id = ilMDTechnical::_getId($this->getRBACId(), $this->getObjId())) {
90 $tec = new ilMDTechnical();
91 $tec->setMetaId($id);
92
93 return $tec;
94 }
95 return null;
96 }
static _getId(int $a_rbac_id, int $a_obj_id)

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

Referenced by toXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilMD::read ( )

Reimplemented from ilMDBase.

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

29 : bool
30 {
31 return true;
32 }

◆ toXML()

ilMD::toXML ( ilXmlWriter  $writer)

Reimplemented from ilMDBase.

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

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

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().

+ Here is the call graph for this function:

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