public function update(Appartement $appartement)
    {
        $query = $this->_db->prepare('
		UPDATE t_appartement SET nom=:nom, superficie=:superficie, prix=:prix, niveau=:niveau, facade=:facade, 
		nombrePiece=:nombrePiece, status=:status, cave=:cave, par=:par, updated=:updated,
		updatedBy=:updatedBy WHERE id=:idAppartement') or die(print_r($this->_db->errorInfo()));
        $query->bindValue(':idAppartement', $appartement->id());
        $query->bindValue(':nom', $appartement->nom());
        $query->bindValue(':superficie', $appartement->superficie());
        $query->bindValue(':facade', $appartement->facade());
        $query->bindValue(':prix', $appartement->prix());
        $query->bindValue(':niveau', $appartement->niveau());
        $query->bindValue(':nombrePiece', $appartement->nombrePiece());
        $query->bindValue(':cave', $appartement->cave());
        $query->bindValue(':status', $appartement->status());
        $query->bindValue(':par', $appartement->par());
        $query->bindValue(':updated', $appartement->updated());
        $query->bindValue(':updatedBy', $appartement->updatedBy());
        $query->execute();
        $query->closeCursor();
    }
Esempio n. 2
0
    public function add(Appartement $appartement)
    {
        $query = $this->_db->prepare(' INSERT INTO t_appartement (
		numeroTitre,nom,superficie,surplan,prix,niveau,facade,nombrePiece,status,cave,idProjet,created,createdBy)
		VALUES (:numeroTitre,:nom,:superficie,:surplan,:prix,:niveau,:facade,:nombrePiece,:status,:cave,:idProjet,:created,:createdBy)') or die(print_r($this->_db->errorInfo()));
        $query->bindValue(':numeroTitre', $appartement->numeroTitre());
        $query->bindValue(':nom', $appartement->nom());
        $query->bindValue(':superficie', $appartement->superficie());
        $query->bindValue(':surplan', $appartement->surplan());
        $query->bindValue(':prix', $appartement->prix());
        $query->bindValue(':niveau', $appartement->niveau());
        $query->bindValue(':facade', $appartement->facade());
        $query->bindValue(':nombrePiece', $appartement->nombrePiece());
        $query->bindValue(':status', $appartement->status());
        $query->bindValue(':cave', $appartement->cave());
        $query->bindValue(':idProjet', $appartement->idProjet());
        $query->bindValue(':created', $appartement->created());
        $query->bindValue(':createdBy', $appartement->createdBy());
        $query->execute();
        $query->closeCursor();
    }