ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 100 of file class.ilMDLocation.php.

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

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

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:

◆ _getIds() [1/2]

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

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

153 {
154 global $ilDB;
155
156 $query = "SELECT meta_location_id FROM il_meta_location ".
157 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
158 "AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ".
159 "AND parent_id = ".$ilDB->quote($a_parent_id ,'integer')." ".
160 "AND parent_type = ".$ilDB->quote($a_parent_type ,'text');
161
162 $res = $ilDB->query($query);
163 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
164 {
165 $ids[] = $row->meta_location_id;
166 }
167 return $ids ? $ids : array();
168 }
global $ilDB

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

Referenced by ilMDTechnical\getLocationIds().

+ Here is the caller graph for this function:

◆ _getIds() [2/2]

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

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

150 {
151 global $ilDB;
152
153 $query = "SELECT meta_location_id FROM il_meta_location ".
154 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
155 "AND obj_id = ".$ilDB->quote($a_obj_id)." ".
156 "AND parent_id = ".$ilDB->quote($a_parent_id)." ".
157 "AND parent_type = ".$ilDB->quote($a_parent_type);
158
159 $res = $ilDB->query($query);
160 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
161 {
162 $ids[] = $row->meta_location_id;
163 }
164 return $ids ? $ids : array();
165 }

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

◆ delete() [1/2]

ilMDLocation::delete ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

◆ delete() [2/2]

ilMDLocation::delete ( )

Reimplemented from ilMDBase.

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

84 {
85 global $ilDB;
86
87 if($this->getMetaId())
88 {
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:

◆ getLocation() [1/2]

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

ilMDLocation::getLocation ( )

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

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

References $location.

◆ getLocationType() [1/2]

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/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 111 of file class.ilMDLocation.php.

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

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

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 {
119 $query = "SELECT * FROM il_meta_location ".
120 "WHERE meta_location_id = ".$ilDB->quote($this->getMetaId());
121
122 $res = $this->db->query($query);
123 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
124 {
125 $this->setRBACId($row->rbac_id);
126 $this->setObjId($row->obj_id);
127 $this->setObjType($row->obj_type);
128 $this->setParentId($row->parent_id);
129 $this->setParentType($row->parent_type);
130 $this->setLocation(ilUtil::stripSlashes($row->location));
131 $this->setLocationType(ilUtil::stripSlashes($row->location_type));
132 }
133 }
134 return true;
135 }
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:

◆ save() [1/2]

ilMDLocation::save ( )

Reimplemented from ilMDBase.

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

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 {
62 $this->setMetaId($next_id);
63 return $this->getMetaId();
64 }
65 return false;
66 }
setMetaId($a_meta_id, $a_read_data=true)

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

+ Here is the call graph for this function:

◆ save() [2/2]

ilMDLocation::save ( )

Reimplemented from ilMDBase.

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

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

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

+ 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 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLocation() [2/2]

ilMDLocation::setLocation (   $a_location)

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

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

◆ setLocationType() [1/2]

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/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)

Reimplemented from ilMDBase.

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

143 {
144 $writer->xmlElement('Location',array('Type' => $this->getLocationType()
145 ? $this->getLocationType()
146 : 'LocalFile'),
147 $this->getLocation());
148 }

References getLocation(), and getLocationType().

+ Here is the call graph for this function:

◆ toXML() [2/2]

ilMDLocation::toXML ( $writer)

Reimplemented from ilMDBase.

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

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

References getLocation(), and getLocationType().

+ Here is the call graph for this function:

◆ update() [1/2]

ilMDLocation::update ( )

Reimplemented from ilMDBase.

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

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

References $ilDB, and ilMDBase\getMetaId().

+ Here is the call graph for this function:

◆ update() [2/2]

ilMDLocation::update ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

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