ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMD5295MetaMetadata Class Reference
+ Inheritance diagram for ilMD5295MetaMetadata:
+ Collaboration diagram for ilMD5295MetaMetadata:

Public Member Functions

 getPossibleSubelements ()
 
getIdentifierIds ()
 
getIdentifier ($a_identifier_id)
 
addIdentifier ()
 
getContributeIds ()
 
getContribute ($a_contribute_id)
 
addContribute ()
 
 setMetaDataScheme ($a_val)
 
 getMetaDataScheme ()
 
 setLanguage (&$lng_obj)
 
getLanguage ()
 
 getLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
- Public Member Functions inherited from ilMD5295Base
 __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 _getId ($a_rbac_id, $a_obj_id)
 

Additional Inherited Members

- Data Fields inherited from ilMD5295Base
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 
- Protected Attributes inherited from ilMD5295Base
 $log
 

Detailed Description

Definition at line 33 of file class.ilMD5295MetaMetadata.php.

Member Function Documentation

◆ __getFields()

ilMD5295MetaMetadata::__getFields ( )

Definition at line 193 of file class.ilMD5295MetaMetadata.php.

References getLanguageCode(), getMetaDataScheme(), ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), and ilMD5295Base\getRBACId().

Referenced by save().

194  {
195  return array('rbac_id' => array('integer',$this->getRBACId()),
196  'obj_id' => array('integer',$this->getObjId()),
197  'obj_type' => array('text',$this->getObjType()),
198  'meta_data_scheme' => array('text',$this->getMetaDataScheme()),
199  'language' => array('text',$this->getLanguageCode()));
200  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getId()

static ilMD5295MetaMetadata::_getId (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 272 of file class.ilMD5295MetaMetadata.php.

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

Referenced by ilMD5295\getMetaMetadata().

273  {
274  global $DIC;
275 
276  $ilDB = $DIC['ilDB'];
277 
278  $query = "SELECT meta_meta_data_id FROM il_meta_meta_data " .
279  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
280  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
281 
282  $res = $ilDB->query($query);
283  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
284  return $row->meta_meta_data_id;
285  }
286  return false;
287  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ addContribute()

& ilMD5295MetaMetadata::addContribute ( )

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

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

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

◆ addIdentifier()

& ilMD5295MetaMetadata::addIdentifier ( )

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

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

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

◆ delete()

ilMD5295MetaMetadata::delete ( )

Definition at line 165 of file class.ilMD5295MetaMetadata.php.

References $DIC, $ilDB, $query, $res, getContribute(), getContributeIds(), getIdentifier(), getIdentifierIds(), and ilMD5295Base\getMetaId().

166  {
167  global $DIC;
168 
169  $ilDB = $DIC['ilDB'];
170 
171  if ($this->getMetaId()) {
172  $query = "DELETE FROM il_meta_meta_data " .
173  "WHERE meta_meta_data_id = " . $ilDB->quote($this->getMetaId(), 'integer');
174  $res = $ilDB->manipulate($query);
175 
176 
177  foreach ($this->getIdentifierIds() as $id) {
178  $ide = $this->getIdentifier($id);
179  $ide->delete();
180  }
181 
182  foreach ($this->getContributeIds() as $id) {
183  $con = $this->getContribute($id);
184  $con->delete();
185  }
186  return true;
187  }
188 
189  return false;
190  }
& getContribute($a_contribute_id)
& getIdentifier($a_identifier_id)
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getContribute()

& ilMD5295MetaMetadata::getContribute (   $a_contribute_id)

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

Referenced by delete(), and toXML().

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

◆ getContributeIds()

& ilMD5295MetaMetadata::getContributeIds ( )

Definition at line 74 of file class.ilMD5295MetaMetadata.php.

References ilMD5295Contribute\_getIds(), ilMD5295Base\getMetaId(), ilMD5295Base\getObjId(), and ilMD5295Base\getRBACId().

Referenced by delete(), and toXML().

75  {
76  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Contribute.php';
77 
78  return ilMD5295Contribute::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_meta_data');
79  }
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:

◆ getIdentifier()

& ilMD5295MetaMetadata::getIdentifier (   $a_identifier_id)

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

Referenced by delete(), and toXML().

52  {
53  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier.php';
54 
55  if (!$a_identifier_id) {
56  return false;
57  }
58  $ide = new ilMD5295Identifier();
59  $ide->setMetaId($a_identifier_id);
60 
61  return $ide;
62  }
+ Here is the caller graph for this function:

◆ getIdentifierIds()

& ilMD5295MetaMetadata::getIdentifierIds ( )

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

References ilMD5295Identifier\_getIds(), ilMD5295Base\getMetaId(), ilMD5295Base\getObjId(), and ilMD5295Base\getRBACId().

Referenced by delete(), and toXML().

46  {
47  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier.php';
48 
49  return ilMD5295Identifier::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_meta_data');
50  }
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:

◆ getLanguage()

& ilMD5295MetaMetadata::getLanguage ( )

Definition at line 121 of file class.ilMD5295MetaMetadata.php.

References language().

122  {
123  return is_object($this->language) ? $this->language : false;
124  }
language()
Definition: language.php:2
+ Here is the call graph for this function:

◆ getLanguageCode()

ilMD5295MetaMetadata::getLanguageCode ( )

Definition at line 125 of file class.ilMD5295MetaMetadata.php.

References language().

Referenced by __getFields(), and toXML().

126  {
127  return is_object($this->language) ? $this->language->getLanguageCode() : false;
128  }
language()
Definition: language.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMetaDataScheme()

ilMD5295MetaMetadata::getMetaDataScheme ( )

Definition at line 110 of file class.ilMD5295MetaMetadata.php.

Referenced by __getFields(), and toXML().

111  {
112  // Fixed attribute
113  return 'LOM v 1.0';
114  }
+ Here is the caller graph for this function:

◆ getPossibleSubelements()

ilMD5295MetaMetadata::getPossibleSubelements ( )

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

36  {
37  $subs['Identifier'] = 'meta_identifier';
38  $subs['Contribute'] = 'meta_contribute';
39 
40  return $subs;
41  }

◆ read()

ilMD5295MetaMetadata::read ( )

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilMD5295Base\getMetaId(), setLanguage(), setMetaDataScheme(), ilMD5295Base\setObjId(), ilMD5295Base\setObjType(), and ilMD5295Base\setRBACId().

203  {
204  global $DIC;
205 
206  $ilDB = $DIC['ilDB'];
207 
208  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php';
209 
210 
211  if ($this->getMetaId()) {
212  $query = "SELECT * FROM il_meta_meta_data " .
213  "WHERE meta_meta_data_id = " . $ilDB->quote($this->getMetaId(), 'integer');
214 
215 
216  $res = $this->db->query($query);
217  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
218  $this->setRBACId($row->rbac_id);
219  $this->setObjId($row->obj_id);
220  $this->setObjType($row->obj_type);
221  $this->setMetaDataScheme($row->meta_data_scheme);
222  $this->setLanguage(new ilMD5295LanguageItem($row->language));
223  }
224  return true;
225  }
226  return false;
227  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ save()

ilMD5295MetaMetadata::save ( )

Definition at line 131 of file class.ilMD5295MetaMetadata.php.

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

132  {
133  global $DIC;
134 
135  $ilDB = $DIC['ilDB'];
136 
137  $fields = $this->__getFields();
138  $fields['meta_meta_data_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_meta_data'));
139 
140  if ($this->db->insert('il_meta_meta_data', $fields)) {
141  $this->setMetaId($next_id);
142  return $this->getMetaId();
143  }
144  return false;
145  }
global $ilDB
$DIC
Definition: xapitoken.php:46
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setLanguage()

ilMD5295MetaMetadata::setLanguage ( $lng_obj)

Definition at line 115 of file class.ilMD5295MetaMetadata.php.

References language().

Referenced by read().

116  {
117  if (is_object($lng_obj)) {
118  $this->language = $lng_obj;
119  }
120  }
language()
Definition: language.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMetaDataScheme()

ilMD5295MetaMetadata::setMetaDataScheme (   $a_val)

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

Referenced by read().

107  {
108  $this->meta_data_scheme = $a_val;
109  }
+ Here is the caller graph for this function:

◆ toXML()

ilMD5295MetaMetadata::toXML ( $writer)

Definition at line 234 of file class.ilMD5295MetaMetadata.php.

References getContribute(), getContributeIds(), getIdentifier(), getIdentifierIds(), getLanguageCode(), getMetaDataScheme(), ilMD5295Base\getObjId(), and ilMD5295Base\getRBACId().

235  {
236  if ($this->getMetaDataScheme()) {
237  $attr['MetadataScheme'] = $this->getMetaDataScheme();
238  }
239  if ($this->getLanguageCode()) {
240  $attr['Language'] = $this->getLanguageCode();
241  }
242  $writer->xmlStartTag('Meta-Metadata', $attr ? $attr : null);
243 
244  // ELEMENT IDENTIFIER
245  $identifiers = $this->getIdentifierIds();
246  foreach ($identifiers as $id) {
247  $ide = &$this->getIdentifier($id);
248  $ide->toXML($writer);
249  }
250  if (!count($identifiers)) {
251  include_once 'Services/Metadata/classes/class.ilMD5295Identifier.php';
252  $ide = new ilMD5295Identifier($this->getRBACId(), $this->getObjId());
253  $ide->toXML($writer);
254  }
255 
256  // ELEMETN Contribute
257  $contributes = $this->getContributeIds();
258  foreach ($contributes as $id) {
259  $con = &$this->getContribute($id);
260  $con->toXML($writer);
261  }
262  if (!count($contributes)) {
263  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Contribute.php';
264  $con = new ilMD5295Contribute($this->getRBACId(), $this->getObjId());
265  $con->toXML($writer);
266  }
267 
268  $writer->xmlEndTag('Meta-Metadata');
269  }
& getContribute($a_contribute_id)
& getIdentifier($a_identifier_id)
+ Here is the call graph for this function:

◆ update()

ilMD5295MetaMetadata::update ( )

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

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

148  {
149  global $DIC;
150 
151  $ilDB = $DIC['ilDB'];
152 
153  if ($this->getMetaId()) {
154  if ($this->db->update(
155  'il_meta_meta_data',
156  $this->__getFields(),
157  array("meta_meta_data_id" => array('integer',$this->getMetaId()))
158  )) {
159  return true;
160  }
161  }
162  return false;
163  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

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