ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMDRelation Class Reference
+ Inheritance diagram for ilMDRelation:
+ Collaboration diagram for ilMDRelation:

Public Member Functions

getIdentifier_Ids ()
 
getIdentifier_ ($a_identifier__id)
 
addIdentifier_ ()
 
getDescriptionIds ()
 
getDescription ($a_description_id)
 
addDescription ()
 
 setKind ($a_kind)
 
 getKind ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
getIdentifier_Ids ()
 
getIdentifier_ ($a_identifier__id)
 
addIdentifier_ ()
 
getDescriptionIds ()
 
getDescription ($a_description_id)
 
addDescription ()
 
 setKind ($a_kind)
 
 getKind ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id)
 
getIdentifier_Ids ()
 
getIdentifier_ ($a_identifier__id)
 
addIdentifier_ ()
 
getDescriptionIds ()
 
getDescription ($a_description_id)
 
addDescription ()
 
 setKind ($a_kind)
 
 getKind ()
 
 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.ilMDRelation.php.

Member Function Documentation

◆ __getFields() [1/3]

ilMDRelation::__getFields ( )

Definition at line 178 of file class.ilMDRelation.php.

References getKind(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

179  {
180  return array('rbac_id' => $this->getRBACId(),
181  'obj_id' => $this->getObjId(),
182  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
183  'kind' => ilUtil::prepareDBString($this->getKind()));
184  }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ __getFields() [2/3]

ilMDRelation::__getFields ( )

Definition at line 182 of file class.ilMDRelation.php.

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

183  {
184  return array('rbac_id' => array('integer',$this->getRBACId()),
185  'obj_id' => array('integer',$this->getObjId()),
186  'obj_type' => array('text',$this->getObjType()),
187  'kind' => array('text',$this->getKind()));
188  }
+ Here is the call graph for this function:

◆ __getFields() [3/3]

ilMDRelation::__getFields ( )

Definition at line 182 of file class.ilMDRelation.php.

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

Referenced by save().

183  {
184  return array('rbac_id' => array('integer',$this->getRBACId()),
185  'obj_id' => array('integer',$this->getObjId()),
186  'obj_type' => array('text',$this->getObjType()),
187  'kind' => array('text',$this->getKind()));
188  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIds() [1/3]

ilMDRelation::_getIds (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 232 of file class.ilMDRelation.php.

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

233  {
234  global $ilDB;
235 
236  $query = "SELECT meta_relation_id FROM il_meta_relation " .
237  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
238  "AND obj_id = " . $ilDB->quote($a_obj_id);
239 
240  $res = $ilDB->query($query);
241  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
242  $ids[] = $row->meta_relation_id;
243  }
244  return $ids ? $ids : array();
245  }
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getIds() [2/3]

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

Definition at line 254 of file class.ilMDRelation.php.

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

255  {
256  global $DIC;
257 
258  $ilDB = $DIC['ilDB'];
259 
260  $query = "SELECT meta_relation_id FROM il_meta_relation " .
261  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
262  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
263 
264  $res = $ilDB->query($query);
265  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
266  $ids[] = $row->meta_relation_id;
267  }
268  return $ids ? $ids : array();
269  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getIds() [3/3]

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

Definition at line 254 of file class.ilMDRelation.php.

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

Referenced by ilMD\getRelationIds().

255  {
256  global $DIC;
257 
258  $ilDB = $DIC['ilDB'];
259 
260  $query = "SELECT meta_relation_id FROM il_meta_relation " .
261  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
262  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
263 
264  $res = $ilDB->query($query);
265  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
266  $ids[] = $row->meta_relation_id;
267  }
268  return $ids ? $ids : array();
269  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ addDescription() [1/3]

& ilMDRelation::addDescription ( )

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

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

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

◆ addDescription() [2/3]

& ilMDRelation::addDescription ( )

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

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

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

◆ addDescription() [3/3]

& ilMDRelation::addDescription ( )

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

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

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

◆ addIdentifier_() [1/3]

& ilMDRelation::addIdentifier_ ( )

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

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

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

◆ addIdentifier_() [2/3]

& ilMDRelation::addIdentifier_ ( )

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

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

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

◆ addIdentifier_() [3/3]

& ilMDRelation::addIdentifier_ ( )

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

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

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

◆ delete() [1/3]

ilMDRelation::delete ( )

Definition at line 153 of file class.ilMDRelation.php.

References $id, $ilDB, $query, getDescription(), getDescriptionIds(), getIdentifier_(), getIdentifier_Ids(), and ilMDBase\getMetaId().

154  {
155  global $ilDB;
156 
157  if ($this->getMetaId()) {
158  $query = "DELETE FROM il_meta_relation " .
159  "WHERE meta_relation_id = " . $ilDB->quote($this->getMetaId());
160 
161  $this->db->query($query);
162 
163  foreach ($this->getIdentifier_Ids() as $id) {
164  $ide = $this->getIdentifier_($id);
165  $ide->delete();
166  }
167  foreach ($this->getDescriptionIds() as $id) {
168  $des = $this->getDescription();
169  $des->delete();
170  }
171 
172  return true;
173  }
174  return false;
175  }
& getIdentifier_($a_identifier__id)
if(!array_key_exists('StateId', $_REQUEST)) $id
$query
global $ilDB
& getDescription($a_description_id)
+ Here is the call graph for this function:

◆ delete() [2/3]

ilMDRelation::delete ( )

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

References $DIC, $id, $ilDB, $query, $res, getDescription(), getDescriptionIds(), getIdentifier_(), getIdentifier_Ids(), and ilMDBase\getMetaId().

157  {
158  global $DIC;
159 
160  $ilDB = $DIC['ilDB'];
161 
162  if ($this->getMetaId()) {
163  $query = "DELETE FROM il_meta_relation " .
164  "WHERE meta_relation_id = " . $ilDB->quote($this->getMetaId(), 'integer');
165  $res = $ilDB->manipulate($query);
166 
167  foreach ($this->getIdentifier_Ids() as $id) {
168  $ide = $this->getIdentifier_($id);
169  $ide->delete();
170  }
171  foreach ($this->getDescriptionIds() as $id) {
172  $des = $this->getDescription($id);
173  $des->delete();
174  }
175 
176  return true;
177  }
178  return false;
179  }
& getIdentifier_($a_identifier__id)
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
foreach($_POST as $key=> $value) $res
$query
global $ilDB
& getDescription($a_description_id)
+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDRelation::delete ( )

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

References $DIC, $id, $ilDB, $query, $res, getDescription(), getDescriptionIds(), getIdentifier_(), getIdentifier_Ids(), and ilMDBase\getMetaId().

157  {
158  global $DIC;
159 
160  $ilDB = $DIC['ilDB'];
161 
162  if ($this->getMetaId()) {
163  $query = "DELETE FROM il_meta_relation " .
164  "WHERE meta_relation_id = " . $ilDB->quote($this->getMetaId(), 'integer');
165  $res = $ilDB->manipulate($query);
166 
167  foreach ($this->getIdentifier_Ids() as $id) {
168  $ide = $this->getIdentifier_($id);
169  $ide->delete();
170  }
171  foreach ($this->getDescriptionIds() as $id) {
172  $des = $this->getDescription($id);
173  $des->delete();
174  }
175 
176  return true;
177  }
178  return false;
179  }
& getIdentifier_($a_identifier__id)
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
foreach($_POST as $key=> $value) $res
$query
global $ilDB
& getDescription($a_description_id)
+ Here is the call graph for this function:

◆ getDescription() [1/3]

& ilMDRelation::getDescription (   $a_description_id)

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

72  {
73  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDDescription.php';
74 
75  if (!$a_description_id) {
76  return false;
77  }
78  $des = new ilMDDescription();
79  $des->setMetaId($a_description_id);
80 
81  return $des;
82  }

◆ getDescription() [2/3]

& ilMDRelation::getDescription (   $a_description_id)

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

72  {
73  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
74 
75  if (!$a_description_id) {
76  return false;
77  }
78  $des = new ilMDDescription();
79  $des->setMetaId($a_description_id);
80 
81  return $des;
82  }

◆ getDescription() [3/3]

& ilMDRelation::getDescription (   $a_description_id)

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

Referenced by delete(), and toXML().

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

◆ getDescriptionIds() [1/3]

& ilMDRelation::getDescriptionIds ( )

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

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

66  {
67  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDDescription.php';
68 
69  return ilMdDescription::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_relation');
70  }
+ Here is the call graph for this function:

◆ getDescriptionIds() [2/3]

& ilMDRelation::getDescriptionIds ( )

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

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

66  {
67  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDDescription.php';
68 
69  return ilMdDescription::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_relation');
70  }
+ Here is the call graph for this function:

◆ getDescriptionIds() [3/3]

& ilMDRelation::getDescriptionIds ( )

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

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

Referenced by delete(), and toXML().

66  {
67  include_once 'Services/MetaData/classes/class.ilMDDescription.php';
68 
69  return ilMdDescription::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_relation');
70  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdentifier_() [1/3]

& ilMDRelation::getIdentifier_ (   $a_identifier__id)

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

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

◆ getIdentifier_() [2/3]

& ilMDRelation::getIdentifier_ (   $a_identifier__id)

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

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

◆ getIdentifier_() [3/3]

& ilMDRelation::getIdentifier_ (   $a_identifier__id)

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

Referenced by delete(), and toXML().

43  {
44  include_once 'Services/MetaData/classes/class.ilMDIdentifier_.php';
45 
46  if (!$a_identifier__id) {
47  return false;
48  }
49  $ide = new ilMDIdentifier_();
50  $ide->setMetaId($a_identifier__id);
51 
52  return $ide;
53  }
+ Here is the caller graph for this function:

◆ getIdentifier_Ids() [1/3]

& ilMDRelation::getIdentifier_Ids ( )

Definition at line 36 of file class.ilMDRelation.php.

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

37  {
38  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier_.php';
39 
40  return ilMDIdentifier_::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_relation');
41  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getIdentifier_Ids() [2/3]

& ilMDRelation::getIdentifier_Ids ( )

Definition at line 36 of file class.ilMDRelation.php.

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

Referenced by delete(), and toXML().

37  {
38  include_once 'Services/MetaData/classes/class.ilMDIdentifier_.php';
39 
40  return ilMDIdentifier_::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_relation');
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:

◆ getIdentifier_Ids() [3/3]

& ilMDRelation::getIdentifier_Ids ( )

Definition at line 36 of file class.ilMDRelation.php.

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

37  {
38  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDIdentifier_.php';
39 
40  return ilMDIdentifier_::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_relation');
41  }
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
+ Here is the call graph for this function:

◆ getKind() [1/3]

ilMDRelation::getKind ( )

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

Referenced by __getFields(), and toXML().

117  {
118  return $this->kind;
119  }
+ Here is the caller graph for this function:

◆ getKind() [2/3]

ilMDRelation::getKind ( )

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

117  {
118  return $this->kind;
119  }

◆ getKind() [3/3]

ilMDRelation::getKind ( )

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

117  {
118  return $this->kind;
119  }

◆ read() [1/3]

ilMDRelation::read ( )

Definition at line 186 of file class.ilMDRelation.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setKind(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

187  {
188  global $ilDB;
189 
190  if ($this->getMetaId()) {
191  $query = "SELECT * FROM il_meta_relation " .
192  "WHERE meta_relation_id = " . $ilDB->quote($this->getMetaId());
193 
194  $res = $this->db->query($query);
195  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
196  $this->setRBACId($row->rbac_id);
197  $this->setObjId($row->obj_id);
198  $this->setObjType($row->obj_type);
199  $this->setKind(ilUtil::stripSlashes($row->kind));
200  }
201  }
202  return true;
203  }
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]

ilMDRelation::read ( )

Definition at line 190 of file class.ilMDRelation.php.

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

191  {
192  global $DIC;
193 
194  $ilDB = $DIC['ilDB'];
195 
196  if ($this->getMetaId()) {
197  $query = "SELECT * FROM il_meta_relation " .
198  "WHERE meta_relation_id = " . $ilDB->quote($this->getMetaId(), 'integer');
199 
200  $res = $this->db->query($query);
201  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
202  $this->setRBACId($row->rbac_id);
203  $this->setObjId($row->obj_id);
204  $this->setObjType($row->obj_type);
205  $this->setKind($row->kind);
206  }
207  }
208  return true;
209  }
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]

ilMDRelation::read ( )

Definition at line 190 of file class.ilMDRelation.php.

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

191  {
192  global $DIC;
193 
194  $ilDB = $DIC['ilDB'];
195 
196  if ($this->getMetaId()) {
197  $query = "SELECT * FROM il_meta_relation " .
198  "WHERE meta_relation_id = " . $ilDB->quote($this->getMetaId(), 'integer');
199 
200  $res = $this->db->query($query);
201  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
202  $this->setRBACId($row->rbac_id);
203  $this->setObjId($row->obj_id);
204  $this->setObjType($row->obj_type);
205  $this->setKind($row->kind);
206  }
207  }
208  return true;
209  }
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]

