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.ilLinkResourceList.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4
10
class
ilLinkResourceList
11
{
15
protected
$webr_id
;
16
20
protected
$title
;
21
25
protected
$description
;
26
30
protected
$c_date
;
31
35
protected
$m_date
;
36
41
public
function
__construct
(
int
$webr_id
)
42
{
43
global
$DIC
;
44
45
$this->db = $DIC->database();
46
$this->webr_id =
$webr_id
;
47
48
$this->
read
();
49
}
50
54
public
function
setListResourceId
(
int
$a_id)
55
{
56
$this->webr_id = $a_id;
57
}
58
62
public
function
getListResourceId
()
63
{
64
return
$this->webr_id
;
65
}
66
70
public
function
setTitle
(
string
$a_title)
71
{
72
$this->title = $a_title;
73
}
74
78
public
function
getTitle
()
79
{
80
return
$this->title
;
81
}
82
86
public
function
setDescription
(
string
$a_description)
87
{
88
$this->description = $a_description;
89
}
90
94
public
function
getDescription
()
95
{
96
return
$this->description
;
97
}
98
102
protected
function
setCreateDate
(
int
$a_date)
103
{
104
$this->c_date = $a_date;
105
}
106
110
public
function
getCreateDate
()
111
{
112
return
$this->c_date
;
113
}
114
118
protected
function
setLastUpdateDate
(
int
$a_date)
119
{
120
$this->m_date = $a_date;
121
}
122
126
public
function
getLastUpdateDate
()
127
{
128
return
$this->m_date
;
129
}
130
131
135
public
function
read
()
136
{
137
$ilDB
= $this->db;
138
139
$query
=
"SELECT * FROM webr_lists "
.
140
"WHERE webr_id = "
.
$ilDB
->quote($this->
getListResourceId
(),
'integer'
);
141
142
$res
=
$ilDB
->query(
$query
);
143
if
(
$ilDB
->numRows(
$res
)) {
144
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
145
$this->
setTitle
((
string
) $row->title);
146
$this->
setDescription
((
string
) $row->description);
147
$this->
setCreateDate
((
int
) $row->create_date);
148
$this->
setLastUpdateDate
((
int
) $row->last_update);
149
}
150
return
true
;
151
}
152
return
false
;
153
}
154
159
public
function
delete
(
bool
$a_update_history =
true
)
160
{
161
$ilDB
= $this->db;
162
163
$query
=
"DELETE FROM webr_lists "
.
164
"WHERE webr_id = "
.
$ilDB
->quote($this->
getListResourceId
(),
'integer'
);
165
$res
=
$ilDB
->manipulate(
$query
);
166
167
if
($a_update_history) {
168
ilHistory::_createEntry
(
169
$this->
getListResourceId
(),
170
"delete"
,
171
$this->
getTitle
()
172
);
173
}
174
175
return
true
;
176
}
177
182
public
function
update
($a_update_history =
true
)
183
{
184
$ilDB
= $this->db;
185
186
if
(!$this->
getListResourceId
()) {
187
return
false
;
188
}
189
190
$this->
setLastUpdateDate
(time());
191
$query
=
"UPDATE webr_lists "
.
192
"SET title = "
.
$ilDB
->quote($this->
getTitle
(),
'text'
) .
", "
.
193
"description = "
.
$ilDB
->quote($this->
getDescription
(),
'text'
) .
", "
.
194
"last_update = "
.
$ilDB
->quote($this->
getLastUpdateDate
(),
'integer'
) .
" "
.
195
"WHERE webr_id = "
.
$ilDB
->quote($this->
getListResourceId
(),
'integer'
);
196
$res
=
$ilDB
->manipulate(
$query
);
197
198
if
($a_update_history) {
199
ilHistory::_createEntry
(
200
$this->
getListResourceId
(),
201
"update"
,
202
$this->
getTitle
()
203
);
204
}
205
206
return
true
;
207
}
208
213
public
function
add
($a_update_history =
true
)
214
{
215
$ilDB
= $this->db;
216
217
$now = time();
218
$this->
setCreateDate
($now);
219
$this->
setLastUpdateDate
($now);
220
221
$query
=
"INSERT INTO webr_lists (title,description,last_update,create_date,webr_id) "
.
222
"VALUES( "
.
223
$ilDB
->quote($this->
getTitle
(),
'text'
) .
", "
.
224
$ilDB
->quote($this->
getDescription
(),
'text'
) .
", "
.
225
$ilDB
->quote($this->
getLastUpdateDate
(),
'integer'
) .
", "
.
226
$ilDB
->quote($this->
getCreateDate
(),
'integer'
) .
", "
.
227
$ilDB
->quote($this->
getListResourceId
(),
'integer'
) .
" "
.
228
")"
;
229
$res
=
$ilDB
->manipulate(
$query
);
230
231
if
($a_update_history) {
232
ilHistory::_createEntry
(
233
$this->
getListResourceId
(),
234
"add"
,
235
$this->
getTitle
()
236
);
237
}
238
239
return
true
;
240
}
241
246
public
static
function
lookupList
(
int
$a_webr_id)
247
{
248
global
$DIC
;
249
250
$ilDB
= $DIC->database();
251
252
$query
=
"SELECT * FROM webr_lists "
.
253
"WHERE webr_id = "
.
$ilDB
->quote($a_webr_id,
'integer'
);
254
255
$res
=
$ilDB
->query(
$query
);
256
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
257
$list[
'title'
] = $row->title;
258
$list[
'description'
] = $row->description;
259
$list[
'create_date'
] = $row->create_date;
260
$list[
'last_update'
] = $row->last_update;
261
$list[
'webr_id'
] = $row->webr_id;
262
}
263
return
$list ? $list : array();
264
}
265
269
public
static
function
lookupAllLists
()
270
{
271
global
$DIC
;
272
273
$ilDB
= $DIC->database();
274
275
$query
=
"SELECT * FROM webr_lists"
;
276
277
$res
=
$ilDB
->query(
$query
);
278
while
($row =
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
279
$lists[$row->webr_id][
'title'
] = $row->title;
280
$lists[$row->webr_id][
'description'
] = $row->description;
281
$lists[$row->webr_id][
'create_date'
] = $row->create_date;
282
$lists[$row->webr_id][
'last_update'
] = $row->last_update;
283
$lists[$row->webr_id][
'webr_id'
] = $row->webr_id;
284
}
285
return
$lists ? $lists : array();
286
}
287
292
public
static
function
checkListStatus
(
int
$a_webr_id)
293
{
294
global
$DIC
;
295
296
$ilDB
= $DIC->database();
297
298
$query
=
"SELECT * FROM webr_lists "
.
299
"WHERE webr_id = "
.
$ilDB
->quote($a_webr_id,
'integer'
);
300
301
$res
=
$ilDB
->query(
$query
);
302
if
(
$ilDB
->numRows(
$res
)) {
303
return
true
;
304
}
305
return
false
;
306
}
307
}
ilLinkResourceList\setTitle
setTitle(string $a_title)
Definition:
class.ilLinkResourceList.php:70
ilLinkResourceList\getListResourceId
getListResourceId()
Definition:
class.ilLinkResourceList.php:62
ilLinkResourceList\add
add($a_update_history=true)
Definition:
class.ilLinkResourceList.php:213
ilLinkResourceList\getTitle
getTitle()
Definition:
class.ilLinkResourceList.php:78
ilLinkResourceList\getLastUpdateDate
getLastUpdateDate()
Definition:
class.ilLinkResourceList.php:126
ilHistory\_createEntry
static _createEntry( $a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
Definition:
class.ilHistory.php:31
ilLinkResourceList\read
read()
Definition:
class.ilLinkResourceList.php:135
ilLinkResourceList\setListResourceId
setListResourceId(int $a_id)
Definition:
class.ilLinkResourceList.php:54
ilLinkResourceList\lookupAllLists
static lookupAllLists()
Definition:
class.ilLinkResourceList.php:269
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilLinkResourceList\lookupList
static lookupList(int $a_webr_id)
Definition:
class.ilLinkResourceList.php:246
ilLinkResourceList\$c_date
$c_date
Definition:
class.ilLinkResourceList.php:30
ilLinkResourceList\__construct
__construct(int $webr_id)
ilLinkResourceList constructor.
Definition:
class.ilLinkResourceList.php:41
ilLinkResourceList\setLastUpdateDate
setLastUpdateDate(int $a_date)
Definition:
class.ilLinkResourceList.php:118
$DIC
global $DIC
Definition:
goto.php:24
ilLinkResourceList\$title
$title
Definition:
class.ilLinkResourceList.php:20
$query
$query
Definition:
proxy_ylocal.php:13
ilLinkResourceList\getCreateDate
getCreateDate()
Definition:
class.ilLinkResourceList.php:110
ilLinkResourceList\$webr_id
$webr_id
Definition:
class.ilLinkResourceList.php:15
ilLinkResourceList\getDescription
getDescription()
Definition:
class.ilLinkResourceList.php:94
ilLinkResourceList\setCreateDate
setCreateDate(int $a_date)
Definition:
class.ilLinkResourceList.php:102
ilLinkResourceList\$description
$description
Definition:
class.ilLinkResourceList.php:25
ilLinkResourceList\setDescription
setDescription(string $a_description)
Definition:
class.ilLinkResourceList.php:86
ilLinkResourceList\checkListStatus
static checkListStatus(int $a_webr_id)
Check if a weblink list was already created or transformed from a single weblink. ...
Definition:
class.ilLinkResourceList.php:292
ilLinkResourceList\update
update($a_update_history=true)
Definition:
class.ilLinkResourceList.php:182
ilLinkResourceList
Class ilLinkResourceList.
Definition:
class.ilLinkResourceList.php:10
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:11
ilLinkResourceList\$m_date
$m_date
Definition:
class.ilLinkResourceList.php:35
Modules
WebResource
classes
class.ilLinkResourceList.php
Generated on Mon Apr 21 2025 21:01:04 for ILIAS by
1.8.13 (using
Doxyfile
)