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.

References read().

33  {
34  $this->id = $a_id;
35  $this->read();
36  }
read()
Read group.
+ 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.

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

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  }
global $DIC
Definition: saml.php:7
getStatus()
Get status.
$query
global $ilDB
+ Here is the call graph for this function:

◆ getGroupId()

ilSCTask::getGroupId ( )

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

References $grp_id.

Referenced by create().

49  {
50  return $this->grp_id;
51  }
+ Here is the caller graph for this function:

◆ getId()

ilSCTask::getId ( )

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

References $id.

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

39  {
40  return $this->id;
41  }
+ Here is the caller graph for this function:

◆ getIdentifier()

ilSCTask::getIdentifier ( )

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

References $identifier.

Referenced by create(), and update().

59  {
60  return $this->identifier;
61  }
+ 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.

References $last_update.

Referenced by update().

74  {
75  if (!$this->last_update) {
76  return $this->last_update = new ilDateTime();
77  }
78  return $this->last_update;
79  }
Date and time handling
+ Here is the caller graph for this function:

◆ getStatus()

ilSCTask::getStatus ( )

Get status.

Returns
int

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

References $status.

Referenced by create(), and update().

91  {
92  return $this->status;
93  }
+ Here is the caller graph for this function:

◆ isActive()

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

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.

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

Referenced by __construct().

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  }
setStatus($a_status)
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
setIdentifier($a_ide)
foreach($_POST as $key=> $value) $res
Date and time handling
$query
$row
global $ilDB
setLastUpdate(ilDateTime $a_update)
setGroupId($a_id)
+ 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.

Referenced by read().

44  {
45  $this->grp_id = $a_id;
46  }
+ Here is the caller graph for this function:

◆ setIdentifier()

ilSCTask::setIdentifier (   $a_ide)

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

Referenced by read().

54  {
55  $this->identifier = $a_ide;
56  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilSCTask::setLastUpdate ( ilDateTime  $a_update)

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

Referenced by read().

65  {
66  $this->last_update = $a_update;
67  }
+ Here is the caller graph for this function:

◆ setStatus()

ilSCTask::setStatus (   $a_status)

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

Referenced by read().

82  {
83  $this->status = $a_status;
84  }
+ Here is the caller graph for this function:

◆ update()

ilSCTask::update ( )

Update task.

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

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

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  }
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
getStatus()
Get status.
$query
global $ilDB
getLastUpdate()
Get last update date.
+ 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: