where('place_id', '=', $place->getId()); yield from \Container::$persistentDataManager->selectMultipleFromDb($select, PlaceInChallenge::class, true, $withRelations); } public function getAllByChallenge(Challenge $challenge) : Generator { $select = new Select(\Container::$dbConnection); $select->where('challenge_id', '=', $challenge->getId()); yield from \Container::$persistentDataManager->selectMultipleFromDb($select, PlaceInChallenge::class); } public function getByPlaceAndChallenge(Place $place, Challenge $challenge) : ?PlaceInChallenge { $select = new Select(\Container::$dbConnection); $select->where('place_id', '=', $place->getId()); $select->where('challenge_id', '=', $challenge->getId()); return \Container::$persistentDataManager->selectFromDb($select, PlaceInChallenge::class); } public function getByRoundInChallenge(int $round, Challenge $challenge, array $withRelations = []): ?PlaceInChallenge { $select = new Select(\Container::$dbConnection); $select->where('challenge_id', '=', $challenge->getId()); $select->orderBy('round'); $select->limit(1, $round); return \Container::$persistentDataManager->selectFromDb($select, PlaceInChallenge::class, true, $withRelations); } }