ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
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
}
66
67
public
function
update
()
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
}
82
83
public
function
delete
()
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
}
96
97
98
public
function
__getFields
()
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
}
108
109
public
function
read
()
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
}
132
133
/*
134
* XML Export of all meta data
135
* @param object (xml writer) see class.ilMD2XML.php
136
*
137
*/
138
public
function
toXML
(&$writer)
139
{
140
$writer->xmlElement(
141
'Location'
,
142
array
(
'Type'
=> $this->
getLocationType
()
143
? $this->
getLocationType
()
144
:
'LocalFile'
),
145
$this->
getLocation
()
146
);
147
}
148
149
150
// STATIC
151
public
static
function
_getIds
($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
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
}
167
}
ilMDLocation
Definition:
class.ilMDLocation.php:33
ilMDLocation\getLocation
getLocation()
Definition:
class.ilMDLocation.php:40
ilMDBase\setObjType
setObjType($a_type)
Definition:
class.ilMDBase.php:107
ilMDLocation\setLocationType
setLocationType($a_location_type)
Definition:
class.ilMDLocation.php:44
$location
$location
Definition:
buildRTE.php:44
ilMDLocation\save
save()
Definition:
class.ilMDLocation.php:53
ilMDLocation\update
update()
Definition:
class.ilMDLocation.php:67
ilMDBase\getRBACId
getRBACId()
Definition:
class.ilMDBase.php:95
ilMDLocation\toXML
toXML(&$writer)
Definition:
class.ilMDLocation.php:138
ilMDLocation\setLocation
setLocation($a_location)
Definition:
class.ilMDLocation.php:36
ilMDLocation\__getFields
__getFields()
Definition:
class.ilMDLocation.php:98
ilMDLocation\getLocationType
getLocationType()
Definition:
class.ilMDLocation.php:48
ilMDBase\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMDBase.php:115
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMDLocation\read
read()
Definition:
class.ilMDLocation.php:109
ilMDBase\setObjId
setObjId($a_id)
Definition:
class.ilMDBase.php:99
ilMDBase\setRBACId
setRBACId($a_id)
Definition:
class.ilMDBase.php:91
$query
$query
Definition:
proxy_ylocal.php:13
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilMDBase\setParentId
setParentId($a_id)
Definition:
class.ilMDBase.php:135
ilMDBase\getMetaId
getMetaId()
Definition:
class.ilMDBase.php:123
ilMDBase\getParentType
getParentType()
Definition:
class.ilMDBase.php:131
ilMDBase\getObjId
getObjId()
Definition:
class.ilMDBase.php:103
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMDBase\setParentType
setParentType($a_parent_type)
Definition:
class.ilMDBase.php:127
ilMDBase\getObjType
getObjType()
Definition:
class.ilMDBase.php:111
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilMDBase
Definition:
class.ilMDBase.php:32
ilMDLocation\_getIds
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
Definition:
class.ilMDLocation.php:151
ilMDBase\getParentId
getParentId()
Definition:
class.ilMDBase.php:139
Services
MetaData
classes
class.ilMDLocation.php
Generated on Sat Jan 18 2025 19:01:34 for ILIAS by
1.8.13 (using
Doxyfile
)