ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ 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
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
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.ilMD5295TaxonPath.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
ilMD5295TaxonPath
extends
ilMD5295Base
34
{
35
// METHODS OF CHILD OBJECTS (Taxon)
36
public
function
&
getTaxonIds
()
37
{
38
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Taxon.php'
;
39
40
return
ilMD5295Taxon::_getIds
($this->
getRBACId
(), $this->
getObjId
(), $this->
getMetaId
(),
'meta_taxon_path'
);
41
}
42
public
function
&
getTaxon
($a_taxon_id)
43
{
44
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Taxon.php'
;
45
46
if
(!$a_taxon_id) {
47
return
false
;
48
}
49
$tax =
new
ilMD5295Taxon
();
50
$tax->setMetaId($a_taxon_id);
51
52
return
$tax;
53
}
54
public
function
&
addTaxon
()
55
{
56
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Taxon.php'
;
57
58
$tax =
new
ilMD5295Taxon
($this->
getRBACId
(), $this->
getObjId
(), $this->
getObjType
());
59
$tax->setParentId($this->
getMetaId
());
60
$tax->setParentType(
'meta_taxon_path'
);
61
62
return
$tax;
63
}
64
65
// SET/GET
66
public
function
setSource
($a_source)
67
{
68
$this->source = $a_source;
69
}
70
public
function
getSource
()
71
{
72
return
$this->source
;
73
}
74
public
function
setSourceLanguage
(&$lng_obj)
75
{
76
if
(is_object($lng_obj)) {
77
$this->source_language = $lng_obj;
78
}
79
}
80
public
function
&
getSourceLanguage
()
81
{
82
return
is_object($this->source_language) ? $this->source_language :
false
;
83
}
84
public
function
getSourceLanguageCode
()
85
{
86
return
is_object($this->source_language) ? $this->source_language->getLanguageCode() :
false
;
87
}
88
89
90
public
function
save
()
91
{
92
global
$DIC
;
93
94
$ilDB
= $DIC[
'ilDB'
];
95
96
$fields = $this->
__getFields
();
97
$fields[
'meta_taxon_path_id'
] = array(
'integer'
,$next_id =
$ilDB
->nextId(
'il_meta_taxon_path'
));
98
99
if
($this->db->insert(
'il_meta_taxon_path'
, $fields)) {
100
$this->
setMetaId
($next_id);
101
return
$this->
getMetaId
();
102
}
103
return
false
;
104
}
105
106
public
function
update
()
107
{
108
global
$DIC
;
109
110
$ilDB
= $DIC[
'ilDB'
];
111
112
if
($this->
getMetaId
()) {
113
if
($this->db->update(
114
'il_meta_taxon_path'
,
115
$this->__getFields(),
116
array(
"meta_taxon_path_id"
=> array(
'integer'
,$this->
getMetaId
()))
117
)) {
118
return
true
;
119
}
120
}
121
return
false
;
122
}
123
124
public
function
delete
()
125
{
126
global
$DIC
;
127
128
$ilDB
= $DIC[
'ilDB'
];
129
130
if
($this->
getMetaId
()) {
131
$query
=
"DELETE FROM il_meta_taxon_path "
.
132
"WHERE meta_taxon_path_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
133
$res
=
$ilDB
->manipulate(
$query
);
134
135
foreach
($this->
getTaxonIds
() as $id) {
136
$tax = $this->
getTaxon
($id);
137
$tax->delete();
138
}
139
140
return
true
;
141
}
142
return
false
;
143
}
144
145
146
public
function
__getFields
()
147
{
148
return
array(
'rbac_id'
=> array(
'integer'
,$this->
getRBACId
()),
149
'obj_id'
=> array(
'integer'
,$this->
getObjId
()),
150
'obj_type'
=> array(
'text'
,$this->
getObjType
()),
151
'parent_type'
=> array(
'text'
,$this->
getParentType
()),
152
'parent_id'
=> array(
'integer'
,$this->
getParentId
()),
153
'source'
=> array(
'text'
,$this->
getSource
()),
154
'source_language'
=> array(
'text'
,$this->
getSourceLanguageCode
()));
155
}
156
157
public
function
read
()
158
{
159
global
$DIC
;
160
161
$ilDB
= $DIC[
'ilDB'
];
162
163
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php'
;
164
165
if
($this->
getMetaId
()) {
166
$query
=
"SELECT * FROM il_meta_taxon_path "
.
167
"WHERE meta_taxon_path_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
168
169
$res
=
$ilDB
->query(
$query
);
170
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
171
$this->
setRBACId
($row->rbac_id);
172
$this->
setObjId
($row->obj_id);
173
$this->
setObjType
($row->obj_type);
174
$this->
setParentId
($row->parent_id);
175
$this->
setParentType
($row->parent_type);
176
$this->
setSource
($row->source);
177
$this->source_language =
new
ilMD5295LanguageItem
($row->source_language);
178
}
179
}
180
return
true
;
181
}
182
183
/*
184
* XML Export of all meta data
185
* @param object (xml writer) see class.ilMD52952XML.php
186
*
187
*/
188
public
function
toXML
(&$writer)
189
{
190
$writer->xmlStartTag(
'TaxonPath'
);
191
192
$writer->xmlElement(
193
'Source'
,
194
array(
'Language'
=> $this->
getSourceLanguageCode
()
195
? $this->
getSourceLanguageCode
()
196
:
'en'
),
197
$this->
getSource
()
198
);
199
200
// Taxon
201
$taxs = $this->
getTaxonIds
();
202
foreach
($taxs as $id) {
203
$tax = &$this->
getTaxon
($id);
204
$tax->toXML($writer);
205
}
206
if
(!count($taxs)) {
207
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295Taxon.php'
;
208
$tax =
new
ilMD5295Taxon
($this->
getRBACId
(), $this->
getObjId
());
209
$tax->toXML($writer);
210
}
211
212
$writer->xmlEndTag(
'TaxonPath'
);
213
}
214
215
216
217
// STATIC
218
public
static
function
_getIds
($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
219
{
220
global
$DIC
;
221
222
$ilDB
= $DIC[
'ilDB'
];
223
224
$query
=
"SELECT meta_taxon_path_id FROM il_meta_taxon_path "
.
225
"WHERE rbac_id = "
.
$ilDB
->quote($a_rbac_id,
'integer'
) .
" "
.
226
"AND obj_id = "
.
$ilDB
->quote($a_obj_id,
'integer'
) .
" "
.
227
"AND parent_id = "
.
$ilDB
->quote($a_parent_id,
'integer'
) .
" "
.
228
"AND parent_type = "
.
$ilDB
->quote($a_parent_type,
'text'
);
229
230
$res
=
$ilDB
->query(
$query
);
231
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
232
$ids[] = $row->meta_taxon_path_id;
233
}
234
return
$ids ? $ids : array();
235
}
236
}
ilMD5295Base\getMetaId
getMetaId()
Definition:
class.ilMD5295Base.php:125
ilMD5295Base\getObjId
getObjId()
Definition:
class.ilMD5295Base.php:105
ilMD5295Base\getRBACId
getRBACId()
Definition:
class.ilMD5295Base.php:97
ilMD5295TaxonPath\save
save()
Definition:
class.ilMD5295TaxonPath.php:90
ilMD5295Base\getObjType
getObjType()
Definition:
class.ilMD5295Base.php:113
ilMD5295TaxonPath\getSource
getSource()
Definition:
class.ilMD5295TaxonPath.php:70
ilMD5295TaxonPath\getSourceLanguage
& getSourceLanguage()
Definition:
class.ilMD5295TaxonPath.php:80
ilMD5295TaxonPath\_getIds
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
Definition:
class.ilMD5295TaxonPath.php:218
ilMD5295TaxonPath\__getFields
__getFields()
Definition:
class.ilMD5295TaxonPath.php:146
ilMD5295Base\setObjType
setObjType($a_type)
Definition:
class.ilMD5295Base.php:109
ilMD5295Base\getParentType
getParentType()
Definition:
class.ilMD5295Base.php:133
ilMD5295Taxon
Definition:
class.ilMD5295Taxon.php:33
ilMD5295TaxonPath\toXML
toXML(&$writer)
Definition:
class.ilMD5295TaxonPath.php:188
ilMD5295LanguageItem
Definition:
class.ilMD5295LanguageItem.php:32
ilMD5295TaxonPath\setSource
setSource($a_source)
Definition:
class.ilMD5295TaxonPath.php:66
ilMD5295Base\getParentId
getParentId()
Definition:
class.ilMD5295Base.php:141
ilMD5295Base\setParentType
setParentType($a_parent_type)
Definition:
class.ilMD5295Base.php:129
ilMD5295TaxonPath\getTaxon
& getTaxon($a_taxon_id)
Definition:
class.ilMD5295TaxonPath.php:42
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMD5295Taxon\_getIds
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
Definition:
class.ilMD5295Taxon.php:179
ilMD5295Base\setParentId
setParentId($a_id)
Definition:
class.ilMD5295Base.php:137
ilMD5295Base
Definition:
class.ilMD5295Base.php:32
ilMD5295Base\setRBACId
setRBACId($a_id)
Definition:
class.ilMD5295Base.php:93
ilMD5295Base\setObjId
setObjId($a_id)
Definition:
class.ilMD5295Base.php:101
$DIC
global $DIC
Definition:
goto.php:24
ilMD5295TaxonPath\getTaxonIds
& getTaxonIds()
Definition:
class.ilMD5295TaxonPath.php:36
ilMD5295TaxonPath
Definition:
class.ilMD5295TaxonPath.php:33
ilMD5295TaxonPath\getSourceLanguageCode
getSourceLanguageCode()
Definition:
class.ilMD5295TaxonPath.php:84
$query
$query
Definition:
proxy_ylocal.php:13
ilMD5295TaxonPath\read
read()
Definition:
class.ilMD5295TaxonPath.php:157
ilMD5295TaxonPath\setSourceLanguage
setSourceLanguage(&$lng_obj)
Definition:
class.ilMD5295TaxonPath.php:74
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMD5295TaxonPath\addTaxon
& addTaxon()
Definition:
class.ilMD5295TaxonPath.php:54
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:11
$source
$source
Definition:
metadata.php:76
ilMD5295TaxonPath\update
update()
Definition:
class.ilMD5295TaxonPath.php:106
ilMD5295Base\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMD5295Base.php:117
Services
Migration
DBUpdate_5295
classes
class.ilMD5295TaxonPath.php
Generated on Wed Apr 9 2025 21:01:43 for ILIAS by
1.8.13 (using
Doxyfile
)