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

Public Member Functions

 setEntity ($a_entity)
 
 getEntity ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setEntity ($a_entity)
 
 getEntity ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
 setEntity ($a_entity)
 
 getEntity ()
 
 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, $a_parent_id, $a_parent_type)
 
static _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 

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 34 of file class.ilMDEntity.php.

Member Function Documentation

◆ __getFields() [1/3]

ilMDEntity::__getFields ( )

Definition at line 93 of file class.ilMDEntity.php.

References getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

94  {
95  return array('rbac_id' => $this->getRBACId(),
96  'obj_id' => $this->getObjId(),
97  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
98  'parent_type' => $this->getParentType(),
99  'parent_id' => $this->getParentId(),
100  'entity' => ilUtil::prepareDBString($this->getEntity()));
101  }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ __getFields() [2/3]

ilMDEntity::__getFields ( )

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

References getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), and ilMDBase\getRBACId().

Referenced by save().

100  {
101  return array('rbac_id' => array('integer',$this->getRBACId()),
102  'obj_id' => array('integer',$this->getObjId()),
103  'obj_type' => array('text',$this->getObjType()),
104  'parent_type' => array('text',$this->getParentType()),
105  'parent_id' => array('integer',$this->getParentId()),
106  'entity' => array('text',$this->getEntity()));
107  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [3/3]

ilMDEntity::__getFields ( )

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

References getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), and ilMDBase\getRBACId().

100  {
101  return array('rbac_id' => array('integer',$this->getRBACId()),
102  'obj_id' => array('integer',$this->getObjId()),
103  'obj_type' => array('text',$this->getObjType()),
104  'parent_type' => array('text',$this->getParentType()),
105  'parent_id' => array('integer',$this->getParentId()),
106  'entity' => array('text',$this->getEntity()));
107  }
+ Here is the call graph for this function:

◆ _getIds() [1/3]

ilMDEntity::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)

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

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

137  {
138  global $ilDB;
139 
140  $query = "SELECT meta_entity_id FROM il_meta_entity " .
141  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
142  "AND obj_id = " . $ilDB->quote($a_obj_id) . " " .
143  "AND parent_id = " . $ilDB->quote($a_parent_id) . " " .
144  "AND parent_type = " . $ilDB->quote($a_parent_type);
145 
146  $res = $ilDB->query($query);
147  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
148  $ids[] = $row->meta_entity_id;
149  }
150  return $ids ? $ids : array();
151  }
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getIds() [2/3]

static ilMDEntity::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)
static

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

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

Referenced by ilMDContribute\getEntityIds().

145  {
146  global $DIC;
147 
148  $ilDB = $DIC['ilDB'];
149 
150  $query = "SELECT meta_entity_id FROM il_meta_entity " .
151  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
152  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
153  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
154  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text') . " " .
155  "ORDER BY meta_entity_id ";
156 
157  $res = $ilDB->query($query);
158  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
159  $ids[] = $row->meta_entity_id;
160  }
161  return $ids ? $ids : array();
162  }
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 ilMDEntity::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)
static

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

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

145  {
146  global $DIC;
147 
148  $ilDB = $DIC['ilDB'];
149 
150  $query = "SELECT meta_entity_id FROM il_meta_entity " .
151  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
152  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
153  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
154  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text') . " " .
155  "ORDER BY meta_entity_id ";
156 
157  $res = $ilDB->query($query);
158  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
159  $ids[] = $row->meta_entity_id;
160  }
161  return $ids ? $ids : array();
162  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ delete() [1/3]

ilMDEntity::delete ( )

Definition at line 77 of file class.ilMDEntity.php.

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

