ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSCTask Class Reference

Defines a system check task. More...

+ Inheritance diagram for ilSCTask:
+ 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...
 
 isActive ()
 
 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 131 of file class.ilSCTask.php.

132 {
133 global $DIC;
134
135 $ilDB = $DIC['ilDB'];
136
137 $this->id = $ilDB->nextId('sysc_tasks');
138
139 $query = 'INSERT INTO sysc_tasks (id,grp_id,status,identifier) ' .
140 'VALUES ( ' .
141 $ilDB->quote($this->getId(), 'integer') . ', ' .
142 $ilDB->quote($this->getGroupId(), 'integer') . ', ' .
143 $ilDB->quote($this->getStatus(), 'integer') . ', ' .
144 $ilDB->quote($this->getIdentifier(), 'text') . ' ' .
145 ')';
146 $ilDB->manipulate($query);
147 return $this->getId();
148 }
getStatus()
Get status.
$query
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, $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:

◆ isActive()

ilSCTask::isActive ( )
Returns
bool check if task is active

Reimplemented in ilSCTreeDumpTask.

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

99 {
100 return true;
101 }

◆ read()

ilSCTask::read ( )

Read group.

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

107 {
108 global $DIC;
109
110 $ilDB = $DIC['ilDB'];
111
112 if (!$this->getId()) {
113 return false;
114 }
115
116 $query = 'SELECT * FROM sysc_tasks ' .
117 'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
118 $res = $ilDB->query($query);
119 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
120 $this->setGroupId($row->grp_id);
121 $this->setLastUpdate(new ilDateTime($row->last_update, IL_CAL_DATETIME, ilTimeZone::UTC));
122 $this->setStatus($row->status);
123 $this->setIdentifier($row->identifier);
124 }
125 return true;
126 }
const IL_CAL_DATETIME
setStatus($a_status)
setGroupId($a_id)
setLastUpdate(ilDateTime $a_update)
setIdentifier($a_ide)
$row
foreach($_POST as $key=> $value) $res

References $DIC, $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 153 of file class.ilSCTask.php.

154 {
155 global $DIC;
156
157 $ilDB = $DIC['ilDB'];
158
159 $query = 'UPDATE sysc_tasks SET ' .
160 'last_update = ' . $ilDB->quote($this->getLastUpdate()->get(IL_CAL_DATETIME, '', ilTimeZone::UTC), 'timestamp') . ', ' .
161 'status = ' . $ilDB->quote($this->getStatus(), 'integer') . ', ' .
162 'identifier = ' . $ilDB->quote($this->getIdentifier(), 'text') . ' ' .
163 'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
164 $ilDB->manipulate($query);
165 }
getLastUpdate()
Get last update date.

References $DIC, $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: