/**
  * Load the banned users for the current room
  */
 public function loadBannedUsers()
 {
     $roomBanCollection = new RoomBanCollection();
     $sqlMarks = 'SELECT * FROM %s WHERE `idRoom` = %d';
     $sql = static::sqlFormat($sqlMarks, $this->entity->getTableName(), $this->entity->idRoom);
     foreach (DB::query($sql)->fetchAll(\PDO::FETCH_ASSOC) as $row) {
         $roomBanCollection->add(new RoomBan($row));
     }
     $this->entityCollection = $roomBanCollection;
 }
Esempio n. 2
0
 /**
  * Room array representation
  *
  * @return     array  The Room array representation
  */
 public function __toArray() : array
 {
     return array_merge(parent::__toArray(), ['roomBan' => $this->roomBanCollection->__toArray(), 'clients' => $this->clients->__toArray(), 'pseudonyms' => $this->pseudonyms]);
 }