ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMDLocation Class Reference
+ Inheritance diagram for ilMDLocation:
+ Collaboration diagram for ilMDLocation:

Public Member Functions

 setLocation (string $a_location)
 
 getLocation ()
 
 setLocationType (string $a_location_type)
 
 getLocationType ()
 
 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 $location = ''
 
string $location_type = ''
 

Additional Inherited Members

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

Detailed Description

Definition at line 27 of file class.ilMDLocation.php.

Member Function Documentation

◆ __getFields()

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

Definition at line 89 of file class.ilMDLocation.php.

References getLocation(), getLocationType(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), and ilMDBase\getRBACId().

Referenced by save(), and update().

89  : array
90  {
91  return array(
92  'rbac_id' => array('integer', $this->getRBACId()),
93  'obj_id' => array('integer', $this->getObjId()),
94  'obj_type' => array('text', $this->getObjType()),
95  'parent_type' => array('text', $this->getParentType()),
96  'parent_id' => array('integer', $this->getParentId()),
97  'location' => array('text', $this->getLocation()),
98  'location_type' => array('text', $this->getLocationType())
99  );
100  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIds()

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

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

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

Referenced by ilMDTechnical\getLocationIds().

138  : array
139  {
140  global $DIC;
141 
142  $ilDB = $DIC->database();
143 
144  $query = "SELECT meta_location_id FROM il_meta_location " .
145  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
146  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
147  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
148  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
149 
150  $res = $ilDB->query($query);
151  $ids = [];
152  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
153  $ids[] = (int) $row->meta_location_id;
154  }
155  return $ids;
156  }
$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()

ilMDLocation::delete ( )

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

References $res, and ilMDBase\getMetaId().

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

◆ getLocation()

ilMDLocation::getLocation ( )

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

References $location.

Referenced by __getFields(), and toXML().

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

◆ getLocationType()

ilMDLocation::getLocationType ( )

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

References $location_type.

Referenced by __getFields(), and toXML().

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

◆ read()

ilMDLocation::read ( )

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

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

102  : bool
103  {
104  if ($this->getMetaId()) {
105  $query = "SELECT * FROM il_meta_location " .
106  "WHERE meta_location_id = " . $this->db->quote($this->getMetaId(), 'integer');
107 
108  $res = $this->db->query($query);
109  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
110  $this->setRBACId((int) $row->rbac_id);
111  $this->setObjId((int) $row->obj_id);
112  $this->setObjType($row->obj_type ?? '');
113  $this->setParentId((int) $row->parent_id);
114  $this->setParentType($row->parent_type);
115  $this->setLocation($row->location ?? '');
116  $this->setLocationType($row->location_type ?? '');
117  }
118  }
119  return true;
120  }
$res
Definition: ltiservices.php:66
setLocationType(string $a_location_type)
setRBACId(int $a_id)
setObjId(int $a_id)
setParentId(int $a_id)
setParentType(string $a_parent_type)
setObjType(string $a_type)
setLocation(string $a_location)
+ Here is the call graph for this function:

◆ save()

ilMDLocation::save ( )

Definition at line 53 of file class.ilMDLocation.php.

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

53  : int
54  {
55  $fields = $this->__getFields();
56  $fields['meta_location_id'] = array('integer', $next_id = $this->db->nextId('il_meta_location'));
57 
58  if ($this->db->insert('il_meta_location', $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:

◆ setLocation()

ilMDLocation::setLocation ( string  $a_location)

Definition at line 33 of file class.ilMDLocation.php.

Referenced by read().

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

◆ setLocationType()

ilMDLocation::setLocationType ( string  $a_location_type)

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

Referenced by read().

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

◆ toXML()

ilMDLocation::toXML ( ilXmlWriter  $writer)

Definition at line 122 of file class.ilMDLocation.php.

References getLocation(), getLocationType(), and ilXmlWriter\xmlElement().

122  : void
123  {
124  $writer->xmlElement(
125  'Location',
126  array(
127  'Type' => $this->getLocationType() ?: 'LocalFile'
128  ),
129  $this->getLocation()
130  );
131  }
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()

ilMDLocation::update ( )

Definition at line 65 of file class.ilMDLocation.php.

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

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

Field Documentation

◆ $location

string ilMDLocation::$location = ''
private

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

Referenced by getLocation().

◆ $location_type

string ilMDLocation::$location_type = ''
private

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

Referenced by getLocationType().


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