MouchardCompleterAuthFactory.php 867 Bytes
Newer Older
1
2
3
4
<?php

namespace UnicaenAuth\Mouchard;

5
use Interop\Container\ContainerInterface;
6
7
8
9
10
11
12
13
14
15
16
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
 * Description of MouchardCompleterAuthFactory
 *
 * @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
 */
class MouchardCompleterAuthFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
17
18
19
20
21
    {
        return $this->__invoke($serviceLocator);
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
22
23
24
    {
        $mouchardCompleterAuth = new MouchardCompleterAuth();

25
        $serviceUserContext = $container->get('UnicaenAuth\Service\UserContext');
26
27
28
29
30
        $mouchardCompleterAuth->setServiceUserContext($serviceUserContext);

        return $mouchardCompleterAuth;
    }
}