ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSCTask Class Reference

Defines a system check task. More...

+ Inheritance diagram for ilSCTask:
+ Collaboration diagram for ilSCTask:

Public Member Functions

 __construct (int $a_id=0)
 
 getId ()
 
 setGroupId (int $a_id)
 
 getGroupId ()
 
 setIdentifier (string $a_ide)
 
 getIdentifier ()
 
 setLastUpdate (ilDateTime $a_update)
 
 getLastUpdate ()
 
 setStatus (int $a_status)
 
 getStatus ()
 
 isActive ()
 
 read ()
 
 create ()
 
 update ()
 

Data Fields

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

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $id = 0
 
int $grp_id = 0
 
ilDateTime $last_update = null
 
int $status = 0
 
string $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 24 of file class.ilSCTask.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCTask::__construct ( int  $a_id = 0)

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

40 {
41 global $DIC;
42
43 $this->db = $DIC->database();
44 $this->id = $a_id;
45 $this->read();
46 }
global $DIC
Definition: shib_login.php:26

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilSCTask::create ( )

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

119 : int
120 {
121 $this->id = $this->db->nextId('sysc_tasks');
122
123 $query = 'INSERT INTO sysc_tasks (id,grp_id,status,identifier) ' .
124 'VALUES ( ' .
125 $this->db->quote($this->getId(), ilDBConstants::T_INTEGER) . ', ' .
126 $this->db->quote($this->getGroupId(), ilDBConstants::T_INTEGER) . ', ' .
127 $this->db->quote($this->getStatus(), ilDBConstants::T_INTEGER) . ', ' .
128 $this->db->quote($this->getIdentifier(), ilDBConstants::T_TEXT) . ' ' .
129 ')';
130 $this->db->manipulate($query);
131 return $this->getId();
132 }

References getGroupId(), getId(), getIdentifier(), getStatus(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ getGroupId()

ilSCTask::getGroupId ( )

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

58 : int
59 {
60 return $this->grp_id;
61 }

References $grp_id.

Referenced by create().

+ Here is the caller graph for this function:

◆ getId()

ilSCTask::getId ( )

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

48 : int
49 {
50 return $this->id;
51 }

References $id.

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

+ Here is the caller graph for this function:

◆ getIdentifier()

ilSCTask::getIdentifier ( )

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

68 : string
69 {
70 return $this->identifier;
71 }
string $identifier

References $identifier.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getLastUpdate()

ilSCTask::getLastUpdate ( )

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

79 {
80 if (!$this->last_update) {
81 return $this->last_update = new ilDateTime();
82 }
83 return $this->last_update;
84 }
@classDescription Date and time handling
ilDateTime $last_update

References $last_update.

Referenced by update().

+ Here is the caller graph for this function:

◆ getStatus()

ilSCTask::getStatus ( )

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

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

References $status.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ isActive()

ilSCTask::isActive ( )

Reimplemented in ilSCTreeDumpTask.

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

96 : bool
97 {
98 return true;
99 }

◆ read()

ilSCTask::read ( )

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

101 : bool
102 {
103 if (!$this->getId()) {
104 return false;
105 }
106
107 $query = 'SELECT * FROM sysc_tasks ' .
108 'WHERE id = ' . $this->db->quote($this->getId(), ilDBConstants::T_INTEGER);
109 $res = $this->db->query($query);
110 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
111 $this->setGroupId((int) $row->grp_id);
112 $this->setLastUpdate(new ilDateTime($row->last_update, IL_CAL_DATETIME, ilTimeZone::UTC));
113 $this->setStatus((int) $row->status);
114 $this->setIdentifier((string) $row->identifier);
115 }
116 return true;
117 }
const IL_CAL_DATETIME
setGroupId(int $a_id)
setIdentifier(string $a_ide)
setStatus(int $a_status)
setLastUpdate(ilDateTime $a_update)
$res
Definition: ltiservices.php:69

References $res, ilDBConstants\FETCHMODE_OBJECT, getId(), IL_CAL_DATETIME, setGroupId(), setIdentifier(), setLastUpdate(), setStatus(), ilDBConstants\T_INTEGER, 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 ( int  $a_id)

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

53 : void
54 {
55 $this->grp_id = $a_id;
56 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setIdentifier()

ilSCTask::setIdentifier ( string  $a_ide)

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

63 : void
64 {
65 $this->identifier = $a_ide;
66 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLastUpdate()

ilSCTask::setLastUpdate ( ilDateTime  $a_update)

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

73 : void
74 {
75 $this->last_update = $a_update;
76 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStatus()

ilSCTask::setStatus ( int  $a_status)

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

86 : void
87 {
88 $this->status = $a_status;
89 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilSCTask::update ( )

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

134 : void
135 {
136 $query = 'UPDATE sysc_tasks SET ' .
137 'last_update = ' . $this->db->quote($this->getLastUpdate()->get(IL_CAL_DATETIME, '', ilTimeZone::UTC), ilDBConstants::T_TIMESTAMP) . ', ' .
138 'status = ' . $this->db->quote($this->getStatus(), ilDBConstants::T_INTEGER) . ', ' .
139 'identifier = ' . $this->db->quote($this->getIdentifier(), ilDBConstants::T_TEXT) . ' ' .
140 'WHERE id = ' . $this->db->quote($this->getId(), ilDBConstants::T_INTEGER);
141 $this->db->manipulate($query);
142 }

References getId(), getIdentifier(), getLastUpdate(), getStatus(), IL_CAL_DATETIME, ilDBConstants\T_INTEGER, ilDBConstants\T_TEXT, ilDBConstants\T_TIMESTAMP, and ilTimeZone\UTC.

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilSCTask::$db
protected

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

◆ $grp_id

int ilSCTask::$grp_id = 0
private

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

Referenced by getGroupId().

◆ $id

int ilSCTask::$id = 0
private

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

Referenced by getId().

◆ $identifier

string ilSCTask::$identifier = ''
private

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

Referenced by getIdentifier().

◆ $last_update

ilDateTime ilSCTask::$last_update = null
private

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

Referenced by getLastUpdate().

◆ $status

int ilSCTask::$status = 0
private

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

Referenced by getStatus().

◆ STATUS_COMPLETED

◆ STATUS_FAILED

◆ STATUS_IN_PROGRESS

const ilSCTask::STATUS_IN_PROGRESS = 1

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

Referenced by ilSCUtils\taskStatus2Text().

◆ STATUS_NOT_ATTEMPTED

const ilSCTask::STATUS_NOT_ATTEMPTED = 0

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

Referenced by ilSCUtils\taskStatus2Text().


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