pdm = new PersistentDataManager(); } public function getById(int $id): ?MultiRoom { return $this->pdm->selectFromDbById($id, MultiRoom::class); } public function getByRoomId(string $roomId): ?MultiRoom { $select = new Select(\Container::$dbConnection); $select->where('room_id', '=', $roomId); return $this->pdm->selectFromDb($select, MultiRoom::class); } public function getAllExpired(): Generator { $select = new Select(\Container::$dbConnection); $select->where('updated', '<', (new DateTime('-7 day'))->format('Y-m-d H:i:s')); yield from $this->pdm->selectMultipleFromDb($select, MultiRoom::class); } }