ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 27 of file class.ilMDIdentifier_.php.

Member Function Documentation

◆ __getFields()

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

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

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

Referenced by save(), and update().

88  : array
89  {
90  return array(
91  'rbac_id' => array('integer', $this->getRBACId()),
92  'obj_id' => array('integer', $this->getObjId()),
93  'obj_type' => array('text', $this->getObjType()),
94  'parent_type' => array('text', $this->getParentType()),
95  'parent_id' => array('integer', $this->getParentId()),
96  'catalog' => array('text', $this->getCatalog()),
97  'entry' => array('text', $this->getEntry())
98  );
99  }
+ 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 134 of file class.ilMDIdentifier_.php.

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

Referenced by ilMDRelation\getIdentifier_Ids().

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

◆ delete()

ilMDIdentifier_::delete ( )

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

References $res, and ilMDBase\getMetaId().

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

◆ getCatalog()

ilMDIdentifier_::getCatalog ( )

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

References $catalog.

Referenced by __getFields(), and toXML().

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

◆ getEntry()

ilMDIdentifier_::getEntry ( )

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

References $entry.

Referenced by __getFields(), and toXML().

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

◆ read()

ilMDIdentifier_::read ( )

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

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

101  : bool
102  {
103  if ($this->getMetaId()) {
104  $query = "SELECT * FROM il_meta_identifier_ " .
105  "WHERE meta_identifier__id = " . $this->db->quote($this->getMetaId(), 'integer');
106 
107  $res = $this->db->query($query);
108  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
109  $this->setRBACId((int) $row->rbac_id);
110  $this->setObjId((int) $row->obj_id);
111  $this->setObjType($row->obj_type ?? '');
112  $this->setParentId((int) $row->parent_id);
113  $this->setParentType($row->parent_type);
114  $this->setCatalog($row->catalog ?? '');
115  $this->setEntry($row->entry ?? '');
116  }
117  }
118  return true;
119  }
$res
Definition: ltiservices.php:66
setRBACId(int $a_id)
setObjId(int $a_id)
setEntry(string $a_entry)
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 53 of file class.ilMDIdentifier_.php.

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

53  : int
54  {
55  $fields = $this->__getFields();
56  $fields['meta_identifier__id'] = array('integer', $next_id = $this->db->nextId('il_meta_identifier_'));
57 
58  if ($this->db->insert('il_meta_identifier_', $fields)) {
59  $this->setMetaId($next_id);
60  return $this->getMetaId();
61  }
62  return 0;
63  }
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 33 of file class.ilMDIdentifier_.php.

Referenced by read().

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

◆ setEntry()

ilMDIdentifier_::setEntry ( string  $a_entry)

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

Referenced by read().

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

◆ toXML()

ilMDIdentifier_::toXML ( ilXmlWriter  $writer)

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

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

121  : void
122  {
123  $writer->xmlElement('Identifier_', array(
124  'Catalog' => $this->getCatalog(),
125  'Entry' => $this->getEntry() ?: "ID1"
126  ));
127  }
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 65 of file class.ilMDIdentifier_.php.

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

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

Field Documentation

◆ $catalog

string ilMDIdentifier_::$catalog = ''
private

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

Referenced by getCatalog().

◆ $entry

string ilMDIdentifier_::$entry = ''
private

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

Referenced by getEntry().


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