ilMDRelation::save ( )

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

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

123  {
124  if ($this->db->autoExecute(
125  'il_meta_relation',
126  $this->__getFields(),
128  )) {
129  $this->setMetaId($this->db->getLastInsertId());
130 
131  return $this->getMetaId();
132  }
133  return false;
134  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/3]

ilMDRelation::save ( )

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

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

123  {
124  global $DIC;
125 
126  $ilDB = $DIC['ilDB'];
127 
128  $fields = $this->__getFields();
129  $fields['meta_relation_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_relation'));
130 
131  if ($this->db->insert('il_meta_relation', $fields)) {
132  $this->setMetaId($next_id);
133  return $this->getMetaId();
134  }
135  return false;
136  }
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() [3/3]

ilMDRelation::save ( )

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

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

123  {
124  global $DIC;
125 
126  $ilDB = $DIC['ilDB'];
127 
128  $fields = $this->__getFields();
129  $fields['meta_relation_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_relation'));
130 
131  if ($this->db->insert('il_meta_relation', $fields)) {
132  $this->setMetaId($next_id);
133  return $this->getMetaId();
134  }
135  return false;
136  }
global $DIC
Definition: saml.php:7
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ setKind() [1/3]

ilMDRelation::setKind (   $a_kind)

Definition at line 94 of file class.ilMDRelation.php.

