ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilSCTask.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once
'./Services/Calendar/classes/class.ilDateTime.php'
;
6
12
class
ilSCTask
13
{
14
const
STATUS_NOT_ATTEMPTED
= 0;
15
const
STATUS_IN_PROGRESS
= 1;
16
const
STATUS_COMPLETED
= 2;
17
const
STATUS_FAILED
= 3;
18
19
20
21
private
$id
= 0;
22
private
$grp_id
= 0;
23
private
$last_update
= null;
24
private
$status
= 0;
25
private
$identifier
=
''
;
26
27
32
public
function
__construct
($a_id = 0)
33
{
34
$this->
id
= $a_id;
35
$this->
read
();
36
}
37
38
public
function
getId
()
39
{
40
return
$this->id
;
41
}
42
43
public
function
setGroupId
($a_id)
44
{
45
$this->grp_id = $a_id;
46
}
47
48
public
function
getGroupId
()
49
{
50
return
$this->grp_id
;
51
}
52
53
public
function
setIdentifier
($a_ide)
54
{
55
$this->identifier = $a_ide;
56
}
57
58
public
function
getIdentifier
()
59
{
60
return
$this->identifier
;
61
}
62
63
64
public
function
setLastUpdate
(
ilDateTime
$a_update)
65
{
66
$this->last_update = $a_update;
67
}
68
73
public
function
getLastUpdate
()
74
{
75
if
(!$this->last_update) {
76
return
$this->last_update =
new
ilDateTime
();
77
}
78
return
$this->last_update
;
79
}
80
81
public
function
setStatus
($a_status)
82
{
83
$this->status = $a_status;
84
}
85
90
public
function
getStatus
()
91
{
92
return
$this->status
;
93
}
94
98
public
function
read
()
99
{
100
global
$ilDB
;
101
102
if
(!$this->
getId
()) {
103
return
false
;
104
}
105
106
$query
=
'SELECT * FROM sysc_tasks '
.
107
'WHERE id = '
. $ilDB->quote($this->
getId
(),
'integer'
);
108
$res
= $ilDB->query(
$query
);
109
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
110
$this->
setGroupId
(
$row
->grp_id);
111
$this->
setLastUpdate
(
new
ilDateTime
(
$row
->last_update,
IL_CAL_DATETIME
,
ilTimeZone::UTC
));
112
$this->
setStatus
(
$row
->status);
113
$this->
setIdentifier
(
$row
->identifier);
114
}
115
return
true
;
116
}
117
121
public
function
create
()
122
{
123
global
$ilDB
;
124
125
$this->
id
= $ilDB->nextId(
'sysc_tasks'
);
126
127
$query
=
'INSERT INTO sysc_tasks (id,grp_id,status,identifier) '
.
128
'VALUES ( '
.
129
$ilDB->quote($this->
getId
(),
'integer'
) .
', '
.
130
$ilDB->quote($this->
getGroupId
(),
'integer'
) .
', '
.
131
$ilDB->quote($this->
getStatus
(),
'integer'
) .
', '
.
132
$ilDB->quote($this->
getIdentifier
(),
'text'
) .
' '
.
133
')'
;
134
$ilDB->manipulate(
$query
);
135
return
$this->
getId
();
136
}
137
141
public
function
update
()
142
{
143
global
$ilDB
;
144
145
$query
=
'UPDATE sysc_tasks SET '
.
146
'last_update = '
. $ilDB->quote($this->
getLastUpdate
()->
get
(
IL_CAL_DATETIME
,
''
,
ilTimeZone::UTC
),
'timestamp'
) .
', '
.
147
'status = '
. $ilDB->quote($this->
getStatus
(),
'integer'
) .
', '
.
148
'identifier = '
. $ilDB->quote($this->
getIdentifier
(),
'text'
) .
' '
.
149
'WHERE id = '
. $ilDB->quote($this->
getId
(),
'integer'
);
150
$ilDB->manipulate(
$query
);
151
}
152
}
ilSCTask\getGroupId
getGroupId()
Definition:
class.ilSCTask.php:48
ilSCTask
Defines a system check task.
Definition:
class.ilSCTask.php:12
ilSCTask\__construct
__construct($a_id=0)
Constructor.
Definition:
class.ilSCTask.php:32
ilSCTask\setStatus
setStatus($a_status)
Definition:
class.ilSCTask.php:81
IL_CAL_DATETIME
const IL_CAL_DATETIME
Definition:
class.ilDateTime.php:9
ilSCTask\STATUS_FAILED
const STATUS_FAILED
Definition:
class.ilSCTask.php:17
ilTimeZone\UTC
const UTC
Definition:
class.ilTimeZone.php:45
ilSCTask\setIdentifier
setIdentifier($a_ide)
Definition:
class.ilSCTask.php:53
ilSCTask\getStatus
getStatus()
Get status.
Definition:
class.ilSCTask.php:90
ilSCTask\$status
$status
Definition:
class.ilSCTask.php:24
ilSCTask\$identifier
$identifier
Definition:
class.ilSCTask.php:25
ilSCTask\getIdentifier
getIdentifier()
Definition:
class.ilSCTask.php:58
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilSCTask\create
create()
Create new group.
Definition:
class.ilSCTask.php:121
ilSCTask\$grp_id
$grp_id
Definition:
class.ilSCTask.php:22
ilDateTime
Date and time handling
Definition:
class.ilDateTime.php:32
ilSCTask\update
update()
Update task.
Definition:
class.ilSCTask.php:141
$query
$query
Definition:
proxy_ylocal.php:13
ilSCTask\$id
$id
Definition:
class.ilSCTask.php:21
ilSCTask\STATUS_IN_PROGRESS
const STATUS_IN_PROGRESS
Definition:
class.ilSCTask.php:15
ilSCTask\STATUS_COMPLETED
const STATUS_COMPLETED
Definition:
class.ilSCTask.php:16
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilSCTask\getId
getId()
Definition:
class.ilSCTask.php:38
ilSCTask\read
read()
Read group.
Definition:
class.ilSCTask.php:98
ilSCTask\getLastUpdate
getLastUpdate()
Get last update date.
Definition:
class.ilSCTask.php:73
ilSCTask\STATUS_NOT_ATTEMPTED
const STATUS_NOT_ATTEMPTED
Definition:
class.ilSCTask.php:14
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilSCTask\setLastUpdate
setLastUpdate(ilDateTime $a_update)
Definition:
class.ilSCTask.php:64
ilSCTask\setGroupId
setGroupId($a_id)
Definition:
class.ilSCTask.php:43
ilSCTask\$last_update
$last_update
Definition:
class.ilSCTask.php:23
Services
SystemCheck
classes
class.ilSCTask.php
Generated on Sat Mar 1 2025 19:01:39 for ILIAS by
1.8.13 (using
Doxyfile
)