ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilMD5295Relation.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.ilMD5295Base.php'
;
32
33
class
ilMD5295Relation
extends
ilMD5295Base
34
{
35
// METHODS OF CHILD OBJECTS (Taxon)
36
public
function
&
getIdentifier_Ids
()
37
{
38
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier_.php'
;
39
40
return
ilMD5295Identifier_::_getIds
($this->
getRBACId
(), $this->
getObjId
(), $this->
getMetaId
(),
'meta_relation'
);
41
}
42
public
function
&
getIdentifier_
($a_identifier__id)
43
{
44
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier_.php'
;
45
46
if
(!$a_identifier__id) {
47
return
false
;
48
}
49
$ide =
new
ilMD5295Identifier_
();
50
$ide->setMetaId($a_identifier__id);
51
52
return
$ide;
53
}
54
public
function
&
addIdentifier_
()
55
{
56
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier_.php'
;
57
58
$ide =
new
ilMD5295Identifier_
($this->
getRBACId
(), $this->
getObjId
(), $this->
getObjType
());
59
$ide->setParentId($this->
getMetaId
());
60
$ide->setParentType(
'meta_relation'
);
61
62
return
$ide;
63
}
64
65
public
function
&
getDescriptionIds
()
66
{
67
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php'
;
68
69
return
ilMdDescription::_getIds($this->
getRBACId
(), $this->
getObjId
(), $this->
getMetaId
(),
'meta_relation'
);
70
}
71
public
function
&
getDescription
($a_description_id)
72
{
73
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php'
;
74
75
if
(!$a_description_id) {
76
return
false
;
77
}
78
$des =
new
ilMD5295Description
();
79
$des->setMetaId($a_description_id);
80
81
return
$des;
82
}
83
public
function
&
addDescription
()
84
{
85
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php'
;
86
87
$des =
new
ilMD5295Description
($this->
getRBACId
(), $this->
getObjId
(), $this->
getObjType
());
88
$des->setParentId($this->
getMetaId
());
89
$des->setParentType(
'meta_relation'
);
90
91
return
$des;
92
}
93
// SET/GET
94
public
function
setKind
($a_kind)
95
{
96
switch
($a_kind) {
97
case
'IsPartOf'
:
98
case
'HasPart'
:
99
case
'IsVersionOf'
:
100
case
'HasVersion'
:
101
case
'IsFormatOf'
:
102
case
'HasFormat'
:
103
case
'References'
:
104
case
'IsReferencedBy'
:
105
case
'IsBasedOn'
:
106
case
'IsBasisFor'
:
107
case
'Requires'
:
108
case
'IsRequiredBy'
:
109
$this->kind = $a_kind;
110
return
true
;
111
112
default
:
113
return
false
;
114
}
115
}
116
public
function
getKind
()
117
{
118
return
$this->kind;
119
}
120
121
122
public
function
save
()
123
{
124
global
$DIC
;
125
126
$ilDB
= $DIC[
'ilDB'
];
127
128
$fields = $this->
__getFields
();
129
$fields[
'meta_relation_id'
] = array(
'integer'
,$next_id =
$ilDB
->nextId(
'il_meta_relation'
));
130
131
if
($this->db->insert(
'il_meta_relation'
, $fields)) {
132
$this->
setMetaId
($next_id);
133
return
$this->
getMetaId
();
134
}
135
return
false
;
136
}
137
138
public
function
update
()
139
{
140
global
$DIC
;
141
142
$ilDB
= $DIC[
'ilDB'
];
143
144
if
($this->
getMetaId
()) {
145
if
($this->db->update(
146
'il_meta_relation'
,
147
$this->__getFields(),
148
array(
"meta_relation_id"
=> array(
'integer'
,$this->
getMetaId
()))
149
)) {
150
return
true
;
151
}
152
}
153
return
false
;
154
}
155
156
public
function
delete
()
157
{
158
global
$DIC
;
159
160
$ilDB
= $DIC[
'ilDB'
];
161
162
if
($this->
getMetaId
()) {
163
$query
=
"DELETE FROM il_meta_relation "
.
164
"WHERE meta_relation_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
165
$res
=
$ilDB
->manipulate(
$query
);
166
167
foreach
($this->
getIdentifier_Ids
() as $id) {
168
$ide = $this->
getIdentifier_
($id);
169
$ide->delete();
170
}
171
foreach
($this->
getDescriptionIds
() as $id) {
172
$des = $this->
getDescription
($id);
173
$des->delete();
174
}
175
176
return
true
;
177
}
178
return
false
;
179
}
180
181
182
public
function
__getFields
()
183
{
184
return
array(
'rbac_id'
=> array(
'integer'
,$this->
getRBACId
()),
185
'obj_id'
=> array(
'integer'
,$this->
getObjId
()),
186
'obj_type'
=> array(
'text'
,$this->
getObjType
()),
187
'kind'
=> array(
'text'
,$this->
getKind
()));
188
}
189
190
public
function
read
()
191
{
192
global
$DIC
;
193
194
$ilDB
= $DIC[
'ilDB'
];
195
196
if
($this->
getMetaId
()) {
197
$query
=
"SELECT * FROM il_meta_relation "
.
198
"WHERE meta_relation_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
199
200
$res
= $this->db->query(
$query
);
201
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
202
$this->
setRBACId
($row->rbac_id);
203
$this->
setObjId
($row->obj_id);
204
$this->
setObjType
($row->obj_type);
205
$this->
setKind
($row->kind);
206
}
207
}
208
return
true
;
209
}
210
211
/*
212
* XML Export of all meta data
213
* @param object (xml writer) see class.ilMD52952XML.php
214
*
215
*/
216
public
function
toXML
(&$writer)
217
{
218
$writer->xmlStartTag(
'Relation'
, array(
'Kind'
=> $this->
getKind
()
219
? $this->
getKind
()
220
:
'IsPartOf'
));
221
$writer->xmlStartTag(
'Resource'
);
222
223
// Identifier_
224
$ides = $this->
getIdentifier_Ids
();
225
foreach
($ides as $id) {
226
$ide = &$this->
getIdentifier_
($id);
227
$ide->toXML($writer);
228
}
229
if
(!count($ides)) {
230
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Identifier_.php'
;
231
$ide =
new
ilMD5295Identifier_
($this->
getRBACId
(), $this->
getObjId
());
232
$ide->toXML($writer);
233
}
234
235
// Description
236
$dess = $this->
getDescriptionIds
();
237
foreach
($dess as $id) {
238
$des = &$this->
getDescription
($id);
239
$des->toXML($writer);
240
}
241
if
(!count($dess)) {
242
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Description.php'
;
243
$des =
new
ilMD5295Description
($this->
getRBACId
(), $this->
getObjId
());
244
$des->toXML($writer);
245
}
246
247
$writer->xmlEndTag(
'Resource'
);
248
$writer->xmlEndTag(
'Relation'
);
249
}
250
251
252
253
// STATIC
254
public
static
function
_getIds
($a_rbac_id, $a_obj_id)
255
{
256
global
$DIC
;
257
258
$ilDB
= $DIC[
'ilDB'
];
259
260
$query
=
"SELECT meta_relation_id FROM il_meta_relation "
.
261
"WHERE rbac_id = "
.
$ilDB
->quote($a_rbac_id,
'integer'
) .
" "
.
262
"AND obj_id = "
.
$ilDB
->quote($a_obj_id,
'integer'
);
263
264
$res
=
$ilDB
->query(
$query
);
265
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
266
$ids[] = $row->meta_relation_id;
267
}
268
return
$ids ? $ids : array();
269
}
270
}
ilMD5295Base\getMetaId
getMetaId()
Definition:
class.ilMD5295Base.php:125
ilMD5295Base\getObjId
getObjId()
Definition:
class.ilMD5295Base.php:105
ilMD5295Base\getRBACId
getRBACId()
Definition:
class.ilMD5295Base.php:97
ilMD5295Relation\save
save()
Definition:
class.ilMD5295Relation.php:122
ilMD5295Base\getObjType
getObjType()
Definition:
class.ilMD5295Base.php:113
ilMD5295Relation\toXML
toXML(&$writer)
Definition:
class.ilMD5295Relation.php:216
ilMD5295Relation\read
read()
Definition:
class.ilMD5295Relation.php:190
ilMD5295Relation\addDescription
& addDescription()
Definition:
class.ilMD5295Relation.php:83
ilMD5295Relation
Definition:
class.ilMD5295Relation.php:33
ilMD5295Base\setObjType
setObjType($a_type)
Definition:
class.ilMD5295Base.php:109
ilMD5295Identifier_\_getIds
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
Definition:
class.ilMD5295Identifier_.php:152
ilMD5295Relation\__getFields
__getFields()
Definition:
class.ilMD5295Relation.php:182
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMD5295Relation\update
update()
Definition:
class.ilMD5295Relation.php:138
ilMD5295Relation\getKind
getKind()
Definition:
class.ilMD5295Relation.php:116
ilMD5295Base
Definition:
class.ilMD5295Base.php:32
ilMD5295Base\setRBACId
setRBACId($a_id)
Definition:
class.ilMD5295Base.php:93
ilMD5295Relation\getDescription
& getDescription($a_description_id)
Definition:
class.ilMD5295Relation.php:71
ilMD5295Base\setObjId
setObjId($a_id)
Definition:
class.ilMD5295Base.php:101
ilMD5295Relation\getIdentifier_
& getIdentifier_($a_identifier__id)
Definition:
class.ilMD5295Relation.php:42
$query
$query
Definition:
proxy_ylocal.php:13
ilMD5295Relation\_getIds
static _getIds($a_rbac_id, $a_obj_id)
Definition:
class.ilMD5295Relation.php:254
ilMD5295Description
Definition:
class.ilMD5295Description.php:33
ilMD5295Relation\setKind
setKind($a_kind)
Definition:
class.ilMD5295Relation.php:94
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
$DIC
$DIC
Definition:
xapitoken.php:46
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:11
ilMD5295Relation\getIdentifier_Ids
& getIdentifier_Ids()
Definition:
class.ilMD5295Relation.php:36
ilMD5295Relation\addIdentifier_
& addIdentifier_()
Definition:
class.ilMD5295Relation.php:54
ilMD5295Identifier_
Definition:
class.ilMD5295Identifier_.php:33
ilMD5295Base\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMD5295Base.php:117
ilMD5295Relation\getDescriptionIds
& getDescriptionIds()
Definition:
class.ilMD5295Relation.php:65
Services
Migration
DBUpdate_5295
classes
class.ilMD5295Relation.php
Generated on Sun Apr 6 2025 20:01:27 for ILIAS by
1.8.13 (using
Doxyfile
)