ILIAS  release_8 Revision v8.24
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 26 of file class.ilMDLocation.php.

Member Function Documentation

◆ __getFields()

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

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

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 'location' => array('text', $this->getLocation()),
97 'location_type' => array('text', $this->getLocationType())
98 );
99 }

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

Referenced by save(), and update().

+ 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 137 of file class.ilMDLocation.php.

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

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

Referenced by ilMDTechnical\getLocationIds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilMDLocation::delete ( )

Reimplemented from ilMDBase.

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

73 : bool
74 {
75 if ($this->getMetaId()) {
76 $query = "DELETE FROM il_meta_location " .
77 "WHERE meta_location_id = " . $this->db->quote($this->getMetaId(), 'integer');
78 $res = $this->db->manipulate($query);
79
80 return true;
81 }
82 return false;
83 }

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

+ Here is the call graph for this function:

◆ getLocation()

ilMDLocation::getLocation ( )

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

37 : string
38 {
39 return $this->location;
40 }

References $location.

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getLocationType()

ilMDLocation::getLocationType ( )

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

47 : string
48 {
50 }

References $location_type.

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ read()

ilMDLocation::read ( )

Reimplemented from ilMDBase.

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

101 : bool
102 {
103 if ($this->getMetaId()) {
104 $query = "SELECT * FROM il_meta_location " .
105 "WHERE meta_location_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->setLocation($row->location ?? '');
115 $this->setLocationType($row->location_type ?? '');
116 }
117 }
118 return true;
119 }
setObjType(string $a_type)
setParentType(string $a_parent_type)
setObjId(int $a_id)
setRBACId(int $a_id)
setParentId(int $a_id)
setLocation(string $a_location)
setLocationType(string $a_location_type)

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

+ Here is the call graph for this function:

◆ save()

ilMDLocation::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

◆ setLocation()

ilMDLocation::setLocation ( string  $a_location)

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

32 : void
33 {
34 $this->location = $a_location;
35 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLocationType()

ilMDLocation::setLocationType ( string  $a_location_type)

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

42 : void
43 {
44 $this->location_type = $a_location_type;
45 }

Referenced by read().

+ Here is the caller graph for this function:

◆ toXML()

ilMDLocation::toXML ( ilXmlWriter  $writer)

Reimplemented from ilMDBase.

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

121 : void
122 {
123 $writer->xmlElement(
124 'Location',
125 array(
126 'Type' => $this->getLocationType() ?: 'LocalFile'
127 ),
128 $this->getLocation()
129 );
130 }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)

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

+ Here is the call graph for this function:

◆ update()

ilMDLocation::update ( )

Reimplemented from ilMDBase.

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

64 : bool
65 {
66 return $this->getMetaId() && $this->db->update(
67 'il_meta_location',
68 $this->__getFields(),
69 array("meta_location_id" => array('integer', $this->getMetaId()))
70 );
71 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $location

string ilMDLocation::$location = ''
private

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

Referenced by getLocation().

◆ $location_type

string ilMDLocation::$location_type = ''
private

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

Referenced by getLocationType().


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