95  {
96  switch ($a_kind) {
97  case 'IsPartOf':
98  case 'HasPart':
99  case 'IsVersionOf':
100  case 'HasVersion':
101  case 'IsFormatOf':
102  case 'HasFormat':
103  case 'References':
104  case 'IsReferencedBy':
105  case 'IsBasedOn':
106  case 'IsBasisFor':
107  case 'Requires':
108  case 'IsRequiredBy':
109  $this->kind = $a_kind;
110  return true;
111 
112  default:
113  return false;
114  }
115  }

◆ setKind() [2/3]

ilMDRelation::setKind (   $a_kind)

Definition at line 94 of file class.ilMDRelation.php.

95  {
96  switch ($a_kind) {
97  case 'IsPartOf':
98  case 'HasPart':
99  case 'IsVersionOf':
100  case 'HasVersion':
101  case 'IsFormatOf':
102  case 'HasFormat':
103  case 'References':
104  case 'IsReferencedBy':
105  case 'IsBasedOn':
106  case 'IsBasisFor':
107  case 'Requires':
108  case 'IsRequiredBy':
109  $this->kind = $a_kind;
110  return true;
111 
112  default:
113  return false;
114  }
115  }

◆ setKind() [3/3]

ilMDRelation::setKind (   $a_kind)

