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.ilMD5295Entity.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
32
include_once
'class.ilMD5295Base.php'
;
33
34
class
ilMD5295Entity
extends
ilMD5295Base
35
{
36
// SET/GET
37
public
function
setEntity
($a_entity)
38
{
39
$this->entity = $a_entity;
40
}
41
public
function
getEntity
()
42
{
43
return
$this->entity;
44
}
45
46
public
function
save
()
47
{
48
global
$DIC
;
49
50
$ilDB
= $DIC[
'ilDB'
];
51
52
$fields = $this->
__getFields
();
53
$fields[
'meta_entity_id'
] = array(
'integer'
,$next_id =
$ilDB
->nextId(
'il_meta_entity'
));
54
55
if
($this->db->insert(
'il_meta_entity'
, $fields)) {
56
$this->
setMetaId
($next_id);
57
return
$this->
getMetaId
();
58
}
59
return
false
;
60
}
61
62
public
function
update
()
63
{
64
global
$DIC
;
65
66
$ilDB
= $DIC[
'ilDB'
];
67
68
if
($this->
getMetaId
()) {
69
if
($this->db->update(
70
'il_meta_entity'
,
71
$this->__getFields(),
72
array(
"meta_entity_id"
=> array(
'integer'
,$this->
getMetaId
()))
73
)) {
74
return
true
;
75
}
76
}
77
return
false
;
78
}
79
80
public
function
delete
()
81
{
82
global
$DIC
;
83
84
$ilDB
= $DIC[
'ilDB'
];
85
86
if
($this->
getMetaId
()) {
87
$query
=
"DELETE FROM il_meta_entity "
.
88
"WHERE meta_entity_id = "
.
$ilDB
->quote($this->
getMetaId
(),
'integer'
);
89
$res
=
$ilDB
->manipulate(
$query
);
90
91
$this->db->query(
$query
);
92
93
return
true
;
94
}
95
return
false
;
96
}
97
98
99
public
function
__getFields
()
100
{
101
return
array(
'rbac_id'
=> array(
'integer'
,$this->
getRBACId
()),
102
'obj_id'
=> array(
'integer'
,$this->
getObjId
()),
103
'obj_type'
=> array(
'text'
,$this->
getObjType
()),
104
'parent_type'
=> array(
'text'
,$this->
getParentType
()),
105
'parent_id'
=> array(
'integer'
,$this->
getParentId
()),
106
'entity'
=> array(
'text'
,$this->
getEntity
()));
107
}
108
109
public
function
read
()
110
{
111
global
$DIC
;
112
113
$ilDB
= $DIC[
'ilDB'
];
114
115
if
($this->
getMetaId
()) {
116
$query
=
"SELECT * FROM il_meta_entity "
.
117
"WHERE meta_entity_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->
setEntity
($row->entity);
127
}
128
}
129
return
true
;
130
}
131
132
/*
133
* XML Export of all meta data
134
* @param object (xml writer) see class.ilMD52952XML.php
135
*
136
*/
137
public
function
toXML
(&$writer)
138
{
139
$writer->xmlElement(
'Entity'
, null, $this->
getEntity
());
140
}
141
142
143
// STATIC
144
public
static
function
_getIds
($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
145
{
146
global
$DIC
;
147
148
$ilDB
= $DIC[
'ilDB'
];
149
150
$query
=
"SELECT meta_entity_id FROM il_meta_entity "
.
151
"WHERE rbac_id = "
.
$ilDB
->quote($a_rbac_id,
'integer'
) .
" "
.
152
"AND obj_id = "
.
$ilDB
->quote($a_obj_id,
'integer'
) .
" "
.
153
"AND parent_id = "
.
$ilDB
->quote($a_parent_id,
'integer'
) .
" "
.
154
"AND parent_type = "
.
$ilDB
->quote($a_parent_type,
'text'
) .
" "
.
155
"ORDER BY meta_entity_id "
;
156
157
$res
=
$ilDB
->query(
$query
);
158
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
159
$ids[] = $row->meta_entity_id;
160
}
161
return
$ids ? $ids : array();
162
}
163
}
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
ilMD5295Entity\save
save()
Definition:
class.ilMD5295Entity.php:46
ilMD5295Entity
Definition:
class.ilMD5295Entity.php:34
ilMD5295Entity\_getIds
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
Definition:
class.ilMD5295Entity.php:144
ilMD5295Base\setObjType
setObjType($a_type)
Definition:
class.ilMD5295Base.php:109
ilMD5295Base\getParentType
getParentType()
Definition:
class.ilMD5295Base.php:133
ilMD5295Entity\__getFields
__getFields()
Definition:
class.ilMD5295Entity.php:99
ilMD5295Entity\read
read()
Definition:
class.ilMD5295Entity.php:109
ilMD5295Entity\getEntity
getEntity()
Definition:
class.ilMD5295Entity.php:41
ilMD5295Base\getParentId
getParentId()
Definition:
class.ilMD5295Base.php:141
ilMD5295Base\setParentType
setParentType($a_parent_type)
Definition:
class.ilMD5295Base.php:129
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
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
ilMD5295Entity\setEntity
setEntity($a_entity)
Definition:
class.ilMD5295Entity.php:37
$query
$query
Definition:
proxy_ylocal.php:13
ilMD5295Entity\update
update()
Definition:
class.ilMD5295Entity.php:62
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMD5295Entity\toXML
toXML(&$writer)
Definition:
class.ilMD5295Entity.php:137
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:11
ilMD5295Base\setMetaId
setMetaId($a_meta_id, $a_read_data=true)
Definition:
class.ilMD5295Base.php:117
Services
Migration
DBUpdate_5295
classes
class.ilMD5295Entity.php
Generated on Sat Apr 5 2025 21:01:34 for ILIAS by
1.8.13 (using
Doxyfile
)