ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilMDLocation.php
Go to the documentation of this file.
1
<?
php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
31
include_once
'class.ilMDBase.php'
;
32
33
class
ilMDLocation
extends
ilMDBase
34
{
35
// SET/GET
36
public
function
setLocation
($a_location)
37
{
38
$this->location = $a_location;
39
}
40
public
function
getLocation
()
41
{
42
return
$this->location
;
43
}
44
public
function
setLocationType
($a_location_type)
45
{
46
$this->location_type = $a_location_type;
47
}
48
public
function
getLocationType
()
49
{
50
return
$this->location_type;
51
}
52
53
public
function
save
()
54
{
55
if
($this->db->autoExecute(
56
'il_meta_location'
,
57
$this->__getFields(),
58
ilDBConstants::AUTOQUERY_INSERT
59
)) {
60
$this->
setMetaId
($this->db->getLastInsertId());
61
62
return
$this->
getMetaId
();
63
}
64
return
false
;
65
}
66
67
public
function
update
()
68
{
69
global
$ilDB
;
70
71
if
($this->
getMetaId
()) {
72
if
($this->db->autoExecute(
73
'il_meta_location'
,
74
$this->__getFields(),
75
ilDBConstants::AUTOQUERY_UPDATE
,
76
"meta_location_id = "
. $ilDB->quote($this->
getMetaId
())
77
)) {
78
return
true
;
79
}
80
}
81
return
false
;
82
}
83
84
public
function
delete
()
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
}
98
99
100
public
function
__getFields
()
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
}
110
111
public
function
read
()
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
}
134
135
/*
136
* XML Export of all meta data
137
* @param object (xml writer) see class.ilMD2XML.php
138
*
139
*/
140
public
function
toXML
(&$writer)
141
{
142
$writer->xmlElement(
'Location'
, array(
'Type'
=> $this->
getLocationType
()), $this->
getLocation
());
143
}
144
145
146
// STATIC
147
public
function
_getIds
($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
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
}
163
}
ilMDLocation
Definition:
class.ilMDLocation.php:33
ilMDLocation\getLocation
getLocation()
Definition:
class.ilMDLocation.php:40
ilMDBase\setObjType
setObjType($a_type)
Definition:
class.ilMDBase.php:109
ilMDLocation\setLocationType
setLocationType($a_location_type)
Definition:
class.ilMDLocation.php:44
$location
$location
Definition:
buildRTE.php:44
ilDBConstants\AUTOQUERY_INSERT
const AUTOQUERY_INSERT
Definition:
class.ilDBConstants.php:57
ilMDLocation\save
save()
Definition:
class.ilMDLocation.php:53
ilMDLocation\update
update()
Definition:
class.ilMDLocation.php:67
ilMDBase\getRBACId
getRBACId()
Definition:
class.ilMDBase.php:97
ilMDLocation\toXML
toXML(&$writer)
Definition:
class.ilMDLocation.php:140
ilMDLocation\_getIds
_getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
Definition:
class.ilMDLocation.php:147
ilMDLocation\setLocation
setLocation($a_location)
Definition:
class.ilMDLocation.php:36
ilMDLocation\__getFields
__getFields()
Definition:
class.ilMDLocation.php:100
ilMDLocation\getLocationType
getLocationType()
Definition:
class.ilMDLocation.php:48
ilMDBase\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMDBase.php:117
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMDLocation\read
read()
Definition:
class.ilMDLocation.php:111
ilMDBase\setObjId
setObjId($a_id)
Definition:
class.ilMDBase.php:101
ilMDBase\setRBACId
setRBACId($a_id)
Definition:
class.ilMDBase.php:93
$query
$query
Definition:
proxy_ylocal.php:13
ilUtil\stripSlashes
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Definition:
class.ilUtil.php:2406
ilMDBase\setParentId
setParentId($a_id)
Definition:
class.ilMDBase.php:137
$row
$row
Definition:
migrateto20.php:360
ilMDBase\getMetaId
getMetaId()
Definition:
class.ilMDBase.php:125
ilMDBase\getParentType
getParentType()
Definition:
class.ilMDBase.php:133
ilMDBase\getObjId
getObjId()
Definition:
class.ilMDBase.php:105
ilUtil\prepareDBString
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
Definition:
class.ilUtil.php:2871
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMDBase\setParentType
setParentType($a_parent_type)
Definition:
class.ilMDBase.php:129
php
ilMDBase\getObjType
getObjType()
Definition:
class.ilMDBase.php:113
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilMDBase
Definition:
class.ilMDBase.php:32
ilDBConstants\AUTOQUERY_UPDATE
const AUTOQUERY_UPDATE
Definition:
class.ilDBConstants.php:58
ilMDBase\getParentId
getParentId()
Definition:
class.ilMDBase.php:141
Services
Migration
DBUpdate_426
classes
class.ilMDLocation.php
Generated on Thu Feb 27 2025 19:02:01 for ILIAS by
1.8.13 (using
Doxyfile
)