Definition at line 94 of file class.ilMDRelation.php.

Referenced by read().

95  {
96  switch ($a_kind) {
97  case 'IsPartOf':
98  case 'HasPart':
99  case 'IsVersionOf':
100  case 'HasVersion':
101  case 'IsFormatOf':
102  case 'HasFormat':
103  case 'References':
104  case 'IsReferencedBy':
105  case 'IsBasedOn':
106  case 'IsBasisFor':
107  case 'Requires':
108  case 'IsRequiredBy':
109  $this->kind = $a_kind;
110  return true;
111 
112  default:
113  return false;
114  }
115  }
+ Here is the caller graph for this function:

◆ toXML() [1/3]

ilMDRelation::toXML ( $writer)

Definition at line 210 of file class.ilMDRelation.php.

References $id, getDescription(), getDescriptionIds(), getIdentifier_(), getIdentifier_Ids(), and getKind().

211  {
212  $writer->xmlStartTag('Relation', array('Kind' => $this->getKind()));
213  $writer->xmlStartTag('Resource');
214 
215  // Identifier_
216  foreach ($this->getIdentifier_Ids() as $id) {
217  $ide = &$this->getIdentifier_($id);
218  $ide->toXML($writer);
219  }
220  // Description
221  foreach ($this->getDescriptionIds() as $id) {
222  $des = &$this->getDescription($id);
223  $des->toXML($writer);
224  }
225  $writer->xmlEndTag('Resource');
226  $writer->xmlEndTag('Relation');
227  }
& getIdentifier_($a_identifier__id)
if(!array_key_exists('StateId', $_REQUEST)) $id
& getDescription($a_description_id)
+ Here is the call graph for this function:

◆ toXML() [2/3]

ilMDRelation::toXML ( $writer)

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

