ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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)
 
- 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)
 

Static Public Member Functions

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/2]

ilMDLocation::__getFields ( )

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

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

Referenced by save().

99  {
100  return array('rbac_id' => array('integer',$this->getRBACId()),
101  'obj_id' => array('integer',$this->getObjId()),
102  'obj_type' => array('text',$this->getObjType()),
103  'parent_type' => array('text',$this->getParentType()),
104  'parent_id' => array('integer',$this->getParentId()),
105  'location' => array('text',$this->getLocation()),
106  'location_type' => array('text',$this->getLocationType()));
107  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDLocation::__getFields ( )

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

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

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  }
Create styles array
The data for the language used.
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ _getIds() [1/2]

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

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

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

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB

◆ _getIds() [2/2]

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

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

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

Referenced by ilMDTechnical\getLocationIds().

152  {
153  global $ilDB;
154 
155  $query = "SELECT meta_location_id FROM il_meta_location " .
156  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
157  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
158  "AND parent_id = " . $ilDB->quote($a_parent_id, 'integer') . " " .
159  "AND parent_type = " . $ilDB->quote($a_parent_type, 'text');
160 
161  $res = $ilDB->query($query);
162  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
163  $ids[] = $row->meta_location_id;
164  }
165  return $ids ? $ids : array();
166  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ delete() [1/2]

ilMDLocation::delete ( )

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

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

84  {
85  global $ilDB;
86 
87  if ($this->getMetaId()) {
88  $query = "DELETE FROM il_meta_location " .
89  "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId(), 'integer');
90  $res = $ilDB->manipulate($query);
91 
92  return true;
93  }
94  return false;
95  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDLocation::delete ( )

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

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

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  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ getLocation() [1/2]

ilMDLocation::getLocation ( )

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

References $location.

Referenced by __getFields(), and toXML().

41  {
42  return $this->location;
43  }
$location
Definition: buildRTE.php:44
+ Here is the caller graph for this function:

◆ getLocation() [2/2]

ilMDLocation::getLocation ( )

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

References $location.

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

◆ getLocationType() [1/2]

ilMDLocation::getLocationType ( )

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

Referenced by __getFields(), and toXML().

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

◆ getLocationType() [2/2]

ilMDLocation::getLocationType ( )

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

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

◆ read() [1/2]

ilMDLocation::read ( )

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

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

110  {
111  global $ilDB;
112 
113  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
114 
115  if ($this->getMetaId()) {
116  $query = "SELECT * FROM il_meta_location " .
117  "WHERE meta_location_id = " . $ilDB->quote($this->getMetaId(), 'integer');
118 
119  $res = $this->db->query($query);
120  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
121  $this->setRBACId($row->rbac_id);
122  $this->setObjId($row->obj_id);
123  $this->setObjType($row->obj_type);
124  $this->setParentId($row->parent_id);
125  $this->setParentType($row->parent_type);
126  $this->setLocation($row->location);
127  $this->setLocationType($row->location_type);
128  }
129  }
130  return true;
131  }
setObjType($a_type)
setLocationType($a_location_type)
setLocation($a_location)
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
setParentId($a_id)
global $ilDB
setParentType($a_parent_type)
+ Here is the call graph for this function:

◆ read() [2/2]

ilMDLocation::read ( )

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

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().

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  }
setObjType($a_type)
setLocationType($a_location_type)
setLocation($a_location)
foreach($_POST as $key=> $value) $res
setObjId($a_id)
setRBACId($a_id)
$query
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setParentId($a_id)
global $ilDB
setParentType($a_parent_type)
+ Here is the call graph for this function:

◆ save() [1/2]

ilMDLocation::save ( )

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

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

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  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/2]

ilMDLocation::save ( )

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

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

54  {
55  global $ilDB;
56 
57  $fields = $this->__getFields();
58  $fields['meta_location_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_location'));
59 
60  if ($this->db->insert('il_meta_location', $fields)) {
61  $this->setMetaId($next_id);
62  return $this->getMetaId();
63  }
64  return false;
65  }
setMetaId($a_meta_id, $a_read_data=true)
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ setLocation() [1/2]

ilMDLocation::setLocation (   $a_location)

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

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

◆ setLocation() [2/2]

ilMDLocation::setLocation (   $a_location)

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

Referenced by read().

37  {
38  $this->location = $a_location;
39  }
+ Here is the caller graph for this function:

◆ setLocationType() [1/2]

ilMDLocation::setLocationType (   $a_location_type)

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

Referenced by read().

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

◆ setLocationType() [2/2]

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/2]

ilMDLocation::toXML ( $writer)

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

References array, getLocation(), and getLocationType().

139  {
140  $writer->xmlElement(
141  'Location',
142  array('Type' => $this->getLocationType()
143  ? $this->getLocationType()
144  : 'LocalFile'),
145  $this->getLocation()
146  );
147  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDLocation::toXML ( $writer)

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

References array, getLocation(), and getLocationType().

141  {
142  $writer->xmlElement('Location', array('Type' => $this->getLocationType()), $this->getLocation());
143  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ update() [1/2]

ilMDLocation::update ( )

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

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

68  {
69  global $ilDB;
70 
71  if ($this->getMetaId()) {
72  if ($this->db->update(
73  'il_meta_location',
74  $this->__getFields(),
75  array("meta_location_id" => array('integer',$this->getMetaId()))
76  )) {
77  return true;
78  }
79  }
80  return false;
81  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/2]

ilMDLocation::update ( )

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

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

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  }
global $ilDB
+ Here is the call graph for this function:

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