From a49364b54509d3d6d7395bb69ebc7fb49e07ac6b Mon Sep 17 00:00:00 2001 From: xhuberty Date: Fri, 11 Mar 2016 18:19:49 +0100 Subject: [PATCH] Drop injection of DaoFactory --- .../SplashCreateControllerService.php | 40 +------------------ src/views/admin/createController.php | 6 +-- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php b/src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php index cd9a834..75b15a3 100644 --- a/src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php +++ b/src/Mouf/Mvc/Splash/Services/SplashCreateControllerService.php @@ -23,11 +23,10 @@ class SplashCreateControllerService * @param string $namespace * @param string $injectLogger * @param string $injectTemplate - * @param string $injectDaoFactory * @param array $actions */ public function generate(MoufManager $moufManager, $controllerName, $instanceName, $namespace, $injectLogger = false, - $injectTemplate = false, $injectDaoFactory = false, $actions = array()) + $injectTemplate = false, $actions = array()) { $namespace = rtrim($namespace, '\\').'\\'; @@ -48,10 +47,6 @@ public function generate(MoufManager $moufManager, $controllerName, $instanceNam $namespace = trim($namespace, '\\'); - if (!file_exists(ROOT_PATH.'../database.tdbm') && $injectDaoFactory) { - $injectDaoFactory = false; - } - // Check that instance does not already exists if ($moufManager->has($instanceName)) { $errors['instanceError'] = 'This instance already exists.'; @@ -137,12 +132,6 @@ public function generate(MoufManager $moufManager, $controllerName, $instanceNam ?> use Psr\Log\LoggerInterface; - -use getVariable('tdbmDefaultDaoNamespace').'\\'.$moufManager->getVariable('tdbmDefaultDaoFactoryName') ?>; - extends Controller { */ private $content; - - - /** - * The DAO factory object. - * @var DaoFactory - */ - private $daoFactory; - @@ -237,9 +215,6 @@ class extends Controller { echo " * @param TemplateInterface \$template The template used by this controller\n"; echo " * @param HtmlBlock \$content The main content block of the page\n"; } - if ($injectDaoFactory) { - echo " * @param DaoFactory \$daoFactory The object in charge of retrieving DAOs\n"; - } if ($injectTwig) { echo " * @param Twig_Environment \$twig The Twig environment (used to render Twig templates)\n"; } @@ -254,9 +229,6 @@ public function __construct( $this->template = $template; $this->content = $content; - - $this->daoFactory = $daoFactory; (getProperty('content')->setValue($moufManager->getInstanceDescriptor('block.content')); } } - if ($injectDaoFactory) { - if ($moufManager->has('daoFactory')) { - $controllerInstance->getProperty('daoFactory')->setValue($moufManager->getInstanceDescriptor('daoFactory')); - } - } if ($injectTwig) { if ($moufManager->has('twigEnvironment')) { $controllerInstance->getProperty('twig')->setValue($moufManager->getInstanceDescriptor('twigEnvironment')); diff --git a/src/views/admin/createController.php b/src/views/admin/createController.php index 74ca640..f7d4a67 100644 --- a/src/views/admin/createController.php +++ b/src/views/admin/createController.php @@ -3,8 +3,7 @@ @@ -52,9 +51,6 @@ -