Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
tbl
Commits
e60f3ba0
Commit
e60f3ba0
authored
Sep 17, 2019
by
Laurent Lécluse
Browse files
Passage à ZF3
parent
c233f0a0
Pipeline
#5241
failed with stage
in 12 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenTbl/Controller/Factory/AdminControllerFactory.php
View file @
e60f3ba0
<?php
namespace
UnicaenTbl\Controller\Factory
;
use
Interop\Container\ContainerInterface
;
use
UnicaenTbl\Controller\AdminController
;
use
UnicaenTbl\Form\ActualisationForm
;
use
UnicaenTbl\Service\QueryGeneratorService
;
use
UnicaenTbl\Service\SchemaService
;
use
UnicaenTbl\Service\TableauBordService
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
class
AdminControllerFactory
implements
FactoryInterface
class
AdminControllerFactory
{
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
*
* @return AdminController
*/
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
$controller
=
new
AdminController
();
$sl
=
$serviceLocator
->
getServiceLocator
();
$controller
->
setServiceSchema
(
$
sl
->
get
(
SchemaService
::
class
)
$
container
->
get
(
SchemaService
::
class
)
);
$controller
->
setServiceQueryGenerator
(
$
sl
->
get
(
QueryGeneratorService
::
class
)
$
container
->
get
(
QueryGeneratorService
::
class
)
);
$controller
->
setServiceTableauBord
(
$
sl
->
get
(
TableauBordService
::
class
)
$
container
->
get
(
TableauBordService
::
class
)
);
$controller
->
setFormActualisation
(
$
sl
->
get
(
'FormElementManager'
)
->
get
(
ActualisationForm
::
class
)
$
container
->
get
(
'FormElementManager'
)
->
get
(
ActualisationForm
::
class
)
);
return
$controller
;
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
src/UnicaenTbl/Form/Factory/ActualisationFormFactory.php
View file @
e60f3ba0
...
...
@@ -2,10 +2,8 @@
namespace
UnicaenTbl\Form\Factory
;
use
Interop\Container\ContainerInterface
;
use
UnicaenTbl\Form\ActualisationForm
;
use
Zend\Form\FormElementManager
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
/**
...
...
@@ -13,18 +11,10 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*
* @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
*/
class
ActualisationFormFactory
implements
FactoryInterface
{
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
*
* @return mixed
*/
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
class
ActualisationFormFactory
{
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
$sl
=
$serviceLocator
->
getServiceLocator
();
$form
=
new
ActualisationForm
();
return
$form
;
...
...
src/UnicaenTbl/Options/Factory/ModuleOptionsFactory.php
View file @
e60f3ba0
...
...
@@ -2,27 +2,21 @@
namespace
UnicaenTbl\Options\Factory
;
use
Interop\Container\ContainerInterface
;
use
UnicaenTbl\Options\ModuleOptions
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
/**
* Description of ModuleOptionsFactory
*
* @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
*/
class
ModuleOptionsFactory
implements
FactoryInterface
class
ModuleOptionsFactory
{
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return mixed
*/
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
$config
=
$
serviceLocato
r
->
get
(
'Configuration'
);
$config
=
$
containe
r
->
get
(
'Configuration'
);
return
new
ModuleOptions
(
isset
(
$config
[
'unicaen-tbl'
])
?
$config
[
'unicaen-tbl'
]
:
[]);
}
}
\ No newline at end of file
src/UnicaenTbl/Service/Factory/QueryGeneratorServiceFactory.php
View file @
e60f3ba0
<?php
namespace
UnicaenTbl\Service\Factory
;
use
Interop\Container\ContainerInterface
;
use
UnicaenTbl\Options\ModuleOptions
;
use
UnicaenTbl\Service\QueryGeneratorService
;
use
UnicaenTbl\Service\SchemaService
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
/**
...
...
@@ -13,20 +13,21 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*
* @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
*/
class
QueryGeneratorServiceFactory
implements
FactoryInterface
{
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
class
QueryGeneratorServiceFactory
{
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
$queryGenerator
=
new
QueryGeneratorService
();
/** @var ModuleOptions $options */
$options
=
$
serviceLocato
r
->
get
(
ModuleOptions
::
class
);
$options
=
$
containe
r
->
get
(
ModuleOptions
::
class
);
$em
=
$serviceLocator
->
get
(
$options
->
getEntityManagerName
());
/* @var $em \Doctrine\ORM\EntityManager */
$em
=
$container
->
get
(
$options
->
getEntityManagerName
());
/* @var $em \Doctrine\ORM\EntityManager */
$queryGenerator
->
setOptionsModule
(
$options
);
$queryGenerator
->
setEntityManager
(
$em
);
$queryGenerator
->
setServiceSchema
(
$serviceLocato
r
->
get
(
SchemaService
::
class
)
);
$queryGenerator
->
setServiceSchema
(
$containe
r
->
get
(
SchemaService
::
class
));
return
$queryGenerator
;
}
...
...
src/UnicaenTbl/Service/Factory/SchemaServiceFactory.php
View file @
e60f3ba0
<?php
namespace
UnicaenTbl\Service\Factory
;
use
Interop\Container\ContainerInterface
;
use
UnicaenTbl\Options\ModuleOptions
;
use
UnicaenTbl\Service\SchemaService
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
/**
...
...
@@ -12,19 +12,21 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*
* @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
*/
class
SchemaServiceFactory
implements
FactoryInterface
{
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
class
SchemaServiceFactory
{
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
$schema
=
new
SchemaService
();
/** @var ModuleOptions $options */
$options
=
$
serviceLocato
r
->
get
(
ModuleOptions
::
class
);
$options
=
$
containe
r
->
get
(
ModuleOptions
::
class
);
$em
=
$serviceLocator
->
get
(
$options
->
getEntityManagerName
());
/* @var $em \Doctrine\ORM\EntityManager */
$em
=
$container
->
get
(
$options
->
getEntityManagerName
());
/* @var $em \Doctrine\ORM\EntityManager */
$schema
->
setEntityManager
(
$em
);
return
$schema
;
}
}
\ No newline at end of file
src/UnicaenTbl/Service/Factory/TableauBordServiceFactory.php
View file @
e60f3ba0
<?php
namespace
UnicaenTbl\Service\Factory
;
use
Interop\Container\ContainerInterface
;
use
UnicaenTbl\Options\ModuleOptions
;
use
UnicaenTbl\Service\TableauBordService
;
use
Zend\ServiceManager\FactoryInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
/**
...
...
@@ -12,16 +12,17 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*
* @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
*/
class
TableauBordServiceFactory
implements
FactoryInterface
{
public
function
createService
(
ServiceLocatorInterface
$serviceLocator
)
class
TableauBordServiceFactory
{
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
array
$options
=
null
)
{
$tbl
=
new
TableauBordService
();
/** @var ModuleOptions $options */
$options
=
$
serviceLocato
r
->
get
(
ModuleOptions
::
class
);
$options
=
$
containe
r
->
get
(
ModuleOptions
::
class
);
$em
=
$serviceLocator
->
get
(
$options
->
getEntityManagerName
());
/* @var $em \Doctrine\ORM\EntityManager */
$em
=
$container
->
get
(
$options
->
getEntityManagerName
());
/* @var $em \Doctrine\ORM\EntityManager */
$tbl
->
setEntityManager
(
$em
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment