ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMDLocation Class Reference
+ Inheritance diagram for ilMDLocation:
+ Collaboration diagram for ilMDLocation:

Public Member Functions

 ilMDLocation ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 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)
 
 ilMDLocation ($a_rbac_id=0, $a_obj_id=0, $a_obj_type='')
 
 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
 ilMDBase ($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)
 
 ilMDBase ($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)
 

Additional Inherited Members

- Data Fields inherited from ilMDBase
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 

Detailed Description

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

Member Function Documentation

◆ __getFields() [1/2]

ilMDLocation::__getFields ( )

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

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

Referenced by save().

108  {
109  return array('rbac_id' => array('integer',$this->getRBACId()),
110  'obj_id' => array('integer',$this->getObjId()),
111  'obj_type' => array('text',$this->getObjType()),
112  'parent_type' => array('text',$this->getParentType()),
113  'parent_id' => array('integer',$this->getParentId()),
114  'location' => array('text',$this->getLocation()),
115  'location_type' => array('text',$this->getLocationType()));
116  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getFields() [2/2]

ilMDLocation::__getFields ( )

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

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

108  {
109  return array('rbac_id' => $this->getRBACId(),
110  'obj_id' => $this->getObjId(),
111  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
112  'parent_type' => $this->getParentType(),
113  'parent_id' => $this->getParentId(),
114  'location' => ilUtil::prepareDBString($this->getLocation()),
115  'location_type' => ilUtil::prepareDBString($this->getLocationType()));
116  }
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 156 of file class.ilMDLocation.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

157  {
158  global $ilDB;
159 
160  $query = "SELECT meta_location_id FROM il_meta_location ".
161  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
162  "AND obj_id = ".$ilDB->quote($a_obj_id)." ".
163  "AND parent_id = ".$ilDB->quote($a_parent_id)." ".
164  "AND parent_type = ".$ilDB->quote($a_parent_type);
165 
166  $res = $ilDB->query($query);
167  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
168  {
169  $ids[] = $row->meta_location_id;
170  }
171  return $ids ? $ids : array();
172  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

◆ _getIds() [2/2]

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

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

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilMDTechnical\getLocationIds().

160  {
161  global $ilDB;
162 
163  $query = "SELECT meta_location_id FROM il_meta_location ".
164  "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
165  "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ".
166  "AND parent_id = ".$ilDB->quote($a_parent_id ,'integer')." ".
167  "AND parent_type = ".$ilDB->quote($a_parent_type ,'text');
168 
169  $res = $ilDB->query($query);
170  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
171  {
172  $ids[] = $row->meta_location_id;
173  }
174  return $ids ? $ids : array();
175  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ delete() [1/2]

ilMDLocation::delete ( )

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

References $query, and ilMDBase\getMetaId().

91  {
92  global $ilDB;
93 
94  if($this->getMetaId())
95  {
96  $query = "DELETE FROM il_meta_location ".
97  "WHERE meta_location_id = ".$ilDB->quote($this->getMetaId());
98 
99  $this->db->query($query);
100 
101  return true;
102  }
103  return false;
104  }
+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDLocation::delete ( )

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

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

92  {
93  global $ilDB;
94 
95  if($this->getMetaId())
96  {
97  $query = "DELETE FROM il_meta_location ".
98  "WHERE meta_location_id = ".$ilDB->quote($this->getMetaId() ,'integer');
99  $res = $ilDB->manipulate($query);
100 
101  return true;
102  }
103  return false;
104  }
+ Here is the call graph for this function:

◆ getLocation() [1/2]

ilMDLocation::getLocation ( )

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

References $location.

Referenced by __getFields(), and toXML().

48  {
49  return $this->location;
50  }
$location
Definition: buildRTE.php:44
+ Here is the caller graph for this function:

◆ getLocation() [2/2]

ilMDLocation::getLocation ( )

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

References $location.

48  {
49  return $this->location;
50  }
$location
Definition: buildRTE.php:44

◆ getLocationType() [1/2]

ilMDLocation::getLocationType ( )

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

56  {
57  return $this->location_type;
58  }

◆ getLocationType() [2/2]

ilMDLocation::getLocationType ( )

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

Referenced by __getFields(), and toXML().

56  {
57  return $this->location_type;
58  }
+ Here is the caller graph for this function:

◆ ilMDLocation() [1/2]

ilMDLocation::ilMDLocation (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

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

36  {
37  parent::ilMDBase($a_rbac_id,
38  $a_obj_id,
39  $a_obj_type);
40  }

◆ ilMDLocation() [2/2]

ilMDLocation::ilMDLocation (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

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

36  {
37  parent::ilMDBase($a_rbac_id,
38  $a_obj_id,
39  $a_obj_type);
40  }

◆ read() [1/2]

ilMDLocation::read ( )

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

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

119  {
120  global $ilDB;
121 
122  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
123 
124  if($this->getMetaId())
125  {
126  $query = "SELECT * FROM il_meta_location ".
127  "WHERE meta_location_id = ".$ilDB->quote($this->getMetaId() ,'integer');
128 
129  $res = $this->db->query($query);
130  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
131  {
132  $this->setRBACId($row->rbac_id);
133  $this->setObjId($row->obj_id);
134  $this->setObjType($row->obj_type);
135  $this->setParentId($row->parent_id);
136  $this->setParentType($row->parent_type);
137  $this->setLocation($row->location);
138  $this->setLocationType($row->location_type);
139  }
140  }
141  return true;
142  }
setObjType($a_type)
setLocationType($a_location_type)
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setLocation($a_location)
setObjId($a_id)
setRBACId($a_id)
setParentId($a_id)
setParentType($a_parent_type)
+ Here is the call graph for this function:

◆ read() [2/2]

ilMDLocation::read ( )

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

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

119  {
120  global $ilDB;
121 
122  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
123 
124  if($this->getMetaId())
125  {
126  $query = "SELECT * FROM il_meta_location ".
127  "WHERE meta_location_id = ".$ilDB->quote($this->getMetaId());
128 
129  $res = $this->db->query($query);
130  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
131  {
132  $this->setRBACId($row->rbac_id);
133  $this->setObjId($row->obj_id);
134  $this->setObjType($row->obj_type);
135  $this->setParentId($row->parent_id);
136  $this->setParentType($row->parent_type);
137  $this->setLocation(ilUtil::stripSlashes($row->location));
138  $this->setLocationType(ilUtil::stripSlashes($row->location_type));
139  }
140  }
141  return true;
142  }
setObjType($a_type)
setLocationType($a_location_type)
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setLocation($a_location)
setObjId($a_id)
setRBACId($a_id)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setParentId($a_id)
setParentType($a_parent_type)
+ Here is the call graph for this function:

◆ save() [1/2]

ilMDLocation::save ( )

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

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

61  {
62  if($this->db->autoExecute('il_meta_location',
63  $this->__getFields(),
64  DB_AUTOQUERY_INSERT))
65  {
66  $this->setMetaId($this->db->getLastInsertId());
67 
68  return $this->getMetaId();
69  }
70  return false;
71  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [2/2]

ilMDLocation::save ( )

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

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

61  {
62  global $ilDB;
63 
64  $fields = $this->__getFields();
65  $fields['meta_location_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_location'));
66 
67  if($this->db->insert('il_meta_location',$fields))
68  {
69  $this->setMetaId($next_id);
70  return $this->getMetaId();
71  }
72  return false;
73  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setLocation() [1/2]

ilMDLocation::setLocation (   $a_location)

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

Referenced by read().

44  {
45  $this->location = $a_location;
46  }
+ Here is the caller graph for this function:

◆ setLocation() [2/2]

ilMDLocation::setLocation (   $a_location)

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

44  {
45  $this->location = $a_location;
46  }

◆ setLocationType() [1/2]

ilMDLocation::setLocationType (   $a_location_type)

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

Referenced by read().

52  {
53  $this->location_type = $a_location_type;
54  }
+ Here is the caller graph for this function:

◆ setLocationType() [2/2]

ilMDLocation::setLocationType (   $a_location_type)

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

52  {
53  $this->location_type = $a_location_type;
54  }

◆ toXML() [1/2]

ilMDLocation::toXML ( $writer)

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

References getLocation(), and getLocationType().

150  {
151  $writer->xmlElement('Location',array('Type' => $this->getLocationType()),$this->getLocation());
152  }
+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDLocation::toXML ( $writer)

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

References getLocation(), and getLocationType().

150  {
151  $writer->xmlElement('Location',array('Type' => $this->getLocationType()
152  ? $this->getLocationType()
153  : 'LocalFile'),
154  $this->getLocation());
155  }
+ Here is the call graph for this function:

◆ update() [1/2]

ilMDLocation::update ( )

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

References ilMDBase\getMetaId().

74  {
75  global $ilDB;
76 
77  if($this->getMetaId())
78  {
79  if($this->db->autoExecute('il_meta_location',
80  $this->__getFields(),
81  DB_AUTOQUERY_UPDATE,
82  "meta_location_id = ".$ilDB->quote($this->getMetaId())))
83  {
84  return true;
85  }
86  }
87  return false;
88  }
+ Here is the call graph for this function:

◆ update() [2/2]

ilMDLocation::update ( )

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

References ilMDBase\getMetaId().

76  {
77  global $ilDB;
78 
79  if($this->getMetaId())
80  {
81  if($this->db->update('il_meta_location',
82  $this->__getFields(),
83  array("meta_location_id" => array('integer',$this->getMetaId()))))
84  {
85  return true;
86  }
87  }
88  return false;
89  }
+ Here is the call graph for this function:

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