19 declare(strict_types=1);
37 $this->db = $DIC->database();
38 $this->grp_id = $a_grp_id;
44 if (!array_key_exists($a_group_id, self::$instances)) {
45 return self::$instances[$a_group_id] =
new self($a_group_id);
47 return self::$instances[$a_group_id];
57 $db = $DIC->database();
58 $query =
'select identifier from sysc_tasks ' .
62 return (
string) $row->identifier;
69 foreach ($this->
getTasks() as $task) {
70 if ($task->getIdentifier() === $a_identifier) {
77 $task->setIdentifier($a_identifier);
80 return $task->getId();
87 $ilDB = $DIC->database();
89 $query =
'SELECT grp_id FROM sysc_tasks ' .
93 return (
int) $row->grp_id;
100 $tasks = self::getInstanceByGroupId($a_grp_id);
103 foreach ($tasks->getTasks() as $task) {
104 if (!$task->isActive()) {
111 return $num_completed;
116 $tasks = self::getInstanceByGroupId($a_grp_id);
119 foreach ($tasks->getTasks() as $task) {
120 if (!$task->isActive()) {
135 $ilDB = $DIC->database();
137 $query =
'SELECT MAX(last_update) last_update FROM sysc_tasks ' .
161 protected function read(): void
163 $query =
'SELECT id, grp_id FROM sysc_tasks ' .
165 $res = $this->db->query($query);
167 $this->tasks = array();
Defines a system check task.
static getInstanceByGroupId(int $a_group_id)
static getTask(int $a_group_id, int $a_task_id)
static lookupLastUpdate(int $a_grp_id)
static lookupFailed(int $a_grp_id)
static lookupIdentifierForTask(int $a_task_id)
quote($value, string $type)
updateFromComponentDefinition(string $a_identifier)
static lookupGroupId(int $a_task_id)
__construct(int $a_grp_id)
query(string $query)
Run a (read-only) Query on the database.
static lookupCompleted(int $a_grp_id)