where('user_id', '=', $user->getId()); yield from \Container::$persistentDataManager->selectMultipleFromDb($select, UserPlayedPlace::class); } public function getAllByPlace(Place $place): Generator { $select = new Select(\Container::$dbConnection); $select->where('place_id', '=', $place->getId()); yield from \Container::$persistentDataManager->selectMultipleFromDb($select, UserPlayedPlace::class); } public function getAllByUser(User $user) : Generator { $select = new Select(\Container::$dbConnection); $select->where('user_id', '=', $user->getId()); yield from \Container::$persistentDataManager->selectMultipleFromDb($select, UserPlayedPlace::class); } public function getByUserIdAndPlaceId(int $userId, int $placeId) : ?UserPlayedPlace { $select = new Select(\Container::$dbConnection); $select->where('user_id', '=', $userId); $select->where('place_id', '=', $placeId); return \Container::$persistentDataManager->selectFromDb($select, UserPlayedPlace::class); } }