ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMDLocation Class Reference
+ Inheritance diagram for ilMDLocation:
+ Collaboration diagram for ilMDLocation:

Public Member Functions

 setLocation ($a_location)
 
 getLocation ()
 
 setLocationType ($a_location_type)
 
 getLocationType ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 setLocation ($a_location)
 
 getLocation ()
 
 setLocationType ($a_location_type)
 
 getLocationType ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
 setLocation ($a_location)
 
 getLocation ()
 
 setLocationType ($a_location_type)
 
 getLocationType ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
- 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)
 
 __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)
 

Static Public Member Functions

static _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 
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.ilMDLocation.php.

Member Function Documentation

◆ __getFields() [1/3]

ilMDLocation::__getFields ( )

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

105 {
106 return array('rbac_id' => array('integer',$this->getRBACId()),
107 'obj_id' => array('integer',$this->getObjId()),
108 'obj_type' => array('text',$this->getObjType()),
109 'parent_type' => array('text',$this->getParentType()),
110 'parent_id' => array('integer',$this->getParentId()),
111 'location' => array('text',$this->getLocation()),
112 'location_type' => array('text',$this->getLocationType()));
113 }

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

Referenced by save().

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

◆ __getFields() [2/3]

ilMDLocation::__getFields ( )

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

101 {
102 return array('rbac_id' => $this->getRBACId(),
103 'obj_id' => $this->getObjId(),
104 'obj_type' => ilUtil::prepareDBString($this->getObjType()),
105 'parent_type' => $this->getParentType(),
106 'parent_id' => $this->getParentId(),
107 'location' => ilUtil::prepareDBString($this->getLocation()),
108 'location_type' => ilUtil::prepareDBString($this->getLocationType()));
109 }
static prepareDBString($a_str)
prepare a string for db writing (insert/update)

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

+ Here is the call graph for this function:

◆ __getFields() [3/3]

ilMDLocation::__getFields ( )

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

105 {
106 return array('rbac_id' => array('integer',$this->getRBACId()),
107 'obj_id' => array('integer',$this->getObjId()),
108 'obj_type' => array('text',$this->getObjType()),
109 'parent_type' => array('text',$this->getParentType()),
110 'parent_id' => array('integer',$this->getParentId()),
111 'location' => array('text',$this->getLocation()),
112 'location_type' => array('text',$this->getLocationType()));
113 }

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

+ Here is the call graph for this function:

◆ _getIds() [1/3]

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

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

160 {
161 global $DIC;
162
163 $ilDB = $DIC['ilDB'];
164
165 $query = "SELECT meta_location_id FROM il_meta_location " .
166 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
167 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
168 "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
169 "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
170
171 $res = $ilDB->query($query);
172 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
173 $ids[] = $row->meta_location_id;
174 }
175 return $ids ? $ids : array();
176 }
$row
$query
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB

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

Referenced by ilMDTechnical\getLocationIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/3]

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

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

148 {
149 global $ilDB;
150
151 $query = "SELECT meta_location_id FROM il_meta_location " .
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 $res = $ilDB->query($query);
158 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
159 $ids[] = $row->meta_location_id;
160 }
161 return $ids ? $ids : array();
162 }

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

◆ _getIds() [3/3]

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

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

160 {
161 global $DIC;
162
163 $ilDB = $DIC['ilDB'];
164
165 $query = "SELECT meta_location_id FROM il_meta_location " .
166 "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
167 "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
168 "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
169 "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
170
171 $res = $ilDB->query($query);
172 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
173 $ids[] = $row->meta_location_id;
174 }
175 return $ids ? $ids : array();
176 }

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

◆ delete() [1/3]

ilMDLocation::delete ( )

Reimplemented from ilMDBase.

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

88 {
89 global $DIC;
90
91 $ilDB = $DIC['ilDB'];
92
93 if ($this->getMetaId()) {
94 $query = "DELETE FROM il_meta_location " .
95 "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId(), 'integer');
96 $res = $ilDB->manipulate($query);
97
98 return true;
99 }
100 return false;
101 }

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

+ Here is the call graph for this function:

◆ delete() [2/3]

ilMDLocation::delete ( )

Reimplemented from ilMDBase.

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

85 {
86 global $ilDB;
87
88 if ($this->getMetaId()) {
89 $query = "DELETE FROM il_meta_location " .
90 "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId());
91
92 $this->db->query($query);
93
94 return true;
95 }
96 return false;
97 }

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

