/** * @name getDetailProduit($pParam) * @desc Donne le détail d'un produit */ public function getDetailProduit($pParam) { $lVr = ListeProduitValid::validGetDetailProduit($pParam); if ($lVr->getValid()) { $lAbonnementService = new AbonnementService(); $lResponse = new DetailProduitResponse(); $lResponse->setProduit($lAbonnementService->getDetailProduit($pParam["id"])); return $lResponse; } return $lVr; }
/** * @name getDetailProduitModifier($pParam) * @desc Donne le détail d'un produit */ public function getDetailProduitModifier($pParam) { $lVr = ListeProduitValid::validGetDetailProduit($pParam); if ($lVr->getValid()) { $lAbonnementService = new AbonnementService(); $lResponse = new DetailProduitModifierResponse(); $lProduit = $lAbonnementService->getDetailProduit($pParam["id"]); $lNvLots = array(); foreach ($lProduit[0]->getLots() as $lLot) { $lAbon = $lAbonnementService->getAbonnementSurLot($lLot->getId()); $lNvLot = new LotAbonnementMarcheVO(); $lNvLot->setId($lLot->getId()); $lNvLot->setIdProduitAbonnement($lLot->getIdProduitAbonnement()); $lNvLot->setTaille($lLot->getTaille()); $lNvLot->setPrix($lLot->getPrix()); if (!is_null($lAbon[0]->getCptAboIdProduitAbonnement())) { $lNvLot->setReservation(true); } array_push($lNvLots, $lNvLot); } $lProduit[0]->setLots($lNvLots); $lResponse->setProduit($lProduit); // $lProduit = $lAbonnementService->getProduit($pParam["id"]); $lResponse->setUnite(ModeleLotViewManager::selectByIdNomProduit($lProduit[0]->getProAboIdNomProduit())); return $lResponse; } return $lVr; }