selectFromDbById($id, Currency::class); } public function getAllByCommunity(Community $community, bool $useRelations = false): Generator { $select = new Select(Container::$dbConnection); $select->where('community_id', '=', $community->getId()); yield from Container::$persistentDataManager->selectMultipleFromDb($select, Currency::class, $useRelations); } public function getByCommunityAndCurrencyCode(Community $community, string $code): ?Currency { $select = new Select(Container::$dbConnection); $select->where('community_id', '=', $community->getId()); $select->where('code', '=', $code); return Container::$persistentDataManager->selectFromDb($select, Currency::class); } }