public function verification_lignes(Panier $monpanier) { $requete = $this->_db->prepare('select * from panier where idart=:idart and idutil=:idutil'); $requete->execute(array(':idart' => $monpanier->getIdart(), ':idutil' => $_SESSION['id'])); $results = $requete->fetchAll(); $tabobject = array(); if (empty($results)) { return false; } else { foreach ($results as $result) { $monnouveaupanier = new Panier(); $monnouveaupanier->setIdpanier($result['id'])->setIdutil($result['idutil'])->setIdart($result['idart'])->setNomart($result['nomart'])->setDescriptionart($result['descriptionart'])->setPointsart($result['pointsart'])->setQuantiteart($result['quantiteart'])->setImgart($result['imgart']); array_push($tabobject, $monnouveaupanier); // Push l'objet $article dans le tableau $tabobject } } return $tabobject; }