From 5c4d4b5b015bf18e5285121226ad3a1fe68f7ba3 Mon Sep 17 00:00:00 2001 From: Bertrand Gauthier <bertrand.gauthier@unicaen.fr> Date: Thu, 28 Feb 2019 10:15:20 +0100 Subject: [PATCH] Contournement provisoire du warning ZF 'ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0' --- .../Controller/Factory/IndexControllerFactory.php | 3 +++ src/UnicaenOracle/Controller/IndexController.php | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/UnicaenOracle/Controller/Factory/IndexControllerFactory.php b/src/UnicaenOracle/Controller/Factory/IndexControllerFactory.php index d12d8ff..a0723e0 100644 --- a/src/UnicaenOracle/Controller/Factory/IndexControllerFactory.php +++ b/src/UnicaenOracle/Controller/Factory/IndexControllerFactory.php @@ -32,6 +32,9 @@ class IndexControllerFactory $controller->setSchemaService($schemaService); $controller->setDataService($dataService); + // todo: ne plus injecter le service locator, svp! + $controller->setServiceLocator($manager->getServiceLocator()); + return $controller; } } \ No newline at end of file diff --git a/src/UnicaenOracle/Controller/IndexController.php b/src/UnicaenOracle/Controller/IndexController.php index 31680fe..f40813a 100644 --- a/src/UnicaenOracle/Controller/IndexController.php +++ b/src/UnicaenOracle/Controller/IndexController.php @@ -3,13 +3,16 @@ namespace UnicaenOracle\Controller; use Doctrine\DBAL\Connection; +use UnicaenApp\ServiceManager\ServiceLocatorAwareInterface; use UnicaenOracle\Service\Traits\DataServiceAwareTrait; use UnicaenOracle\Service\Traits\SchemaServiceAwareTrait; use Zend\Log\LoggerAwareTrait; use Zend\Mvc\Controller\AbstractActionController; +use Zend\ServiceManager\ServiceLocatorAwareTrait; -class IndexController extends AbstractActionController +class IndexController extends AbstractActionController implements ServiceLocatorAwareInterface { + use ServiceLocatorAwareTrait; use SchemaServiceAwareTrait; use DataServiceAwareTrait; use LoggerAwareTrait; -- GitLab