Skip to content
Snippets Groups Projects
Commit e8fe4a66 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Corrections pour passer à ZF3.

parent dc4411a6
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace UnicaenLdap; namespace UnicaenLdap;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface; use Zend\ServiceManager\ServiceLocatorInterface;
...@@ -12,16 +13,15 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -12,16 +13,15 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/ */
class LdapFactory implements FactoryInterface class LdapFactory implements FactoryInterface
{ {
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return Ldap
*/
public function createService(ServiceLocatorInterface $serviceLocator) public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->__invoke($serviceLocator, '?');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{ {
/* @var $options \UnicaenLdap\Options\ModuleOptions */ /* @var $options \UnicaenLdap\Options\ModuleOptions */
$options = $serviceLocator->get('ldapOptions'); $options = $container->get('ldapOptions');
return new Ldap( $options->getLdap() ); return new Ldap( $options->getLdap() );
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace UnicaenLdap\Options; namespace UnicaenLdap\Options;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface; use Zend\ServiceManager\ServiceLocatorInterface;
...@@ -12,15 +13,14 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -12,15 +13,14 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/ */
class ModuleOptionsFactory implements FactoryInterface class ModuleOptionsFactory implements FactoryInterface
{ {
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return ModuleOptions
*/
public function createService(ServiceLocatorInterface $serviceLocator) public function createService(ServiceLocatorInterface $serviceLocator)
{ {
$config = $serviceLocator->get('Configuration'); return $this->__invoke($serviceLocator, '?');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$config = $container->get('Configuration');
$moduleConfig = isset($config['unicaen-ldap']) ? $config['unicaen-ldap'] : array(); $moduleConfig = isset($config['unicaen-ldap']) ? $config['unicaen-ldap'] : array();
return new ModuleOptions($moduleConfig); return new ModuleOptions($moduleConfig);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace UnicaenLdap\Service; namespace UnicaenLdap\Service;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface; use Zend\ServiceManager\ServiceLocatorInterface;
...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/ */
class GenericFactory implements FactoryInterface class GenericFactory implements FactoryInterface
{ {
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return Generic
*/
public function createService(ServiceLocatorInterface $serviceLocator) public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->__invoke($serviceLocator, '?');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{ {
$service = new Generic(); $service = new Generic();
$service->setServiceLocator($serviceLocator); $service->setServiceLocator($container);
return $service; return $service;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace UnicaenLdap\Service; namespace UnicaenLdap\Service;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface; use Zend\ServiceManager\ServiceLocatorInterface;
...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/ */
class GroupFactory implements FactoryInterface class GroupFactory implements FactoryInterface
{ {
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return Group
*/
public function createService(ServiceLocatorInterface $serviceLocator) public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->__invoke($serviceLocator, '?');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{ {
$service = new Group(); $service = new Group();
$service->setServiceLocator($serviceLocator); $service->setServiceLocator($container);
return $service; return $service;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace UnicaenLdap\Service; namespace UnicaenLdap\Service;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface; use Zend\ServiceManager\ServiceLocatorInterface;
...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/ */
class PeopleFactory implements FactoryInterface class PeopleFactory implements FactoryInterface
{ {
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return People
*/
public function createService(ServiceLocatorInterface $serviceLocator) public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->__invoke($serviceLocator, '?');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{ {
$service = new People(); $service = new People();
$service->setServiceLocator($serviceLocator); $service->setServiceLocator($container);
return $service; return $service;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace UnicaenLdap\Service; namespace UnicaenLdap\Service;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface; use Zend\ServiceManager\ServiceLocatorInterface;
...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/ */
class StructureFactory implements FactoryInterface class StructureFactory implements FactoryInterface
{ {
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return Structure
*/
public function createService(ServiceLocatorInterface $serviceLocator) public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->__invoke($serviceLocator, '?');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{ {
$service = new Structure(); $service = new Structure();
$service->setServiceLocator($serviceLocator); $service->setServiceLocator($container);
return $service; return $service;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace UnicaenLdap\Service; namespace UnicaenLdap\Service;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface; use Zend\ServiceManager\ServiceLocatorInterface;
...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface; ...@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
*/ */
class SystemFactory implements FactoryInterface class SystemFactory implements FactoryInterface
{ {
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return System
*/
public function createService(ServiceLocatorInterface $serviceLocator) public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->__invoke($serviceLocator, '?');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{ {
$service = new System(); $service = new System();
$service->setServiceLocator($serviceLocator); $service->setServiceLocator($container);
return $service; return $service;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment