ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSCTask Class Reference

Defines a system check task. More...

+ Collaboration diagram for ilSCTask:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 getId ()
 
 setGroupId ($a_id)
 
 getGroupId ()
 
 setIdentifier ($a_ide)
 
 getIdentifier ()
 
 setLastUpdate (ilDateTime $a_update)
 
 getLastUpdate ()
 Get last update date. More...
 
 setStatus ($a_status)
 
 getStatus ()
 Get status. More...
 
 read ()
 Read group. More...
 
 create ()
 Create new group. More...
 
 update ()
 Update task. More...
 

Data Fields

const STATUS_NOT_ATTEMPTED = 0
 
const STATUS_IN_PROGRESS = 1
 
const STATUS_COMPLETED = 2
 
const STATUS_FAILED = 3
 

Private Attributes

 $id = 0
 
 $grp_id = 0
 
 $last_update = null
 
 $status = 0
 
 $identifier = ''
 

Detailed Description

Defines a system check task.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 12 of file class.ilSCTask.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCTask::__construct (   $a_id = 0)

Constructor.

Parameters
type$a_id

Definition at line 32 of file class.ilSCTask.php.

33 {
34 $this->id = $a_id;
35 $this->read();
36 }
read()
Read group.

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilSCTask::create ( )

Create new group.

Definition at line 121 of file class.ilSCTask.php.

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 }
getStatus()
Get status.
$query
global $ilDB

References $ilDB, $query, getGroupId(), getId(), getIdentifier(), and getStatus().

+ Here is the call graph for this function:

◆ getGroupId()

ilSCTask::getGroupId ( )

Definition at line 48 of file class.ilSCTask.php.

49 {
50 return $this->grp_id;
51 }

References $grp_id.

Referenced by create().

+ Here is the caller graph for this function:

◆ getId()

ilSCTask::getId ( )

Definition at line 38 of file class.ilSCTask.php.

39 {
40 return $this->id;
41 }

References $id.

Referenced by create(), read(), and update().

+ Here is the caller graph for this function:

◆ getIdentifier()

ilSCTask::getIdentifier ( )

Definition at line 58 of file class.ilSCTask.php.

59 {
60 return $this->identifier;
61 }

References $identifier.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getLastUpdate()

ilSCTask::getLastUpdate ( )

Get last update date.

Returns
ilDateTime

Definition at line 73 of file class.ilSCTask.php.

74 {
75 if (!$this->last_update) {
76 return $this->last_update = new ilDateTime();
77 }
78 return $this->last_update;
79 }
@classDescription Date and time handling

References $last_update.

Referenced by update().

+ Here is the caller graph for this function:

◆ getStatus()

ilSCTask::getStatus ( )

Get status.

Returns
int

Definition at line 90 of file class.ilSCTask.php.

91 {
92 return $this->status;
93 }

References $status.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ read()

ilSCTask::read ( )

Read group.

Definition at line 98 of file class.ilSCTask.php.

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 }
const IL_CAL_DATETIME
setStatus($a_status)
setGroupId($a_id)
setLastUpdate(ilDateTime $a_update)
setIdentifier($a_ide)
foreach($_POST as $key=> $value) $res

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getId(), IL_CAL_DATETIME, setGroupId(), setIdentifier(), setLastUpdate(), setStatus(), and ilTimeZone\UTC.

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGroupId()

ilSCTask::setGroupId (   $a_id)

Definition at line 43 of file class.ilSCTask.php.

44 {
45 $this->grp_id = $a_id;
46 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setIdentifier()

ilSCTask::setIdentifier (   $a_ide)

Definition at line 53 of file class.ilSCTask.php.

54 {
55 $this->identifier = $a_ide;
56 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLastUpdate()

ilSCTask::setLastUpdate ( ilDateTime  $a_update)

Definition at line 64 of file class.ilSCTask.php.

65 {
66 $this->last_update = $a_update;
67 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStatus()

ilSCTask::setStatus (   $a_status)

Definition at line 81 of file class.ilSCTask.php.

82 {
83 $this->status = $a_status;
84 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilSCTask::update ( )

Update task.

Definition at line 141 of file class.ilSCTask.php.

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 }
getLastUpdate()
Get last update date.

References $ilDB, $query, getId(), getIdentifier(), getLastUpdate(), getStatus(), IL_CAL_DATETIME, and ilTimeZone\UTC.

+ Here is the call graph for this function:

Field Documentation

◆ $grp_id

ilSCTask::$grp_id = 0
private

Definition at line 22 of file class.ilSCTask.php.

Referenced by getGroupId().

◆ $id

ilSCTask::$id = 0
private

Definition at line 21 of file class.ilSCTask.php.

Referenced by getId().

◆ $identifier

ilSCTask::$identifier = ''
private

Definition at line 25 of file class.ilSCTask.php.

Referenced by getIdentifier().

◆ $last_update

ilSCTask::$last_update = null
private

Definition at line 23 of file class.ilSCTask.php.

Referenced by getLastUpdate().

◆ $status

ilSCTask::$status = 0
private

Definition at line 24 of file class.ilSCTask.php.

Referenced by getStatus().

◆ STATUS_COMPLETED

◆ STATUS_FAILED

◆ STATUS_IN_PROGRESS

const ilSCTask::STATUS_IN_PROGRESS = 1

Definition at line 15 of file class.ilSCTask.php.

Referenced by ilSCUtils\taskStatus2Text().

◆ STATUS_NOT_ATTEMPTED

const ilSCTask::STATUS_NOT_ATTEMPTED = 0

Definition at line 14 of file class.ilSCTask.php.

Referenced by ilSCUtils\taskStatus2Text().


The documentation for this class was generated from the following file: