18 declare(strict_types=1);
    32     protected array 
$mids = array();
    43     protected function __construct(
int $server_id, 
int $community_id)
    47         $this->db = $DIC->database();
    63         return self::$instance[$a_server_id][$a_community_id] ??
    84         $this->own_id = $a_id;
    94         $this->cname = $a_name;
   104         $this->mids = $a_mids;
   117         if (!$this->entryExists) {
   121         $query = 
'UPDATE ecs_community ' .
   122             'SET own_id = ' . $this->db->quote($this->
getOwnId(), 
'integer') . 
', ' .
   124             'mids = ' . $this->db->quote(serialize($this->
getMids()), 
'text') . 
' ' .
   125             'WHERE sid = ' . $this->db->quote($this->
getServerId(), 
'integer') . 
' ' .
   126             'AND cid = ' . $this->db->quote($this->
getCommunityId(), 
'integer');
   127         $this->db->manipulate($query);
   138         $query = 
'INSERT INTO ecs_community (sid,cid,own_id,cname,mids) ' .
   140             $this->db->quote($this->
getServerId(), 
'integer') . 
', ' .
   142             $this->db->quote($this->
getOwnId(), 
'integer') . 
', ' .
   144             $this->db->quote(serialize($this->
getMids()), 
'text') . 
' ' .
   146         $this->db->manipulate($query);
   155         $this->entryExists = 
false;
   157         $query = 
'SELECT * FROM ecs_community ' .
   158             'WHERE sid = ' . $this->db->quote($this->
getServerId(), 
'integer') . 
' ' .
   159             'AND cid = ' . $this->db->quote($this->
getCommunityId(), 
'integer');
   160         $res = $this->db->query($query);
   162             $this->entryExists = 
true;
   163             $this->
setOwnId((
int) $row->own_id);
   165             $this->
setMids(unserialize($row->mids, [
'allowed_classes' => 
true]));
   177         $query = 
'DELETE FROM ecs_community' .
   178             ' WHERE sid = ' . $this->db->quote($a_server_id, 
'integer');
   179         $this->db->manipulate($query);