DbRoleServiceFactory.php 698 Bytes
Newer Older
1
2
3
4
5
<?php

namespace UnicaenAuth\Provider\Role;

use BjyAuthorize\Exception\InvalidArgumentException;
6
use UnicaenAuth\Service\RoleService;
7
8
9
10
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
11
 * Factory responsible of instantiating {@see \UnicaenAuth\Provider\Role\DbRole}
12
 */
13
class DbRoleServiceFactory implements FactoryInterface
14
15
16
17
{
    /**
     * {@inheritDoc}
     *
18
     * @return DbRole
19
20
21
     */
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
22
23
        $serviceRole = $serviceLocator->get('UnicaenAuth\Service\Role');
        /* @var $serviceRole RoleService */
24

25
        return new DbRole($serviceRole->getRepo());
26
27
    }
}