From 13086b7d757311b292fbfb7d8ab0c198a75b1815 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 3 Oct 2016 11:25:05 +0200 Subject: [PATCH] Use doctrine/dbal in place of Zend_Db --- application/controllers/UserController.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index 48cc7b18..16070b80 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -63,9 +63,15 @@ class UserController extends Zend_Controller_Action $this->view->login = $login; $this->view->authorizationHeader = base64_encode($login.':'.$pass); - $userM = new Application_Model_Sdv1Utilisateurs(); - $sql = $userM->select()->where('id=?', $identity->id); - $user = $userM->fetchRow($sql); + /** + * @var \Doctrine\DBAL\Connection $conn + */ + $conn = Zend_Registry::get('doctrine'); + $userSql = "SELECT * FROM sdv1.utilisateurs WHERE id=:id"; + $stmt = $conn->prepare($userSql); + $stmt->bindValue('id', $identity->id); + $stmt->execute(); + $user = $stmt->fetch(\PDO::FETCH_OBJ); $this->view->IdFullName = $user->civilite . ' ' . $user->nom . ' ' . $user->prenom; $this->view->IdEmail = $user->email; @@ -125,7 +131,5 @@ class UserController extends Zend_Controller_Action } } $this->view->display = $display; - } - } \ No newline at end of file