@@ -23,11 +23,10 @@ class SplashCreateControllerService
2323 * @param string $namespace
2424 * @param string $injectLogger
2525 * @param string $injectTemplate
26- * @param string $injectDaoFactory
2726 * @param array $actions
2827 */
2928 public function generate (MoufManager $ moufManager , $ controllerName , $ instanceName , $ namespace , $ injectLogger = false ,
30- $ injectTemplate = false , $ injectDaoFactory = false , $ actions = array ())
29+ $ injectTemplate = false , $ actions = array ())
3130 {
3231 $ namespace = rtrim ($ namespace , '\\' ).'\\' ;
3332
@@ -48,10 +47,6 @@ public function generate(MoufManager $moufManager, $controllerName, $instanceNam
4847
4948 $ namespace = trim ($ namespace , '\\' );
5049
51- if (!file_exists (ROOT_PATH .'../database.tdbm ' ) && $ injectDaoFactory ) {
52- $ injectDaoFactory = false ;
53- }
54-
5550 // Check that instance does not already exists
5651 if ($ moufManager ->has ($ instanceName )) {
5752 $ errors ['instanceError ' ] = 'This instance already exists. ' ;
@@ -137,13 +132,6 @@ public function generate(MoufManager $moufManager, $controllerName, $instanceNam
137132}
138133?>
139134use Psr\Http\Message\ResponseInterface;
140- <?php if ($ injectDaoFactory ) {
141- ?>
142- use <?= $ moufManager ->getVariable ('tdbmDefaultDaoNamespace ' ).'\\Generated \\' .$ moufManager ->getVariable ('tdbmDefaultDaoFactoryName ' ) ?> ;
143- <?php
144-
145- }
146- ?>
147135<?php if ($ injectTwig ) {
148136 ?>
149137use \Twig_Environment;
@@ -207,18 +195,6 @@ class <?= $controllerName ?> {
207195
208196<?php
209197
210- }
211- ?>
212- <?php if ($ injectDaoFactory ) {
213- ?>
214- /**
215- * The DAO factory object.
216- * @var DaoFactory
217- */
218- private $daoFactory;
219-
220- <?php
221-
222198}
223199 ?>
224200<?php if ($ injectTwig ) {
@@ -244,9 +220,6 @@ class <?= $controllerName ?> {
244220 echo " * @param TemplateInterface \$template The template used by this controller \n" ;
245221 echo " * @param HtmlBlock \$content The main content block of the page \n" ;
246222 }
247- if ($ injectDaoFactory ) {
248- echo " * @param DaoFactory \$daoFactory The object in charge of retrieving DAOs \n" ;
249- }
250223 if ($ injectTwig ) {
251224 echo " * @param Twig_Environment \$twig The Twig environment (used to render Twig templates) \n" ;
252225 }
@@ -261,9 +234,6 @@ public function __construct(<?php
261234 $ parameters [] = 'TemplateInterface $template ' ;
262235 $ parameters [] = 'HtmlBlock $content ' ;
263236 }
264- if ($ injectDaoFactory ) {
265- $ parameters [] = 'DaoFactory $daoFactory ' ;
266- }
267237 if ($ injectTwig ) {
268238 $ parameters [] = 'Twig_Environment $twig ' ;
269239 }
@@ -281,12 +251,6 @@ public function __construct(<?php
281251 $this->content = $content;
282252<?php
283253
284- }
285- if ($ injectDaoFactory ) {
286- ?>
287- $this->daoFactory = $daoFactory;
288- <?php
289-
290254 }
291255 if ($ injectTwig ) {
292256 ?>
@@ -416,11 +380,6 @@ public function <?= $action['method'] ?>(<?php
416380 $ controllerInstance ->getProperty ('content ' )->setValue ($ moufManager ->getInstanceDescriptor ('block.content ' ));
417381 }
418382 }
419- if ($ injectDaoFactory ) {
420- if ($ moufManager ->has ('daoFactory ' )) {
421- $ controllerInstance ->getProperty ('daoFactory ' )->setValue ($ moufManager ->getInstanceDescriptor ('daoFactory ' ));
422- }
423- }
424383 if ($ injectTwig ) {
425384 if ($ moufManager ->has ('twigEnvironment ' )) {
426385 $ controllerInstance ->getProperty ('twig ' )->setValue ($ moufManager ->getInstanceDescriptor ('twigEnvironment ' ));
0 commit comments