ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 124 of file class.ilSCTask.php.

125 {
126 global $ilDB;
127
128 $this->id = $ilDB->nextId('sysc_tasks');
129
130 $query = 'INSERT INTO sysc_tasks (id,grp_id,status,identifier) '.
131 'VALUES ( '.
132 $ilDB->quote($this->getId(),'integer').', '.
133 $ilDB->quote($this->getGroupId(),'integer').', '.
134 $ilDB->quote($this->getStatus(),'integer').', '.
135 $ilDB->quote($this->getIdentifier(),'text').' '.
136 ')';
137 $ilDB->manipulate($query);
138 return $this->getId();
139 }
getStatus()
Get status.
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 {
77 return $this->last_update = new ilDateTime();
78 }
79 return $this->last_update;
80 }
@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 91 of file class.ilSCTask.php.

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

References $status.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ read()

ilSCTask::read ( )

Read group.

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

100 {
101 global $ilDB;
102
103 if(!$this->getId())
104 {
105 return false;
106 }
107
108 $query = 'SELECT * FROM sysc_tasks '.
109 'WHERE id = '.$ilDB->quote($this->getId(),'integer');
110 $res = $ilDB->query($query);
111 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
112 {
113 $this->setGroupId($row->grp_id);
114 $this->setLastUpdate(new ilDateTime($row->last_update,IL_CAL_DATETIME,'UTC'));
115 $this->setStatus($row->status);
116 $this->setIdentifier($row->identifier);
117 }
118 return true;
119 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
const IL_CAL_DATETIME
setStatus($a_status)
setGroupId($a_id)
setLastUpdate(ilDateTime $a_update)
setIdentifier($a_ide)

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getId(), IL_CAL_DATETIME, setGroupId(), setIdentifier(), setLastUpdate(), and setStatus().

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 82 of file class.ilSCTask.php.

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

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilSCTask::update ( )

Update task.

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

145 {
146 global $ilDB;
147
148 $query = 'UPDATE sysc_tasks SET '.
149 'last_update = '.$ilDB->quote($this->getLastUpdate()->get(IL_CAL_DATETIME,'',UTC),'timestamp').', '.
150 'status = '.$ilDB->quote($this->getStatus(),'integer').', '.
151 'identifier = '.$ilDB->quote($this->getIdentifier(),'text').' '.
152 'WHERE id = '.$ilDB->quote($this->getId(),'integer');
153 $ilDB->manipulate($query);
154 }
getLastUpdate()
Get last update date.

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

+ 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: