19 declare(strict_types=1);
39 $db = $DIC->database();
44 public function isDone(
int $activeId): bool
46 $result = $this->db->queryF(
47 "SELECT done FROM " . self::TABLE_NAME .
" WHERE active_id = %s AND done = 1",
52 return $result->numRows() === 1;
55 public function exists(
int $activeId): bool
57 $result = $this->db->queryF(
58 "SELECT active_id FROM " . self::TABLE_NAME .
" WHERE active_id = %s",
63 return $result->numRows() === 1;
66 public function setDone(
int $activeId,
bool $done): void
68 if ($this->
exists($activeId)) {
69 $this->db->manipulateF(
70 "UPDATE " . self::TABLE_NAME .
" SET done = %s WHERE active_id = %s",
71 [
"integer",
"integer"],
77 $this->db->manipulateF(
78 "INSERT INTO " . self::TABLE_NAME .
" (active_id, done) VALUES (%s, %s)",
79 [
"integer",
"integer"],
__construct(?ilDBInterface $db=null)
setDone(int $activeId, bool $done)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...