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

Public Member Functions

getEntityIds ()
 
getEntity ($a_entity_id)
 
addEntity ()
 
 setRole ($a_role)
 
 getRole ()
 
 setDate ($a_date)
 
 getDate ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
getEntityIds ()
 
getEntity ($a_entity_id)
 
addEntity ()
 
 setRole ($a_role)
 
 getRole ()
 
 setDate ($a_date)
 
 getDate ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
getEntityIds ()
 
getEntity ($a_entity_id)
 
addEntity ()
 
 setRole ($a_role)
 
 getRole ()
 
 setDate ($a_date)
 
 getDate ()
 
 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 _lookupAuthors ($a_rbac_id, $a_obj_id, $a_obj_type)
 Lookup authors. More...
 
static _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
static _lookupAuthors ($a_rbac_id, $a_obj_id, $a_obj_type)
 Lookup authors. More...
 

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.ilMDContribute.php.

Member Function Documentation

◆ __getFields() [1/3]

ilMDContribute::__getFields ( )

Definition at line 158 of file class.ilMDContribute.php.

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

159  {
160  return array('rbac_id' => $this->getRBACId(),
161  'obj_id' => $this->getObjId(),
162  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
163  'parent_type' => $this->getParentType(),
164  'parent_id' => $this->getParentId(),
165  'role' => ilUtil::prepareDBString($this->getRole()),
166  'date' => ilUtil::prepareDBString($this->getDate()));
167  }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ __getFields() [2/3]

ilMDContribute::__getFields ( )

Definition at line 163 of file class.ilMDContribute.php.

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

164  {
165  return array('rbac_id' => array('integer',$this->getRBACId()),
166  'obj_id' => array('integer',$this->getObjId()),
167  'obj_type' => array('text',$this->getObjType()),
168  'parent_type' => array('text',$this->getParentType()),
169  'parent_id' => array('integer',$this->getParentId()),
170  'role' => array('text',$this->getRole()),
171  'c_date' => array('text',$this->getDate()));
172  }
+ Here is the call graph for this function:

◆ __getFields() [3/3]

ilMDContribute::__getFields ( )

Definition at line 163 of file class.ilMDContribute.php.

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

Referenced by save().

164  {
165  return array('rbac_id' => array('integer',$this->getRBACId()),
166  'obj_id' => array('integer',$this->getObjId()),
167  'obj_type' => array('text',$this->getObjType()),
168  'parent_type' => array('text',$this->getParentType()),
169  'parent_id' => array('integer',$this->getParentId()),
170  'role' => array('text',$this->getRole()),
171  'c_date' => array('text',$this->getDate()));
172  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIds() [1/3]

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

Definition at line 213 of file class.ilMDContribute.php.

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

214  {
215  global $ilDB;
216 
217  $query = "SELECT meta_contribute_id FROM il_meta_contribute " .
218  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
219  "AND obj_id = " . $ilDB->quote($a_obj_id) . " " .
220  "AND parent_id = " . $ilDB->quote($a_parent_id) . " " .
221  "AND parent_type = " . $ilDB->quote($a_parent_type);
222 
223  $res = $ilDB->query($query);
224  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
225  $ids[] = $row->meta_contribute_id;
226  }
227  return $ids ? $ids : array();
228  }
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getIds() [2/3]

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

Definition at line 229 of file class.ilMDContribute.php.

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

230  {
231  global $DIC;
232 
233  $ilDB = $DIC['ilDB'];
234 
235  $query = "SELECT meta_contribute_id FROM il_meta_contribute " .
236  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
237  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
238  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
239  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
240 
241  $res = $ilDB->query($query);
242  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
243  $ids[] = $row->meta_contribute_id;
244  }
245  return $ids ? $ids : array();
246  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getIds() [3/3]

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

Definition at line 229 of file class.ilMDContribute.php.

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

Referenced by ilMDLifecycle\getContributeIds(), and ilMDMetaMetadata\getContributeIds().

230  {
231  global $DIC;
232 
233  $ilDB = $DIC['ilDB'];
234 
235  $query = "SELECT meta_contribute_id FROM il_meta_contribute " .
236  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
237  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
238  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
239  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
240 
241  $res = $ilDB->query($query);
242  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
243  $ids[] = $row->meta_contribute_id;
244  }
245  return $ids ? $ids : array();
246  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupAuthors() [1/2]

static ilMDContribute::_lookupAuthors (   $a_rbac_id,
  $a_obj_id,
  $a_obj_type 
)
static

Lookup authors.

public

Parameters
intrbac_id
intobj_id
stringobj_type
Returns
array string authors

Definition at line 259 of file class.ilMDContribute.php.

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

260  {
261  global $DIC;
262 
263  $ilDB = $DIC['ilDB'];
264 
265  // Ask for 'author' later to use indexes
266  $query = "SELECT entity,ent.parent_type,role FROM il_meta_entity ent " .
267  "JOIN il_meta_contribute con ON ent.parent_id = con.meta_contribute_id " .
268  "WHERE ent.rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
269  "AND ent.obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
270  $res = $ilDB->query($query);
271  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
272  if ($row->role == 'Author' and $row->parent_type == 'meta_contribute') {
273  $authors[] = trim($row->entity);
274  }
275  }
276  return $authors ? $authors : array();
277  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _lookupAuthors() [2/2]

static ilMDContribute::_lookupAuthors (   $a_rbac_id,
  $a_obj_id,
  $a_obj_type 
)
static

Lookup authors.

public

Parameters
intrbac_id
intobj_id
stringobj_type
Returns
array string authors

Definition at line 259 of file class.ilMDContribute.php.

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

Referenced by ilMDUtils\_fillHTMLMetaTags().

260  {
261  global $DIC;
262 
263  $ilDB = $DIC['ilDB'];
264 
265  // Ask for 'author' later to use indexes
266  $query = "SELECT entity,ent.parent_type,role FROM il_meta_entity ent " .
267  "JOIN il_meta_contribute con ON ent.parent_id = con.meta_contribute_id " .
268  "WHERE ent.rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
269  "AND ent.obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
270  $res = $ilDB->query($query);
271  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
272  if ($row->role == 'Author' and $row->parent_type == 'meta_contribute') {
273  $authors[] = trim($row->entity);
274  }
275  }
276  return $authors ? $authors : array();
277  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ addEntity() [1/3]

& ilMDContribute::addEntity ( )

Definition at line 55 of file class.ilMDContribute.php.

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

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

◆ addEntity() [2/3]

& ilMDContribute::addEntity ( )

Definition at line 55 of file class.ilMDContribute.php.

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

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

◆ addEntity() [3/3]

& ilMDContribute::addEntity ( )

Definition at line 55 of file class.ilMDContribute.php.

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

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

◆ delete() [1/3]

ilMDContribute::delete ( )

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

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

139  {
140  global $ilDB;
141 
142  if ($this->getMetaId()) {
143  $query = "DELETE FROM il_meta_contribute " .
144  "WHERE meta_contribute_id = " . $ilDB->quote($this->getMetaId());
145 
146  $this->db->query($query);
147 
148  foreach ($this->getEntityIds() as $id) {
149  $ent = &$this->getEntity($id);
150  $ent->delete();
151  }
152  return true;
153  }
154  return false;
155  }
& getEntity($a_entity_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [2/3]

ilMDContribute::delete ( )

Definition at line 142 of file class.ilMDContribute.php.

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

143  {
144  global $DIC;
145 
146  $ilDB = $DIC['ilDB'];
147 
148  if ($this->getMetaId()) {
149  $query = "DELETE FROM il_meta_contribute " .
150  "WHERE meta_contribute_id = " . $ilDB->quote($this->getMetaId(), 'integer');
151  $res = $ilDB->manipulate($query);
152 
153  foreach ($this->getEntityIds() as $id) {
154  $ent = $this->getEntity($id);
155  $ent->delete();
156  }
157  return true;
158  }
159  return false;
160  }
global $DIC
Definition: saml.php:7
& getEntity($a_entity_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDContribute::delete ( )

Definition at line 142 of file class.ilMDContribute.php.

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

143  {
144  global $DIC;
145 
146  $ilDB = $DIC['ilDB'];
147 
148  if ($this->getMetaId()) {
149  $query = "DELETE FROM il_meta_contribute " .
150  "WHERE meta_contribute_id = " . $ilDB->quote($this->getMetaId(), 'integer');
151  $res = $ilDB->manipulate($query);
152 
153  foreach ($this->getEntityIds() as $id) {
154  $ent = $this->getEntity($id);
155  $ent->delete();
156  }
157  return true;
158  }
159  return false;
160  }
global $DIC
Definition: saml.php:7
& getEntity($a_entity_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ getDate() [1/3]

ilMDContribute::getDate ( )

Definition at line 101 of file class.ilMDContribute.php.

102  {
103  return $this->date;
104  }

◆ getDate() [2/3]

ilMDContribute::getDate ( )

Definition at line 102 of file class.ilMDContribute.php.

103  {
104  return $this->date;
105  }

◆ getDate() [3/3]

ilMDContribute::getDate ( )

Definition at line 102 of file class.ilMDContribute.php.

Referenced by __getFields(), and toXML().

103  {
104  return $this->date;
105  }
+ Here is the caller graph for this function:

◆ getEntity() [1/3]

& ilMDContribute::getEntity (   $a_entity_id)

Definition at line 43 of file class.ilMDContribute.php.

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

◆ getEntity() [2/3]

& ilMDContribute::getEntity (   $a_entity_id)

Definition at line 43 of file class.ilMDContribute.php.

Referenced by delete(), and toXML().

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

◆ getEntity() [3/3]

& ilMDContribute::getEntity (   $a_entity_id)

Definition at line 43 of file class.ilMDContribute.php.

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

◆ getEntityIds() [1/3]

& ilMDContribute::getEntityIds ( )

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

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

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

◆ getEntityIds() [2/3]

& ilMDContribute::getEntityIds ( )

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

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

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

◆ getEntityIds() [3/3]

& ilMDContribute::getEntityIds ( )

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

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

Referenced by delete(), and toXML().

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

◆ getRole() [1/3]

ilMDContribute::getRole ( )

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

94  {
95  return $this->role;
96  }

◆ getRole() [2/3]

ilMDContribute::getRole ( )

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

95  {
96  return $this->role;
97  }

◆ getRole() [3/3]

ilMDContribute::getRole ( )

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

Referenced by __getFields(), and toXML().

95  {
96  return $this->role;
97  }
+ Here is the caller graph for this function:

◆ read() [1/3]

ilMDContribute::read ( )

Definition at line 169 of file class.ilMDContribute.php.

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

170  {
171  global $ilDB;
172 
173  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
174 
175  if ($this->getMetaId()) {
176  $query = "SELECT * FROM il_meta_contribute " .
177  "WHERE meta_contribute_id = " . $ilDB->quote($this->getMetaId());
178 
179  $res = $this->db->query($query);
180  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
181  $this->setRBACId($row->rbac_id);
182  $this->setObjId($row->obj_id);
183  $this->setObjType($row->obj_type);
184  $this->setParentId($row->parent_id);
185  $this->setParentType($row->parent_type);
186  $this->setRole(ilUtil::stripSlashes($row->role));
187  $this->setDate(ilUtil::stripSlashes($row->date));
188  }
189  }
190  return true;
191  }
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)
+ Here is the call graph for this function:

◆ read() [2/3]

ilMDContribute::read ( )

Definition at line 174 of file class.ilMDContribute.php.

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

175  {
176  global $DIC;
177 
178  $ilDB = $DIC['ilDB'];
179 
180  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
181 
182  if ($this->getMetaId()) {
183  $query = "SELECT * FROM il_meta_contribute " .
184  "WHERE meta_contribute_id = " . $ilDB->quote($this->getMetaId(), 'integer');
185 
186  $res = $this->db->query($query);
187  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
188  $this->setRBACId($row->rbac_id);
189  $this->setObjId($row->obj_id);
190  $this->setObjType($row->obj_type);
191  $this->setParentId($row->parent_id);
192  $this->setParentType($row->parent_type);
193  $this->setRole($row->role);
194  $this->setDate($row->c_date);
195  }
196  }
197  return true;
198  }
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)
+ Here is the call graph for this function:

◆ read() [3/3]

ilMDContribute::read ( )

Definition at line 174 of file class.ilMDContribute.php.

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

175  {
176  global $DIC;
177 
178  $ilDB = $DIC['ilDB'];
179 
180  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
181 
182  if ($this->getMetaId()) {
183  $query = "SELECT * FROM il_meta_contribute " .
184  "WHERE meta_contribute_id = " . $ilDB->quote($this->getMetaId(), 'integer');
185 
186  $res = $this->db->query($query);
187  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
188  $this->setRBACId($row->rbac_id);
189  $this->setObjId($row->obj_id);
190  $this->setObjType($row->obj_type);
191  $this->setParentId($row->parent_id);
192  $this->setParentType($row->parent_type);
193  $this->setRole($row->role);
194  $this->setDate($row->c_date);
195  }
196  }
197  return true;
198  }
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)
+ Here is the call graph for this function:

◆ save() [1/3]

ilMDContribute::save ( )

Definition at line 107 of file class.ilMDContribute.php.

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

108  {
109  if ($this->db->autoExecute(
110  'il_meta_contribute',
111  $this->__getFields(),
113  )) {
114  $this->setMetaId($this->db->getLastInsertId());
115 
116  return $this->getMetaId();
117  }
118  return false;
119  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/3]

ilMDContribute::save ( )

Definition at line 108 of file class.ilMDContribute.php.

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

109  {
110  global $DIC;
111 
112  $ilDB = $DIC['ilDB'];
113 
114  $fields = $this->__getFields();
115  $fields['meta_contribute_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_contribute'));
116 
117  if ($this->db->insert('il_meta_contribute', $fields)) {
118  $this->setMetaId($next_id);
119  return $this->getMetaId();
120  }
121  return false;
122  }
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]

ilMDContribute::save ( )

Definition at line 108 of file class.ilMDContribute.php.

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

109  {
110  global $DIC;
111 
112  $ilDB = $DIC['ilDB'];
113 
114  $fields = $this->__getFields();
115  $fields['meta_contribute_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_contribute'));
116 
117  if ($this->db->insert('il_meta_contribute', $fields)) {
118  $this->setMetaId($next_id);
119  return $this->getMetaId();
120  }
121  return false;
122  }
global $DIC
Definition: saml.php:7
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ setDate() [1/3]

ilMDContribute::setDate (   $a_date)

Definition at line 97 of file class.ilMDContribute.php.

98  {
99  $this->date = $a_date;
100  }

◆ setDate() [2/3]

ilMDContribute::setDate (   $a_date)

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

99  {
100  $this->date = $a_date;
101  }

◆ setDate() [3/3]

ilMDContribute::setDate (   $a_date)

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

Referenced by read().

99  {
100  $this->date = $a_date;
101  }
+ Here is the caller graph for this function:

◆ setRole() [1/3]

ilMDContribute::setRole (   $a_role)

Definition at line 67 of file class.ilMDContribute.php.

68  {
69  switch ($a_role) {
70  case 'Author':
71  case 'Publisher':
72  case 'Unknown':
73  case 'Initiator':
74  case 'Terminator':
75  case 'Editor':
76  case 'GraphicalDesigner':
77  case 'TechnicalImplementer':
78  case 'ContentProvider':
79  case 'TechnicalValidator':
80  case 'EducationalValidator':
81  case 'ScriptWriter':
82  case 'InstructionalDesigner':
83  case 'SubjectMatterExpert':
84  case 'Creator':
85  case 'Validator':
86  $this->role = $a_role;
87  return true;
88 
89  default:
90  return false;
91  }
92  }

◆ setRole() [2/3]

ilMDContribute::setRole (   $a_role)

Definition at line 67 of file class.ilMDContribute.php.

Referenced by read().

68  {
69  switch ($a_role) {
70  case 'Author':
71  case 'Publisher':
72  case 'Unknown':
73  case 'Initiator':
74  case 'Terminator':
75  case 'Editor':
76  case 'GraphicalDesigner':
77  case 'TechnicalImplementer':
78  case 'ContentProvider':
79  case 'TechnicalValidator':
80  case 'EducationalValidator':
81  case 'ScriptWriter':
82  case 'InstructionalDesigner':
83  case 'SubjectMatterExpert':
84  case 'Creator':
85  case 'Validator':
86  case 'PointOfContact':
87  $this->role = $a_role;
88  return true;
89 
90  default:
91  return false;
92  }
93  }
+ Here is the caller graph for this function:

◆ setRole() [3/3]

ilMDContribute::setRole (   $a_role)

Definition at line 67 of file class.ilMDContribute.php.

68  {
69  switch ($a_role) {
70  case 'Author':
71  case 'Publisher':
72  case 'Unknown':
73  case 'Initiator':
74  case 'Terminator':
75  case 'Editor':
76  case 'GraphicalDesigner':
77  case 'TechnicalImplementer':
78  case 'ContentProvider':
79  case 'TechnicalValidator':
80  case 'EducationalValidator':
81  case 'ScriptWriter':
82  case 'InstructionalDesigner':
83  case 'SubjectMatterExpert':
84  case 'Creator':
85  case 'Validator':
86  case 'PointOfContact':
87  $this->role = $a_role;
88  return true;
89 
90  default:
91  return false;
92  }
93  }

◆ toXML() [1/3]

ilMDContribute::toXML ( $writer)

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

References $id, getDate(), getEntity(), getEntityIds(), and getRole().

199  {
200  $writer->xmlStartTag('Contribute', array('Role' => $this->getRole()));
201 
202  // Entities
203  foreach ($this->getEntityIds() as $id) {
204  $ent = &$this->getEntity($id);
205  $ent->toXML($writer);
206  }
207  $writer->xmlElement('Date', null, $this->getDate());
208  $writer->xmlEndTag('Contribute');
209  }
& getEntity($a_entity_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the call graph for this function:

◆ toXML() [2/3]

ilMDContribute::toXML ( $writer)

Definition at line 205 of file class.ilMDContribute.php.

References $id, getDate(), getEntity(), getEntityIds(), ilMDBase\getObjId(), ilMDBase\getRBACId(), and getRole().

206  {
207  $writer->xmlStartTag('Contribute', array('Role' => $this->getRole()
208  ? $this->getRole()
209  : 'Author'));
210 
211  // Entities
212  $entities = $this->getEntityIds();
213  foreach ($entities as $id) {
214  $ent = &$this->getEntity($id);
215  $ent->toXML($writer);
216  }
217  if (!count($entities)) {
218  include_once 'Services/MetaData/classes/class.ilMDEntity.php';
219  $ent = new ilMDEntity($this->getRBACId(), $this->getObjId());
220  $ent->toXML($writer);
221  }
222 
223  $writer->xmlElement('Date', null, $this->getDate());
224  $writer->xmlEndTag('Contribute');
225  }
& getEntity($a_entity_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the call graph for this function:

◆ toXML() [3/3]

ilMDContribute::toXML ( $writer)

Definition at line 205 of file class.ilMDContribute.php.

References $id, getDate(), getEntity(), getEntityIds(), ilMDBase\getObjId(), ilMDBase\getRBACId(), and getRole().

206  {
207  $writer->xmlStartTag('Contribute', array('Role' => $this->getRole()
208  ? $this->getRole()
209  : 'Author'));
210 
211  // Entities
212  $entities = $this->getEntityIds();
213  foreach ($entities as $id) {
214  $ent = &$this->getEntity($id);
215  $ent->toXML($writer);
216  }
217  if (!count($entities)) {
218  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDEntity.php';
219  $ent = new ilMDEntity($this->getRBACId(), $this->getObjId());
220  $ent->toXML($writer);
221  }
222 
223  $writer->xmlElement('Date', null, $this->getDate());
224  $writer->xmlEndTag('Contribute');
225  }
& getEntity($a_entity_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the call graph for this function:

◆ update() [1/3]

ilMDContribute::update ( )

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

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

122  {
123  global $ilDB;
124 
125  if ($this->getMetaId()) {
126  if ($this->db->autoExecute(
127  'il_meta_contribute',
128  $this->__getFields(),
130  "meta_contribute_id = " . $ilDB->quote($this->getMetaId())
131  )) {
132  return true;
133  }
134  }
135  return false;
136  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/3]

ilMDContribute::update ( )

Definition at line 124 of file class.ilMDContribute.php.

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

125  {
126  global $DIC;
127 
128  $ilDB = $DIC['ilDB'];
129 
130  if ($this->getMetaId()) {
131  if ($this->db->update(
132  'il_meta_contribute',
133  $this->__getFields(),
134  array("meta_contribute_id" => array('integer',$this->getMetaId()))
135  )) {
136  return true;
137  }
138  }
139  return false;
140  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ update() [3/3]

ilMDContribute::update ( )

Definition at line 124 of file class.ilMDContribute.php.

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

125  {
126  global $DIC;
127 
128  $ilDB = $DIC['ilDB'];
129 
130  if ($this->getMetaId()) {
131  if ($this->db->update(
132  'il_meta_contribute',
133  $this->__getFields(),
134  array("meta_contribute_id" => array('integer',$this->getMetaId()))
135  )) {
136  return true;
137  }
138  }
139  return false;
140  }
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: