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.ilMD5295Annotation.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
ilMD5295Annotation
extends
ilMD5295Base
34
{
35
// SET/GET
36
public
function
setEntity
($a_entity)
37
{
38
$this->entity = $a_entity;
39
}
40
public
function
getEntity
()
41
{
42
return
$this->entity;
43
}
44
public
function
setDate
($a_date)
45
{
46
$this->date = $a_date;
47
}
48
public
function
getDate
()
49
{
50
return
$this->date;
51
}
52
public
function
setDescription
($a_desc)
53
{
54
$this->description = $a_desc;
55
}
56
public
function
getDescription
()
57
{
58
return
$this->description;
59
}
60
public
function
setDescriptionLanguage
($lng_obj)
61
{
62
if
(is_object($lng_obj)) {
63
$this->description_language = &$lng_obj;
64
}
65
}
66
public
function
&
getDescriptionLanguage
()
67
{
68
return
$this->description_language;
69
}
70
public
function
getDescriptionLanguageCode
()
71
{
72
if
(is_object($this->description_language)) {
73
return
$this->description_language->getLanguageCode();
74
}
75
return
false
;
76
}
77
78
public
function
save
()
79
{
80
global
$DIC
;
81
82
$ilDB
= $DIC[
'ilDB'
];
83
84
$fields = $this->
__getFields
();
85
$fields[
'meta_annotation_id'
] = array(
'integer'
,$next_id =
$ilDB
->nextId(
'il_meta_annotation'
));
86
87
if
($this->db->insert(
'il_meta_annotation'
, $fields)) {
88
$this->
setMetaId
($next_id);
89
return
$this->
getMetaId
();
90
}
91
return
false
;
92
}
93
94
public
function
update
()
95
{
96
global
$DIC
;
97
98
$ilDB
= $DIC[
'ilDB'
];
99
100
if
($this->
getMetaId
()) {
101
if
($this->db->update(
102
'il_meta_annotation'
,
103
$this->__getFields(),
104
array(
"meta_annotation_id"
=> array(
'integer'
,$this->
getMetaId
()))
105
)) {
106
return
true
;
107
}
108
}
109
return
false
;
110
}
111
112
public
function
delete
()
113
{
114
global
$DIC
;
115
116
$ilDB
= $DIC[
'ilDB'
];
117
118
if
($this->
getMetaId
()) {
119
$query
=
"DELETE FROM il_meta_annotation "
.
120
"WHERE meta_annotation_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
121
$res
=
$ilDB
->manipulate(
$query
);
122
123
return
true
;
124
}
125
return
false
;
126
}
127
128
129
public
function
__getFields
()
130
{
131
return
array(
'rbac_id'
=> array(
'integer'
,$this->
getRBACId
()),
132
'obj_id'
=> array(
'integer'
,$this->
getObjId
()),
133
'obj_type'
=> array(
'text'
,$this->
getObjType
()),
134
'entity'
=> array(
'clob'
,$this->
getEntity
()),
135
'a_date'
=> array(
'clob'
,$this->
getDate
()),
136
'description'
=> array(
'clob'
,$this->
getDescription
()),
137
'description_language'
=> array(
'text'
,$this->
getDescriptionLanguageCode
()));
138
}
139
140
public
function
read
()
141
{
142
global
$DIC
;
143
144
$ilDB
= $DIC[
'ilDB'
];
145
146
include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.php'
;
147
148
if
($this->
getMetaId
()) {
149
$query
=
"SELECT * FROM il_meta_annotation "
.
150
"WHERE meta_annotation_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
151
152
$res
= $this->db->query(
$query
);
153
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
154
$this->
setRBACId
($row->rbac_id);
155
$this->
setObjId
($row->obj_id);
156
$this->
setObjType
($row->obj_type);
157
$this->
setEntity
($row->entity);
158
$this->
setDate
($row->a_date);
159
$this->
setDescription
($row->description);
160
$this->description_language =
new
ilMD5295LanguageItem
($row->description_language);
161
}
162
}
163
return
true
;
164
}
165
166
/*
167
* XML Export of all meta data
168
* @param object (xml writer) see class.ilMD52952XML.php
169
*
170
*/
171
public
function
toXML
(&$writer)
172
{
173
$writer->xmlStartTag(
'Annotation'
);
174
$writer->xmlElement(
'Entity'
, null, $this->
getEntity
());
175
$writer->xmlElement(
'Date'
, null, $this->
getDate
());
176
$writer->xmlElement(
177
'Description'
,
178
array(
'Language'
=> $this->
getDescriptionLanguageCode
()
179
? $this->
getDescriptionLanguageCode
()
180
:
'en'
),
181
$this->
getDescription
()
182
);
183
$writer->xmlEndTag(
'Annotation'
);
184
}
185
186
187
188
// STATIC
189
public
static
function
_getIds
($a_rbac_id, $a_obj_id)
190
{
191
global
$DIC
;
192
193
$ilDB
= $DIC[
'ilDB'
];
194
195
$query
=
"SELECT meta_annotation_id FROM il_meta_annotation "
.
196
"WHERE rbac_id = "
.
$ilDB
->quote($a_rbac_id,
'integer'
) .
" "
.
197
"AND obj_id = "
.
$ilDB
->quote($a_obj_id,
'integer'
);
198
199
200
$res
=
$ilDB
->query(
$query
);
201
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
202
$ids[] = $row->meta_annotation_id;
203
}
204
return
$ids ? $ids : array();
205
}
206
}
ilMD5295Base\getMetaId
getMetaId()
Definition:
class.ilMD5295Base.php:125
ilMD5295Base\getObjId
getObjId()
Definition:
class.ilMD5295Base.php:105
ilMD5295Base\getRBACId
getRBACId()
Definition:
class.ilMD5295Base.php:97
ilMD5295Base\getObjType
getObjType()
Definition:
class.ilMD5295Base.php:113
ilMD5295Annotation\getDescription
getDescription()
Definition:
class.ilMD5295Annotation.php:56
ilMD5295Annotation\getDate
getDate()
Definition:
class.ilMD5295Annotation.php:48
ilMD5295Base\setObjType
setObjType($a_type)
Definition:
class.ilMD5295Base.php:109
ilMD5295Annotation\getDescriptionLanguageCode
getDescriptionLanguageCode()
Definition:
class.ilMD5295Annotation.php:70
ilMD5295LanguageItem
Definition:
class.ilMD5295LanguageItem.php:32
ilMD5295Annotation\read
read()
Definition:
class.ilMD5295Annotation.php:140
ilMD5295Annotation\save
save()
Definition:
class.ilMD5295Annotation.php:78
ilMD5295Annotation\getEntity
getEntity()
Definition:
class.ilMD5295Annotation.php:40
ilMD5295Annotation\update
update()
Definition:
class.ilMD5295Annotation.php:94
ilMD5295Annotation\setDate
setDate($a_date)
Definition:
class.ilMD5295Annotation.php:44
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMD5295Base
Definition:
class.ilMD5295Base.php:32
ilMD5295Annotation\toXML
toXML(&$writer)
Definition:
class.ilMD5295Annotation.php:171
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
$query
$query
Definition:
proxy_ylocal.php:13
ilMD5295Annotation
Definition:
class.ilMD5295Annotation.php:33
ilMD5295Annotation\setEntity
setEntity($a_entity)
Definition:
class.ilMD5295Annotation.php:36
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMD5295Annotation\_getIds
static _getIds($a_rbac_id, $a_obj_id)
Definition:
class.ilMD5295Annotation.php:189
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:11
ilMD5295Annotation\setDescription
setDescription($a_desc)
Definition:
class.ilMD5295Annotation.php:52
ilMD5295Annotation\setDescriptionLanguage
setDescriptionLanguage($lng_obj)
Definition:
class.ilMD5295Annotation.php:60
ilMD5295Base\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMD5295Base.php:117
ilMD5295Annotation\__getFields
__getFields()
Definition:
class.ilMD5295Annotation.php:129
ilMD5295Annotation\getDescriptionLanguage
& getDescriptionLanguage()
Definition:
class.ilMD5295Annotation.php:66
Services
Migration
DBUpdate_5295
classes
class.ilMD5295Annotation.php
Generated on Sat Apr 5 2025 21:01:33 for ILIAS by
1.8.13 (using
Doxyfile
)