18 declare(strict_types=1);
43 $this->db = $DIC->database();
44 $this->usr_id = $a_usr_id;
52 if (!isset(self::$instances[$a_usr_id])) {
53 self::$instances[$a_usr_id] =
new self($a_usr_id);
55 return self::$instances[$a_usr_id];
65 return array_key_exists(
"{$server_id}:{$a_mid}", $this->consents);
68 public function delete():
void 70 foreach ($this->consents as $mid => $consent) {
76 public function add(
int $server_id,
int $a_mid): void
81 $this->consents[
"{$server_id}:{$a_mid}"] = $consent;
85 protected function read(): void
87 $query =
'SELECT * FROM ecs_user_consent ' .
88 'WHERE usr_id = ' . $this->db->quote(
96 (
int) $row->server_id,
hasConsented(int $server_id, int $a_mid)
__construct(int $a_usr_id)
static getInstanceByUserId(int $a_usr_id)
add(int $server_id, int $a_mid)