/** * @name selectProduit($pId) * @param integer * @return ProduitMarcheVO * @desc Retourne un Produit */ public function selectProduit($pId) { $lDetailMarche = DetailMarcheViewManager::selectByIdProduit($pId); $lProduit = new ProduitMarcheVO(); // Le Produit $lProduit->setId($lDetailMarche[0]->getProId()); $lProduit->setIdMarche($lDetailMarche[0]->getComId()); $lProduit->setIdCompteFerme($lDetailMarche[0]->getProIdCompteFerme()); $lProduit->setIdNom($lDetailMarche[0]->getNproId()); $lProduit->setNom($lDetailMarche[0]->getNproNom()); $lProduit->setDescription($lDetailMarche[0]->getNproDescription()); $lProduit->setIdCategorie($lDetailMarche[0]->getNproIdCategorie()); $lProduit->setCproNom($lDetailMarche[0]->getCproNom()); $lProduit->setUnite($lDetailMarche[0]->getProUniteMesure()); $lProduit->setQteMaxCommande($lDetailMarche[0]->getProMaxProduitCommande()); $lProduit->setStockReservation($lDetailMarche[0]->getProStockReservation()); $lProduit->setStockInitial($lDetailMarche[0]->getProStockInitial()); $lProduit->setType($lDetailMarche[0]->getProType()); $lProduit->setFerId($lDetailMarche[0]->getFerId()); $lProduit->setFerNom($lDetailMarche[0]->getFerNom()); $lProduit->setFerNom($lDetailMarche[0]->getFerNom()); foreach ($lDetailMarche as $lDetail) { // Le Lot $lLot = new DetailMarcheVO(); $lLot->setId($lDetail->getDcomId()); $lLot->setTaille($lDetail->getDcomTaille()); $lLot->setPrix($lDetail->getDcomPrix()); $lProduit->addLots($lLot); } return $lProduit; }