ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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.

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

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

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
+ 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  {
77  return $this->last_update = new ilDateTime();
78  }
79  return $this->last_update;
80  }
Date and time handling
+ Here is the caller graph for this function:

◆ getStatus()

ilSCTask::getStatus ( )

Get status.

Returns
int

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

References $status.

Referenced by create(), and update().

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

◆ read()

ilSCTask::read ( )

Read group.

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

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

Referenced by __construct().

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(ilDBConstants::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  }
setStatus($a_status)
const IL_CAL_DATETIME
setIdentifier($a_ide)
Date and time handling
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 82 of file class.ilSCTask.php.

Referenced by read().

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

◆ update()

ilSCTask::update ( )

Update task.

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

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

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  }
const IL_CAL_DATETIME
getStatus()
Get status.
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: