Commit e8fe4a66 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Corrections pour passer à ZF3.

parent dc4411a6
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace UnicaenLdap;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

@@ -12,16 +13,15 @@ use Zend\ServiceManager\ServiceLocatorInterface;
 */
class LdapFactory implements FactoryInterface
{
    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return Ldap
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this->__invoke($serviceLocator, '?');
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        /* @var $options \UnicaenLdap\Options\ModuleOptions */
        $options = $serviceLocator->get('ldapOptions');
        $options = $container->get('ldapOptions');

        return new Ldap( $options->getLdap() );
    }
+7 −7
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace UnicaenLdap\Options;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

@@ -12,15 +13,14 @@ use Zend\ServiceManager\ServiceLocatorInterface;
 */
class ModuleOptionsFactory implements FactoryInterface
{
    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return ModuleOptions
     */
    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();

        return new ModuleOptions($moduleConfig);
+7 −7
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace UnicaenLdap\Service;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
 */
class GenericFactory implements FactoryInterface
{
    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return Generic
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this->__invoke($serviceLocator, '?');
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $service = new Generic();

        $service->setServiceLocator($serviceLocator);
        $service->setServiceLocator($container);

        return $service;
    }
+7 −7
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace UnicaenLdap\Service;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
 */
class GroupFactory implements FactoryInterface
{
    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return Group
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this->__invoke($serviceLocator, '?');
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $service = new Group();

        $service->setServiceLocator($serviceLocator);
        $service->setServiceLocator($container);

        return $service;
    }
+7 −7
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace UnicaenLdap\Service;

use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

@@ -12,17 +13,16 @@ use Zend\ServiceManager\ServiceLocatorInterface;
 */
class PeopleFactory implements FactoryInterface
{
    /**
     * Create service
     *
     * @param ServiceLocatorInterface $serviceLocator
     * @return People
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this->__invoke($serviceLocator, '?');
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $service = new People();

        $service->setServiceLocator($serviceLocator);
        $service->setServiceLocator($container);

        return $service;
    }
Loading