/** * @name modifierInformationMarche($pParam) * @param MarcheVO * @desc Modifie les informations du marché */ public function modifierInformationMarche($pParam) { $lVr = ModifierMarcheValid::validUpdateInformation($pParam); if ($lVr->getValid()) { $lMarche = new MarcheVO(); $lMarche->setId($pParam['id']); $lMarche->setNom($pParam['nom']); $lMarche->setDescription($pParam['description']); $lMarche->setDateMarcheDebut($pParam['dateMarcheDebut'] . " " . $pParam['timeMarcheDebut']); $lMarche->setDateMarcheFin($pParam['dateMarcheFin'] . " " . $pParam['timeMarcheFin']); $lMarche->setDateDebutReservation($pParam['dateDebutReservation'] . " " . $pParam['timeDebutReservation']); $lMarche->setDateFinReservation($pParam['dateFinReservation'] . " " . $pParam['timeFinReservation']); $lMarcheService = new MarcheService(); $lMarcheService->updateInformation($lMarche); } return $lVr; }
/** * @name select($pId) * @param integer * @return MarcheVO * @desc Retourne une Commande */ public function select($pId) { // Information du marche /*$lMarche->setId($lDetailMarche[0]->getComId()); $lMarche->setNumero($lDetailMarche[0]->getComNumero()); $lMarche->setNom($lDetailMarche[0]->getComNom()); $lMarche->setDescription($lDetailMarche[0]->getComDescription()); $lMarche->setDateMarcheDebut($lDetailMarche[0]->getComDateMarcheDebut()); $lMarche->setDateMarcheFin($lDetailMarche[0]->getComDateMarcheFin()); $lMarche->setDateDebutReservation($lDetailMarche[0]->getComDateDebutReservation()); $lMarche->setDateFinReservation($lDetailMarche[0]->getComDateFinReservation()); $lMarche->setArchive($lDetailMarche[0]->getComArchive());*/ $lInfoMarche = $this->getInfoMarche($pId); $lMarche = new MarcheVO(); // Information du marche $lMarche->setId($lInfoMarche->getId()); $lMarche->setNumero($lInfoMarche->getNumero()); $lMarche->setNom($lInfoMarche->getNom()); $lMarche->setDescription($lInfoMarche->getDescription()); $lMarche->setDateMarcheDebut($lInfoMarche->getDateMarcheDebut()); $lMarche->setDateMarcheFin($lInfoMarche->getDateMarcheFin()); $lMarche->setDateDebutReservation($lInfoMarche->getDateDebutReservation()); $lMarche->setDateFinReservation($lInfoMarche->getDateFinReservation()); $lMarche->setArchive($lInfoMarche->getArchive()); $lDetailMarche = DetailMarcheViewManager::select($pId); foreach ($lDetailMarche as $lDetail) { if ($lDetail->getProId() != '') { // Le Produit $lProduits = $lMarche->getProduits(); if (!isset($lProduits[$lDetail->getProId()])) { $lProduit = new ProduitMarcheVO(); $lProduit->setId($lDetail->getProId()); $lProduit->setIdCompteFerme($lDetail->getProIdCompteFerme()); $lProduit->setIdNom($lDetail->getNproId()); $lProduit->setNom($lDetail->getNproNom()); $lProduit->setDescription($lDetail->getNproDescription()); $lProduit->setIdCategorie($lDetail->getNproIdCategorie()); $lProduit->setCproNom($lDetail->getCproNom()); $lProduit->setUnite($lDetail->getProUniteMesure()); $lProduit->setQteMaxCommande($lDetail->getProMaxProduitCommande()); $lProduit->setStockReservation($lDetail->getProStockReservation()); $lProduit->setStockInitial($lDetail->getProStockInitial()); $lProduit->setType($lDetail->getProType()); $lProduit->setFerId($lDetail->getFerId()); $lProduit->setFerNom($lDetail->getFerNom()); $lProduits[$lDetail->getProId()] = $lProduit; } // Le Lot $lLot = new DetailMarcheVO(); $lLot->setId($lDetail->getDcomId()); $lLot->setTaille($lDetail->getDcomTaille()); $lLot->setPrix($lDetail->getDcomPrix()); $lLots = $lProduits[$lDetail->getProId()]->getLots(); $lLots[$lDetail->getDcomId()] = $lLot; $lProduits[$lDetail->getProId()]->setLots($lLots); $lMarche->setProduits($lProduits); } } return $lMarche; }