public function getInscriptionByPairAction($idPair) { $this->inscriptionService->setManager($this->getDoctrine()->getManager()); $inscriptions = $this->inscriptionService->getInscriptionsByPair($idPair); $pairService = new PairService(); $pairService->setManager($this->getDoctrine()->getManager()); $pair = $pairService->getPair($idPair); if (!$pair instanceof Pair) { return $this->util->setResponse(400, Literals::PairNotFound); } else { $dataToSend = json_encode(array('inscription' => $inscriptions)); return $this->util->setJsonResponse(200, $dataToSend); } }
private function getPairFromId($idPair) { $pairService = new PairService(); $pairService->setManager($this->em); $pair = $pairService->getPair(isset($idPair) ? $idPair : ''); return $pair; }