References $id, getDescription(), getDescriptionIds(), getIdentifier_(), getIdentifier_Ids(), getKind(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

217  {
218  $writer->xmlStartTag('Relation', array('Kind' => $this->getKind()
219  ? $this->getKind()
220  : 'IsPartOf'));
221  $writer->xmlStartTag('Resource');
222 
223  // Identifier_
224  $ides = $this->getIdentifier_Ids();
225  foreach ($ides as $id) {
226  $ide = &$this->getIdentifier_($id);
227  $ide->toXML($writer);
228  }
229  if (!count($ides)) {
230  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDIdentifier_.php';
231  $ide = new ilMDIdentifier_($this->getRBACId(), $this->getObjId());
232  $ide->toXML($writer);
233  }
234 
235  // Description
236  $dess = $this->getDescriptionIds();
237  foreach ($dess as $id) {
238  $des = &$this->getDescription($id);
239  $des->toXML($writer);
240  }
241  if (!count($dess)) {
242  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDDescription.php';
243  $des = new ilMDDescription($this->getRBACId(), $this->getObjId());
244  $des->toXML($writer);
245  }
246 
247  $writer->xmlEndTag('Resource');
248  $writer->xmlEndTag('Relation');
249  }
& getIdentifier_($a_identifier__id)
if(!array_key_exists('StateId', $_REQUEST)) $id
& getDescription($a_description_id)
+ Here is the call graph for this function:

◆ toXML() [3/3]

ilMDRelation::toXML ( $writer)

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

References $id, getDescription(), getDescriptionIds(), getIdentifier_(), getIdentifier_Ids(), getKind(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

217  {
218  $writer->xmlStartTag('Relation', array('Kind' => $this->getKind()
219  ? $this->getKind()
220  : 'IsPartOf'));
221  $writer->xmlStartTag('Resource');
222 
223  // Identifier_
224  $ides = $this->getIdentifier_Ids();
225  foreach ($ides as $id) {
226  $ide = &$this->getIdentifier_($id);
227  $ide->toXML($writer);
228  }
229  if (!count($ides)) {
230  include_once 'Services/MetaData/classes/class.ilMDIdentifier_.php';
231  $ide = new ilMDIdentifier_($this->getRBACId(), $this->getObjId());
232  $ide->toXML($writer);
233  }
234 
235  // Description
236  $dess = $this->getDescriptionIds();
237  foreach ($dess as $id) {
238  $des = &$this->getDescription($id);
239  $des->toXML($writer);
240  }
241  if (!count($dess)) {
242  include_once 'Services/MetaData/classes/class.ilMDDescription.php';
243  $des = new ilMDDescription($this->getRBACId(), $this->getObjId());
244  $des->toXML($writer);
245  }
246 
247  $writer->xmlEndTag('Resource');
248  $writer->xmlEndTag('Relation');
249  }
& getIdentifier_($a_identifier__id)
if(!array_key_exists('StateId', $_REQUEST)) $id
& getDescription($a_description_id)
+ Here is the call graph for this function:

◆ update() [1/3]

ilMDRelation::update ( )

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

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

137  {
138  global $ilDB;
139 
140  if ($this->getMetaId()) {
141  if ($this->db->autoExecute(
142  'il_meta_relation',
143  $this->__getFields(),
145  "meta_relation_id = " . $ilDB->quote($this->getMetaId())
146  )) {
147  return true;
148  }
149  }
150  return false;
151  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/3]

ilMDRelation::update ( )

Definition at line 138 of file class.ilMDRelation.php.

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

139  {
140  global $DIC;
141 
142  $ilDB = $DIC['ilDB'];
143 
144  if ($this->getMetaId()) {
145  if ($this->db->update(
146  'il_meta_relation',
147  $this->__getFields(),
148  array("meta_relation_id" => array('integer',$this->getMetaId()))
149  )) {
150  return true;
151  }
152  }
153  return false;
154  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ update() [3/3]

ilMDRelation::update ( )

Definition at line 138 of file class.ilMDRelation.php.

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

139  {
140  global $DIC;
141 
142  $ilDB = $DIC['ilDB'];
143 
144  if ($this->getMetaId()) {
145  if ($this->db->update(
146  'il_meta_relation',
147  $this->__getFields(),
148  array("meta_relation_id" => array('integer',$this->getMetaId()))
149  )) {
150  return true;
151  }
152  }
153  return false;
154  }
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: