ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMDIdentifier_ Class Reference
+ Inheritance diagram for ilMDIdentifier_:
+ Collaboration diagram for ilMDIdentifier_:

Public Member Functions

 setCatalog ($a_catalog)
 
 getCatalog ()
 
 setEntry ($a_entry)
 
 getEntry ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setCatalog ($a_catalog)
 
 getCatalog ()
 
 setEntry ($a_entry)
 
 getEntry ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
- 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)
 

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

Member Function Documentation

◆ __getFields() [1/2]

ilMDIdentifier_::__getFields ( )

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

References array, getCatalog(), getEntry(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), and ilMDBase\getRBACId().

Referenced by save().

99  {
100  return array('rbac_id' => array('integer',$this->getRBACId()),
101  'obj_id' => array('integer',$this->getObjId()),
102  'obj_type' => array('text',$this->getObjType()),
103  'parent_type' => array('text',$this->getParentType()),
104  'parent_id' => array('integer',$this->getParentId()),
105  'catalog' => array('text',$this->getCatalog()),
106  'entry' => array('text',$this->getEntry()));
107  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDIdentifier_::__getFields ( )

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

References array, getCatalog(), getEntry(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

102  {
103  return array('rbac_id' => $this->getRBACId(),
104  'obj_id' => $this->getObjId(),
105  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
106  'parent_type' => $this->getParentType(),
107  'parent_id' => $this->getParentId(),
108  'catalog' => ilUtil::prepareDBString($this->getCatalog()),
109  'entry' => ilUtil::prepareDBString($this->getEntry()));
110  }
Create styles array
The data for the language used.
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ _getIds() [1/2]

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

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

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

Referenced by ilMDRelation\getIdentifier_Ids().

145  {
146  global $ilDB;
147 
148  $query = "SELECT meta_identifier__id FROM il_meta_identifier_ " .
149  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
150  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
151  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
152  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
153 
154 
155  $res = $ilDB->query($query);
156  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
157  $ids[] = $row->meta_identifier__id;
158  }
159  return $ids ? $ids : array();
160  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _getIds() [2/2]

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

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

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

148  {
149  global $ilDB;
150 
151  $query = "SELECT meta_identifier__id FROM il_meta_identifier_ " .
152  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
153  "AND obj_id = " . $ilDB->quote($a_obj_id) . " " .
154  "AND parent_id = " . $ilDB->quote($a_parent_id) . " " .
155  "AND parent_type = " . $ilDB->quote($a_parent_type);
156 
157 
158  $res = $ilDB->query($query);
159  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
160  $ids[] = $row->meta_identifier__id;
161  }
162  return $ids ? $ids : array();
163  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB

◆ delete() [1/2]

ilMDIdentifier_::delete ( )

Definition at line 84 of file class.ilMDIdentifier_.php.

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

85  {
86  global $ilDB;
87 
88  if ($this->getMetaId()) {
89  $query = "DELETE FROM il_meta_identifier_ " .
90  "WHERE meta_identifier__id = " . $ilDB->quote($this->getMetaId(), 'integer');
91  $res = $ilDB->manipulate($query);
92  return true;
93  }
94  return false;
95  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDIdentifier_::delete ( )

Definition at line 85 of file class.ilMDIdentifier_.php.

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

86  {
87  global $ilDB;
88 
89  if ($this->getMetaId()) {
90  $query = "DELETE FROM il_meta_identifier_ " .
91  "WHERE meta_identifier__id = " . $ilDB->quote($this->getMetaId());
92 
93  $this->db->query($query);
94 
95  return true;
96  }
97  return false;
98  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ getCatalog() [1/2]

ilMDIdentifier_::getCatalog ( )

Definition at line 40 of file class.ilMDIdentifier_.php.

Referenced by __getFields(), and toXML().

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

◆ getCatalog() [2/2]

ilMDIdentifier_::getCatalog ( )

Definition at line 40 of file class.ilMDIdentifier_.php.

41  {
42  return $this->catalog;
43  }

◆ getEntry() [1/2]

ilMDIdentifier_::getEntry ( )

Definition at line 48 of file class.ilMDIdentifier_.php.

Referenced by __getFields(), and toXML().

49  {
50  return $this->entry;
51  }
+ Here is the caller graph for this function:

◆ getEntry() [2/2]

ilMDIdentifier_::getEntry ( )

Definition at line 48 of file class.ilMDIdentifier_.php.

49  {
50  return $this->entry;
51  }

◆ read() [1/2]

ilMDIdentifier_::read ( )

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

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

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

◆ read() [2/2]

ilMDIdentifier_::read ( )

Definition at line 112 of file class.ilMDIdentifier_.php.

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

113  {
114  global $ilDB;
115 
116  if ($this->getMetaId()) {
117  $query = "SELECT * FROM il_meta_identifier_ " .
118  "WHERE meta_identifier__id = " . $ilDB->quote($this->getMetaId());
119 
120  $res = $this->db->query($query);
121  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
122  $this->setRBACId($row->rbac_id);
123  $this->setObjId($row->obj_id);
124  $this->setObjType($row->obj_type);
125  $this->setParentId($row->parent_id);
126  $this->setParentType($row->parent_type);
127  $this->setCatalog(ilUtil::stripSlashes($row->catalog));
128  $this->setEntry(ilUtil::stripSlashes($row->entry));
129  }
130  }
131  return true;
132  }
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)
global $ilDB
setParentType($a_parent_type)
+ Here is the call graph for this function:

◆ save() [1/2]

ilMDIdentifier_::save ( )

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

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

55  {
56  if ($this->db->autoExecute(
57  'il_meta_identifier_',
58  $this->__getFields(),
60  )) {
61  $this->setMetaId($this->db->getLastInsertId());
62 
63  return $this->getMetaId();
64  }
65  return false;
66  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/2]

ilMDIdentifier_::save ( )

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

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

55  {
56  global $ilDB;
57 
58  $fields = $this->__getFields();
59  $fields['meta_identifier__id'] = array('integer',$next_id = $ilDB->nextId('il_meta_identifier_'));
60 
61  if ($this->db->insert('il_meta_identifier_', $fields)) {
62  $this->setMetaId($next_id);
63  return $this->getMetaId();
64  }
65  return false;
66  }
setMetaId($a_meta_id, $a_read_data=true)
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ setCatalog() [1/2]

ilMDIdentifier_::setCatalog (   $a_catalog)

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

37  {
38  $this->catalog = $a_catalog;
39  }

◆ setCatalog() [2/2]

ilMDIdentifier_::setCatalog (   $a_catalog)

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

Referenced by read().

37  {
38  $this->catalog = $a_catalog;
39  }
+ Here is the caller graph for this function:

◆ setEntry() [1/2]

ilMDIdentifier_::setEntry (   $a_entry)

Definition at line 44 of file class.ilMDIdentifier_.php.

Referenced by read().

45  {
46  $this->entry = $a_entry;
47  }
+ Here is the caller graph for this function:

◆ setEntry() [2/2]

ilMDIdentifier_::setEntry (   $a_entry)

Definition at line 44 of file class.ilMDIdentifier_.php.

45  {
46  $this->entry = $a_entry;
47  }

◆ toXML() [1/2]

ilMDIdentifier_::toXML ( $writer)

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

References array, getCatalog(), and getEntry().

137  {
138  $writer->xmlElement('Identifier_', array('Catalog' => $this->getCatalog(),
139  'Entry' => $this->getEntry() ? $this->getEntry() : "ID1"));
140  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDIdentifier_::toXML ( $writer)

Definition at line 139 of file class.ilMDIdentifier_.php.

References array, getCatalog(), and getEntry().

140  {
141  $writer->xmlElement('Identifier_', array('Catalog' => $this->getCatalog(),
142  'Entry' => $this->getEntry()));
143  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ update() [1/2]

ilMDIdentifier_::update ( )

Definition at line 68 of file class.ilMDIdentifier_.php.

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

69  {
70  global $ilDB;
71 
72  if ($this->getMetaId()) {
73  if ($this->db->autoExecute(
74  'il_meta_identifier_',
75  $this->__getFields(),
77  "meta_identifier__id = " . $ilDB->quote($this->getMetaId())
78  )) {
79  return true;
80  }
81  }
82  return false;
83  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/2]

ilMDIdentifier_::update ( )

Definition at line 68 of file class.ilMDIdentifier_.php.

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

69  {
70  global $ilDB;
71 
72  if ($this->getMetaId()) {
73  if ($this->db->update(
74  'il_meta_identifier_',
75  $this->__getFields(),
76  array("meta_identifier__id" => array('integer',$this->getMetaId()))
77  )) {
78  return true;
79  }
80  }
81  return false;
82  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

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