+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDLocation::delete ( )

Reimplemented from ilMDBase.

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

88 {
89 global $DIC;
90
91 $ilDB = $DIC['ilDB'];
92
93 if ($this->getMetaId()) {
94 $query = "DELETE FROM il_meta_location " .
95 "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId(), 'integer');
96 $res = $ilDB->manipulate($query);
97
98 return true;
99 }
100 return false;
101 }

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

+ Here is the call graph for this function:

◆ getLocation() [1/3]

ilMDLocation::getLocation ( )

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

41 {
42 return $this->location;
43 }
$location
Definition: buildRTE.php:44

References $location.

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getLocation() [2/3]

ilMDLocation::getLocation ( )

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

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

References $location.

◆ getLocation() [3/3]

ilMDLocation::getLocation ( )

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

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

References $location.

◆ getLocationType() [1/3]

ilMDLocation::getLocationType ( )

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

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

Referenced by __getFields(), and toXML().

+ Here is the caller graph for this function:

◆ getLocationType() [2/3]

ilMDLocation::getLocationType ( )

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

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

◆ getLocationType() [3/3]

ilMDLocation::getLocationType ( )

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

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

◆ read() [1/3]

ilMDLocation::read ( )

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

116 {
117 global $DIC;
118
119 $ilDB = $DIC['ilDB'];
120
121 include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
122
123 if ($this->getMetaId()) {
124 $query = "SELECT * FROM il_meta_location " .
125 "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId(), 'integer');
126
127 $res = $this->db->query($query);
128 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
129 $this->setRBACId($row->rbac_id);
130 $this->setObjId($row->obj_id);
131 $this->setObjType($row->obj_type);
132 $this->setParentId($row->parent_id);
133 $this->setParentType($row->parent_type);
134 $this->setLocation($row->location);
135 $this->setLocationType($row->location_type);
136 }
137 }
138 return true;
139 }
setObjId($a_id)
setParentId($a_id)
setObjType($a_type)
setRBACId($a_id)
setParentType($a_parent_type)
setLocationType($a_location_type)
setLocation($a_location)

References $DIC, $ilDB, $query, $res, $row, 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:

◆ read() [2/3]

ilMDLocation::read ( )

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

112 {
113 global $ilDB;
114
115 include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
116
117 if ($this->getMetaId()) {
118 $query = "SELECT * FROM il_meta_location " .
119 "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId());
120
121 $res = $this->db->query($query);
122 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
123 $this->setRBACId($row->rbac_id);
124 $this->setObjId($row->obj_id);
125 $this->setObjType($row->obj_type);
126 $this->setParentId($row->parent_id);
127 $this->setParentType($row->parent_type);
128 $this->setLocation(ilUtil::stripSlashes($row->location));
129 $this->setLocationType(ilUtil::stripSlashes($row->location_type));
130 }
131 }
132 return true;
133 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ read() [3/3]

ilMDLocation::read ( )

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

116 {
117 global $DIC;
118
119 $ilDB = $DIC['ilDB'];
120
121 include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
122
123 if ($this->getMetaId()) {
124 $query = "SELECT * FROM il_meta_location " .
125 "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId(), 'integer');
126
127 $res = $this->db->query($query);
128 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
129 $this->setRBACId($row->rbac_id);
130 $this->setObjId($row->obj_id);
131 $this->setObjType($row->obj_type);
132 $this->setParentId($row->parent_id);
133 $this->setParentType($row->parent_type);
134 $this->setLocation($row->location);
135 $this->setLocationType($row->location_type);
136 }
137 }
138 return true;
139 }

References $DIC, $ilDB, $query, $res, $row, 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() [1/3]

ilMDLocation::save ( )

Reimplemented from ilMDBase.

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

54 {
55 global $DIC;
56
57 $ilDB = $DIC['ilDB'];
58
59 $fields = $this->__getFields();
60 $fields['meta_location_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_location'));
61
62 if ($this->db->insert('il_meta_location', $fields)) {
63 $this->setMetaId($next_id);
64 return $this->getMetaId();
65 }
66 return false;
67 }
setMetaId($a_meta_id, $a_read_data=true)

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

+ Here is the call graph for this function:

◆ save() [2/3]

ilMDLocation::save ( )