78  {
79  global $ilDB;
80 
81  if ($this->getMetaId()) {
82  $query = "DELETE FROM il_meta_entity " .
83  "WHERE meta_entity_id = " . $ilDB->quote($this->getMetaId());
84 
85  $this->db->query($query);
86 
87  return true;
88  }
89  return false;
90  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [2/3]

ilMDEntity::delete ( )

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

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

81  {
82  global $DIC;
83 
84  $ilDB = $DIC['ilDB'];
85 
86  if ($this->getMetaId()) {
87  $query = "DELETE FROM il_meta_entity " .
88  "WHERE meta_entity_id = " . $ilDB->quote($this->getMetaId(), 'integer');
89  $res = $ilDB->manipulate($query);
90 
91  $this->db->query($query);
92 
93  return true;
94  }
95  return false;
96  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDEntity::delete ( )

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

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

81  {
82  global $DIC;
83 
84  $ilDB = $DIC['ilDB'];
85 
86  if ($this->getMetaId()) {
87  $query = "DELETE FROM il_meta_entity " .
88  "WHERE meta_entity_id = " . $ilDB->quote($this->getMetaId(), 'integer');
89  $res = $ilDB->manipulate($query);
90 
91  $this->db->query($query);
92 
93  return true;
94  }
95  return false;
96  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ getEntity() [1/3]

ilMDEntity::getEntity ( )

Definition at line 41 of file class.ilMDEntity.php.

Referenced by __getFields(), and toXML().

42  {
43  return $this->entity;
44  }
+ Here is the caller graph for this function:

◆ getEntity() [2/3]

ilMDEntity::getEntity ( )

Definition at line 41 of file class.ilMDEntity.php.

42  {
43  return $this->entity;
44  }

◆ getEntity() [3/3]

ilMDEntity::getEntity ( )

Definition at line 41 of file class.ilMDEntity.php.

42  {
43  return $this->entity;
44  }

◆ read() [1/3]

ilMDEntity::read ( )

Definition at line 103 of file class.ilMDEntity.php.

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

104  {
105  global $ilDB;
106 
107  if ($this->getMetaId()) {
108  $query = "SELECT * FROM il_meta_entity " .
109  "WHERE meta_entity_id = " . $ilDB->quote($this->getMetaId());
110 
111  $res = $this->db->query($query);
112  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
113  $this->setRBACId($row->rbac_id);
114  $this->setObjId($row->obj_id);
115  $this->setObjType($row->obj_type);
116  $this->setParentId($row->parent_id);
117  $this->setParentType($row->parent_type);
118  $this->setEntity(ilUtil::stripSlashes($row->entity));
119  }
120  }
121  return true;
122  }
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
setParentId($a_id)
$row
global $ilDB
setParentType($a_parent_type)
setEntity($a_entity)
+ Here is the call graph for this function:

◆ read() [2/3]

ilMDEntity::read ( )

Definition at line 109 of file class.ilMDEntity.php.

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

110  {
111  global $DIC;
112 
113  $ilDB = $DIC['ilDB'];
114 
115  if ($this->getMetaId()) {
116  $query = "SELECT * FROM il_meta_entity " .
117  "WHERE meta_entity_id = " . $ilDB->quote($this->getMetaId(), 'integer');
118 
119  $res = $this->db->query($query);
120  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
121  $this->setRBACId($row->rbac_id);
122  $this->setObjId($row->obj_id);
123  $this->setObjType($row->obj_type);
124  $this->setParentId($row->parent_id);
125  $this->setParentType($row->parent_type);
126  $this->setEntity($row->entity);
127  }
128  }
129  return true;
130  }
setObjType($a_type)
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
setParentId($a_id)
$row
global $ilDB
setParentType($a_parent_type)
setEntity($a_entity)
+ Here is the call graph for this function:

◆ read() [3/3]

ilMDEntity::read ( )

Definition at line 109 of file class.ilMDEntity.php.

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

110  {
111  global $DIC;
112 
113  $ilDB = $DIC['ilDB'];
114 
115  if ($this->getMetaId()) {
116  $query = "SELECT * FROM il_meta_entity " .
117  "WHERE meta_entity_id = " . $ilDB->quote($this->getMetaId(), 'integer');
118 
119  $res = $this->db->query($query);
120  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
121  $this->setRBACId($row->rbac_id);
122  $this->setObjId($row->obj_id);
123  $this->setObjType($row->obj_type);
124  $this->setParentId($row->parent_id);
125  $this->setParentType($row->parent_type);
126  $this->setEntity($row->entity);
127  }
128  }
129  return true;
130  }
setObjType($a_type)
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
setParentId($a_id)
$row
global $ilDB
setParentType($a_parent_type)
setEntity($a_entity)
+ Here is the call graph for this function:

