selectFromDbById($id, Transaction::class); } public function getAllByCommunity(Community $community, bool $useRelations = false, array $withRelations = []): Generator { $select = $this->selectAllByCommunity($community); yield from Container::$persistentDataManager->selectMultipleFromDb($select, Transaction::class, $useRelations, $withRelations); } public function countAllByCommunity(Community $community): int { return $this->selectAllByCommunity($community)->count(); } public function getPagedByCommunity(Community $community, int $start, int $limit, bool $useRelations = false, array $withRelations = []): Generator { $select = new Select(Container::$dbConnection); $select->where('community_id', '=', $community->getId()); $select->orderBy('time', 'DESC'); $select->limit($limit, $start); yield from Container::$persistentDataManager->selectMultipleFromDb($select, Transaction::class, $useRelations, $withRelations); } private function selectAllByCommunity(Community $community) { $select = new Select(Container::$dbConnection, Transaction::getTable()); $select->where('community_id', '=', $community->getId()); return $select; } }