Reimplemented from ilMDBase.

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

54 {
55 if ($this->db->autoExecute(
56 'il_meta_location',
57 $this->__getFields(),
59 )) {
60 $this->setMetaId($this->db->getLastInsertId());
61
62 return $this->getMetaId();
63 }
64 return false;
65 }

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

+ Here is the call graph for this function:

◆ save() [3/3]

ilMDLocation::save ( )

Reimplemented from ilMDBase.

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

54 {
55 global $DIC;
56
57 $ilDB = $DIC['ilDB'];
58
59 $fields = $this->__getFields();
60 $fields['meta_location_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_location'));
61
62 if ($this->db->insert('il_meta_location', $fields)) {
63 $this->setMetaId($next_id);
64 return $this->getMetaId();
65 }
66 return false;
67 }

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

+ Here is the call graph for this function:

◆ setLocation() [1/3]

ilMDLocation::setLocation (   $a_location)

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

37 {
38 $this->location = $a_location;
39 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLocation() [2/3]

ilMDLocation::setLocation (   $a_location)

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

37 {
38 $this->location = $a_location;
39 }

◆ setLocation() [3/3]

ilMDLocation::setLocation (   $a_location)

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

37 {
38 $this->location = $a_location;
39 }

◆ setLocationType() [1/3]

ilMDLocation::setLocationType (   $a_location_type)

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

45 {
46 $this->location_type = $a_location_type;
47 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLocationType() [2/3]

ilMDLocation::setLocationType (   $a_location_type)

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

45 {
46 $this->location_type = $a_location_type;
47 }

◆ setLocationType() [3/3]

ilMDLocation::setLocationType (   $a_location_type)

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

45 {
46 $this->location_type = $a_location_type;
47 }

◆ toXML() [1/3]

ilMDLocation::toXML ( $writer)

Reimplemented from ilMDBase.

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

147 {
148 $writer->xmlElement(
149 'Location',
150 array('Type' => $this->getLocationType()
151 ? $this->getLocationType()
152 : 'LocalFile'),
153 $this->getLocation()
154 );
155 }

References getLocation(), and getLocationType().

+ Here is the call graph for this function:

◆ toXML() [2/3]

ilMDLocation::toXML ( $writer)

Reimplemented from ilMDBase.

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

141 {
142 $writer->xmlElement('Location', array('Type' => $this->getLocationType()), $this->getLocation());
143 }

References getLocation(), and getLocationType().

+ Here is the call graph for this function:

◆ toXML() [3/3]

ilMDLocation::toXML ( $writer)

Reimplemented from ilMDBase.

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

147 {
148 $writer->xmlElement(
149 'Location',
150 array('Type' => $this->getLocationType()
151 ? $this->getLocationType()
152 : 'LocalFile'),
153 $this->getLocation()
154 );
155 }

References getLocation(), and getLocationType().

+ Here is the call graph for this function:

◆ update() [1/3]

ilMDLocation::update ( )

Reimplemented from ilMDBase.

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

70 {
71 global $DIC;
72
73 $ilDB = $DIC['ilDB'];
74
75 if ($this->getMetaId()) {
76 if ($this->db->update(
77 'il_meta_location',
78 $this->__getFields(),
79 array("meta_location_id" => array('integer',$this->getMetaId()))
80 )) {
81 return true;
82 }
83 }
84 return false;
85 }

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

+ Here is the call graph for this function:

◆ update() [2/3]

ilMDLocation::update ( )

Reimplemented from ilMDBase.

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

68 {
69 global $ilDB;
70
71 if ($this->getMetaId()) {
72 if ($this->db->autoExecute(
73 'il_meta_location',
74 $this->__getFields(),
76 "meta_location_id = " . $ilDB->quote($this->getMetaId())
77 )) {
78 return true;
79 }
80 }
81 return false;
82 }

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

+ Here is the call graph for this function:

◆ update() [3/3]

ilMDLocation::update ( )

Reimplemented from ilMDBase.

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

70 {
71 global $DIC;
72
73 $ilDB = $DIC['ilDB'];
74
75 if ($this->getMetaId()) {
76 if ($this->db->update(
77 'il_meta_location',
78 $this->__getFields(),
79 array("meta_location_id" => array('integer',$this->getMetaId()))
80 )) {
81 return true;
82 }
83 }
84 return false;
85 }

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

+ Here is the call graph for this function:

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