public function getGamesByUser($idUser) { $pairService = new PairService(); $pairService->setManager($this->em); $pairs = $pairService->getPairByUser($idUser); $games = array(); foreach ($pairs as $pair) { foreach ($this->getGamesByPair($pair->getId()) as $game) { $games[] = $game; } } return $games; }
public function getInscriptionsByUser($idUser) { $pairService = new PairService(); $pairService->setManager($this->em); $pairs = $pairService->getPairByUser($idUser); $inscriptions = array(); foreach ($pairs as $pair) { foreach ($this->getInscriptionsByPair($pair->getId()) as $ins) { $inscriptions[] = $ins; } } return $inscriptions; }