◆ save() [1/3]

ilMDEntity::save ( )

Definition at line 46 of file class.ilMDEntity.php.

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

47  {
48  global $DIC;
49 
50  $ilDB = $DIC['ilDB'];
51 
52  $fields = $this->__getFields();
53  $fields['meta_entity_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_entity'));
54 
55  if ($this->db->insert('il_meta_entity', $fields)) {
56  $this->setMetaId($next_id);
57  return $this->getMetaId();
58  }
59  return false;
60  }
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]

ilMDEntity::save ( )

Definition at line 46 of file class.ilMDEntity.php.

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

47  {
48  global $DIC;
49 
50  $ilDB = $DIC['ilDB'];
51 
52  $fields = $this->__getFields();
53  $fields['meta_entity_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_entity'));
54 
55  if ($this->db->insert('il_meta_entity', $fields)) {
56  $this->setMetaId($next_id);
57  return $this->getMetaId();
58  }
59  return false;
60  }
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]

ilMDEntity::save ( )

Definition at line 46 of file class.ilMDEntity.php.

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

47  {
48  if ($this->db->autoExecute(
49  'il_meta_entity',
50  $this->__getFields(),
52  )) {
53  $this->setMetaId($this->db->getLastInsertId());
54 
55  return $this->getMetaId();
56  }
57  return false;
58  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setEntity() [1/3]

ilMDEntity::setEntity (   $a_entity)

Definition at line 37 of file class.ilMDEntity.php.

38  {
39  $this->entity = $a_entity;
40  }

◆ setEntity() [2/3]

ilMDEntity::setEntity (   $a_entity)

Definition at line 37 of file class.ilMDEntity.php.

38  {
39  $this->entity = $a_entity;
40  }

◆ setEntity() [3/3]

ilMDEntity::setEntity (   $a_entity)

Definition at line 37 of file class.ilMDEntity.php.

Referenced by read().

38  {
39  $this->entity = $a_entity;
40  }
+ Here is the caller graph for this function:

◆ toXML() [1/3]

ilMDEntity::toXML ( $writer)

Definition at line 129 of file class.ilMDEntity.php.

References getEntity().

130  {
131  $writer->xmlElement('Entity', null, $this->getEntity());
132  }
+ Here is the call graph for this function:

◆ toXML() [2/3]

ilMDEntity::toXML ( $writer)

Definition at line 137 of file class.ilMDEntity.php.

References getEntity().

138  {
139  $writer->xmlElement('Entity', null, $this->getEntity());
140  }
+ Here is the call graph for this function:

◆ toXML() [3/3]

ilMDEntity::toXML ( $writer)

Definition at line 137 of file class.ilMDEntity.php.

References getEntity().

138  {
139  $writer->xmlElement('Entity', null, $this->getEntity());
140  }
+ Here is the call graph for this function:

◆ update() [1/3]

ilMDEntity::update ( )

Definition at line 60 of file class.ilMDEntity.php.

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

61  {
62  global $ilDB;
63 
64  if ($this->getMetaId()) {
65  if ($this->db->autoExecute(
66  'il_meta_entity',
67  $this->__getFields(),
69  "meta_entity_id = " . $ilDB->quote($this->getMetaId())
70  )) {
71  return true;
72  }
73  }
74  return false;
75  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/3]

ilMDEntity::update ( )

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

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

63  {
64  global $DIC;
65 
66  $ilDB = $DIC['ilDB'];
67 
68  if ($this->getMetaId()) {
69  if ($this->db->update(
70  'il_meta_entity',
71  $this->__getFields(),
72  array("meta_entity_id" => array('integer',$this->getMetaId()))
73  )) {
74  return true;
75  }
76  }
77  return false;
78  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ update() [3/3]

ilMDEntity::update ( )

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

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

63  {
64  global $DIC;
65 
66  $ilDB = $DIC['ilDB'];
67 
68  if ($this->getMetaId()) {
69  if ($this->db->update(
70  'il_meta_entity',
71  $this->__getFields(),
72  array("meta_entity_id" => array('integer',$this->getMetaId()))
73  )) {
74  return true;
75  }
76  }
77  return false;
78  }
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: