ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMDIdentifier_ Class Reference
+ Inheritance diagram for ilMDIdentifier_:
+ Collaboration diagram for ilMDIdentifier_:

Public Member Functions

 setCatalog (string $a_catalog)
 
 getCatalog ()
 
 setEntry (string $a_entry)
 
 getEntry ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (ilXmlWriter $writer)
 
- Public Member Functions inherited from ilMDBase
 __construct (int $a_rbac_id=0, int $a_obj_id=0, string $a_type='')
 constructor More...
 
 read ()
 
 setRBACId (int $a_id)
 
 getRBACId ()
 
 setObjId (int $a_id)
 
 getObjId ()
 
 setObjType (string $a_type)
 
 getObjType ()
 
 setMetaId (int $a_meta_id, bool $a_read_data=true)
 
 getMetaId ()
 
 setParentType (string $a_parent_type)
 
 getParentType ()
 
 setParentId (int $a_id)
 
 getParentId ()
 
 setExportMode (bool $a_export_mode=true)
 
 getExportMode ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (ilXmlWriter $writer)
 

Static Public Member Functions

static _getIds (int $a_rbac_id, int $a_obj_id, int $a_parent_id, string $a_parent_type)
 

Private Attributes

string $catalog = ''
 
string $entry = ''
 

Additional Inherited Members

- Protected Attributes inherited from ilMDBase
ilLogger $log
 
ilDBInterface $db
 

Detailed Description

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

Member Function Documentation

◆ __getFields()

ilMDIdentifier_::__getFields ( )
Returns
array<string, array<string, mixed>>

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

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

Referenced by save(), and update().

87  : array
88  {
89  return array(
90  'rbac_id' => array('integer', $this->getRBACId()),
91  'obj_id' => array('integer', $this->getObjId()),
92  'obj_type' => array('text', $this->getObjType()),
93  'parent_type' => array('text', $this->getParentType()),
94  'parent_id' => array('integer', $this->getParentId()),
95  'catalog' => array('text', $this->getCatalog()),
96  'entry' => array('text', $this->getEntry())
97  );
98  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIds()

static ilMDIdentifier_::_getIds ( int  $a_rbac_id,
int  $a_obj_id,
int  $a_parent_id,
string  $a_parent_type 
)
static
Returns
int[]

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilMDRelation\getIdentifier_Ids().

133  : array
134  {
135  global $DIC;
136 
137  $ilDB = $DIC->database();
138 
139  $query = "SELECT meta_identifier__id FROM il_meta_identifier_ " .
140  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
141  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
142  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
143  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
144 
145  $res = $ilDB->query($query);
146  $ids = [];
147  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
148  $ids[] = (int) $row->meta_identifier__id;
149  }
150  return $ids;
151  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilMDIdentifier_::delete ( )

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

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

73  : bool
74  {
75  if ($this->getMetaId()) {
76  $query = "DELETE FROM il_meta_identifier_ " .
77  "WHERE meta_identifier__id = " . $this->db->quote($this->getMetaId(), 'integer');
78  $res = $this->db->manipulate($query);
79  return true;
80  }
81  return false;
82  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

◆ getCatalog()

ilMDIdentifier_::getCatalog ( )

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

References $catalog.

Referenced by __getFields(), and toXML().

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

◆ getEntry()

ilMDIdentifier_::getEntry ( )

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

References $entry.

Referenced by __getFields(), and toXML().

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

◆ read()

ilMDIdentifier_::read ( )

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

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

100  : bool
101  {
102  if ($this->getMetaId()) {
103  $query = "SELECT * FROM il_meta_identifier_ " .
104  "WHERE meta_identifier__id = " . $this->db->quote($this->getMetaId(), 'integer');
105 
106  $res = $this->db->query($query);
107  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
108  $this->setRBACId((int) $row->rbac_id);
109  $this->setObjId((int) $row->obj_id);
110  $this->setObjType($row->obj_type);
111  $this->setParentId((int) $row->parent_id);
112  $this->setParentType($row->parent_type);
113  $this->setCatalog($row->catalog ?? '');
114  $this->setEntry($row->entry ?? '');
115  }
116  }
117  return true;
118  }
$res
Definition: ltiservices.php:69
setRBACId(int $a_id)
setObjId(int $a_id)
setEntry(string $a_entry)
$query
setParentId(int $a_id)
setCatalog(string $a_catalog)
setParentType(string $a_parent_type)
setObjType(string $a_type)
+ Here is the call graph for this function:

◆ save()

ilMDIdentifier_::save ( )

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

References __getFields(), ilMDBase\getMetaId(), and ilMDBase\setMetaId().

52  : int
53  {
54  $fields = $this->__getFields();
55  $fields['meta_identifier__id'] = array('integer', $next_id = $this->db->nextId('il_meta_identifier_'));
56 
57  if ($this->db->insert('il_meta_identifier_', $fields)) {
58  $this->setMetaId($next_id);
59  return $this->getMetaId();
60  }
61  return 0;
62  }
setMetaId(int $a_meta_id, bool $a_read_data=true)
+ Here is the call graph for this function:

◆ setCatalog()

ilMDIdentifier_::setCatalog ( string  $a_catalog)

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

Referenced by read().

32  : void
33  {
34  $this->catalog = $a_catalog;
35  }
+ Here is the caller graph for this function:

◆ setEntry()

ilMDIdentifier_::setEntry ( string  $a_entry)

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

Referenced by read().

42  : void
43  {
44  $this->entry = $a_entry;
45  }
+ Here is the caller graph for this function:

◆ toXML()

ilMDIdentifier_::toXML ( ilXmlWriter  $writer)

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

References getCatalog(), getEntry(), and ilXmlWriter\xmlElement().

120  : void
121  {
122  $writer->xmlElement('Identifier_', array(
123  'Catalog' => $this->getCatalog(),
124  'Entry' => $this->getEntry() ?: "ID1"
125  ));
126  }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

◆ update()

ilMDIdentifier_::update ( )

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

References __getFields(), and ilMDBase\getMetaId().

64  : bool
65  {
66  return $this->getMetaId() && $this->db->update(
67  'il_meta_identifier_',
68  $this->__getFields(),
69  array("meta_identifier__id" => array('integer', $this->getMetaId()))
70  );
71  }
+ Here is the call graph for this function:

Field Documentation

◆ $catalog

string ilMDIdentifier_::$catalog = ''
private

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

Referenced by getCatalog().

◆ $entry

string ilMDIdentifier_::$entry = ''
private

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

Referenced by getEntry().


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