ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMD5295Entity Class Reference
+ Inheritance diagram for ilMD5295Entity:
+ Collaboration diagram for ilMD5295Entity:

Public Member Functions

 setEntity ($a_entity)
 
 getEntity ()
 
 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 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 

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

Member Function Documentation

◆ __getFields()

ilMD5295Entity::__getFields ( )

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

References getEntity(), ilMD5295Base\getObjId(), ilMD5295Base\getObjType(), ilMD5295Base\getParentId(), ilMD5295Base\getParentType(), and ilMD5295Base\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:

◆ _getIds()

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

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

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

Referenced by ilMD5295Contribute\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  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the caller graph for this function:

◆ delete()

ilMD5295Entity::delete ( )

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

References $DIC, $ilDB, $query, $res, and ilMD5295Base\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  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ getEntity()

ilMD5295Entity::getEntity ( )

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

Referenced by __getFields(), and toXML().

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

◆ read()

ilMD5295Entity::read ( )

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilMD5295Base\getMetaId(), setEntity(), ilMD5295Base\setObjId(), ilMD5295Base\setObjType(), ilMD5295Base\setParentId(), ilMD5295Base\setParentType(), and ilMD5295Base\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  }
setParentType($a_parent_type)
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ save()

ilMD5295Entity::save ( )

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

References $DIC, $ilDB, __getFields(), ilMD5295Base\getMetaId(), and ilMD5295Base\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: goto.php:24
global $ilDB
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setEntity()

ilMD5295Entity::setEntity (   $a_entity)

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

Referenced by read().

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

◆ toXML()

ilMD5295Entity::toXML ( $writer)

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

References getEntity().

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

◆ update()

ilMD5295Entity::update ( )

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

References $DIC, $ilDB, and ilMD5295Base\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: goto.php:24
global $ilDB
+ Here is the call graph for this function:

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