Exemplo n.º 1
0
    public function update(Contrat $contrat){
        $query = $this->_db->prepare(
        'UPDATE t_contrat SET numero=:numero, dateCreation=:dateCreation, 
        prixVente=:prixVente, prixVenteArabe=:prixVenteArabe, avance=:avance, avanceArabe=:avanceArabe, 
        modePaiement=:modePaiement, numeroCheque=:numeroCheque,
        nombreMois=:nombreMois, dureePaiement=:dureePaiement, echeance=:echeance,  
        societeArabe=:societeArabe, etatBienArabe=:etatBienArabe, facadeArabe=:facadeArabe, 
        articlesArabes=:articlesArabes, note=:note, updated=:updated, updatedBy=:updatedBy WHERE id=:id') 
        or die(print_r($this->_db->errorInfo()));
        $query->bindValue(':id', $contrat->id());
		$query->bindValue(':numero', $contrat->numero());
        $query->bindValue(':dateCreation', $contrat->dateCreation());
        $query->bindValue(':prixVente', $contrat->prixVente());
        $query->bindValue(':prixVenteArabe', $contrat->prixVenteArabe());
        $query->bindValue(':avance', $contrat->avance());
        $query->bindValue(':avanceArabe', $contrat->avanceArabe());
		$query->bindValue(':modePaiement', $contrat->modePaiement());
		$query->bindValue(':dureePaiement', $contrat->dureePaiement());
        $query->bindValue(':numeroCheque', $contrat->numeroCheque());
        $query->bindValue(':nombreMois', $contrat->nombreMois());
        $query->bindValue(':echeance', $contrat->echeance());
		$query->bindValue(':note', $contrat->note());
        $query->bindValue(':societeArabe', $contrat->societeArabe());
        $query->bindValue(':etatBienArabe', $contrat->etatBienArabe());
        $query->bindValue(':facadeArabe', $contrat->facadeArabe());
        $query->bindValue(':articlesArabes', $contrat->articlesArabes());
        $query->bindValue(':updated', $contrat->updated());
        $query->bindValue(':updatedBy', $contrat->updatedBy());
        $query->execute();
        $query->closeCursor();
    }