Gets user role linker

@param  ServiceLocatorInterface $serviceLocator
@return UserRoleLinkerMapper
430406
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $mapper = new UserRoleLinkerMapper;
        $options = $serviceLocator->get('UserRbac\ModuleOptions');
        $class = $options->getUserRoleLinkerEntityClass();
        $mapper->setEntityPrototype(new $class);
        $mapper->setDbAdapter($serviceLocator->get('UserRbac\DbAdapter'));
        $mapper->setTableName($options->getTableName());

        return $mapper;
    }
72672
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $resource = new MessageHandler();

        $resource->setFinder($serviceLocator->getServiceLocator()->get(MessageHandlerFinder::class));

        return $resource;
    }
439696
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('config');
        $config = new GuardLoaderConfig($config['guard']['instance_loader']);
        $loader = new InstanceLoader($config);

        return $loader;
    }
1219953
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var DataMapperManager $dataMapperManager */
        $dataMapperManager = $serviceLocator->get(DataMapperManager::class);

        $userMapper        = $dataMapperManager->getDataMapperForEntity(Entity\UserInterface::class);

        /** @var ThirdPartyMapperInterface $thirdPartyMapper */
        $thirdPartyMapper  = $dataMapperManager->getDataMapperForEntity(Entity\ThirdParty::class);

        /** @var TokenMapperInterface $accessTokenMapper */
        $accessTokenMapper = $dataMapperManager->getDataMapperForEntity(Entity\AccessToken::class);

        /** @var ModuleOptions $moduleOptions */
        $moduleOptions = $serviceLocator->get(ModuleOptions::class);

        $grantType = new ThirdPartyGrantType($userMapper, $thirdPartyMapper, $accessTokenMapper, $moduleOptions);

        return $grantType;
    }
174829
public function getIdentityRoles(UserInterface $user = null)
    {
        if ($user === null) {
            $user = $this->getDefaultIdentity();
            if (!$user) {
                return (array) $this->getModuleOptions()->getDefaultGuestRole();
            }
        }

        $resultSet = $this->getUserRoleLinkerMapper()->findByUser($user);

        if (count($resultSet) > 0) { // if exists in database
            $roles = array();
            foreach ($resultSet  as $userRoleLinker) {
                $roles[] = $userRoleLinker->getRoleId();
            }

            return $roles;
        } else {
            return (array) $this->getModuleOptions()->getDefaultUserRole();
        }

    }
878596
private function getRoles(ApiUserInterface $user)
    {
        $roles = $user->getRoles();
        if ($user->getApiKeyEnabled()) {
            $roles[] = $this->apiUserRole;
        }

        return $roles;
    }
121086
private function getUserRolesAsObjects(UserInterface $user)
    {
        $userRoles = array();
        foreach ($user->getRoles() as $userRole) {
            $userRoles[] = $userRole instanceof Role ? $userRole : new Role($userRole);
        }

        return $userRoles;
    }
100081
public function createService(ServiceLocatorInterface $serviceLocator)
    {

        $authService = $serviceLocator->get('zfcuser_auth_service');
        $config = $serviceLocator->get('ZfcUserLdap\Config');

        $provider = new ZfcRbacIdentityProvider($authService, $config);
        return $provider;
    }
854264
public function findAllPlatformRoles($includeRoleUser = true, $getBuilder = false)
    {
        $queryBuilder = $this
            ->createQueryBuilder('role')
            ->andWhere('role.type = :roleType')
            ->setParameter('roleType', Role::PLATFORM_ROLE);
        $queryBuilder->andWhere($queryBuilder->expr()->not($queryBuilder->expr()->eq('role.name', '?1')))
            ->setParameter(1, 'ROLE_ANONYMOUS');

        if (!$includeRoleUser) {
            $queryBuilder->andWhere($queryBuilder->expr()->not($queryBuilder->expr()->eq('role.name', '?2')))
                ->setParameter(2, 'ROLE_USER');
        }

        if ($getBuilder) {
            return $queryBuilder;
        }

        $query = $queryBuilder->getQuery();

        return $query->getResult();
    }
486015
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new NodeStatisticsDataContextBuilder();

        /** @var QueryBuilderInterface $queryBuilder */
        $queryBuilder = $serviceLocator->get('KmbPuppetDb\Query\NodesEnvironmentsQueryBuilder');
        $service->setNodesEnvironmentsQueryBuilder($queryBuilder);

        /** @var EnvironmentInterface $permissionEnvironmentService */
        $permissionEnvironmentService = $serviceLocator->get('KmbPermission\Service\Environment');
        $service->setPermissionEnvironmentService($permissionEnvironmentService);

        return $service;
    }
1092751
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $services = $serviceLocator->getServiceLocator();

        /* @var $mapper \CmsCommon\Persistence\HierarchyMapperInterface */
        $mapper = $services->get('MapperManager')->get(TerritoryHierarchyInterface::class);

        return new Hierarchy($mapper);
    }
390027
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return new ConnectionManager(
            $serviceLocator->get('prooph.link.app.config_location'),
            $serviceLocator->get('prooph.link.system_config.config_writer'),
            $serviceLocator->get('prooph.link.sqlconnector.dbal_connections')
        );
    }
902926
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');

        $dmmConfig = isset($config['thorr_persistence_dmm'])
            ? new DataMapperManagerConfig($config['thorr_persistence_dmm'])
            : null;

        $dataMapperManager = new DataMapperManager($dmmConfig);
        $dataMapperManager->setServiceLocator($serviceLocator);

        if (isset($config['di']) && $serviceLocator->has('Di')) {
            $dataMapperManager->addAbstractFactory($serviceLocator->get('DiAbstractServiceFactory'));
        }

        return $dataMapperManager;
    }
1332811
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsPluginManager */
        $moduleOptionsPluginManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);

        /** @var ModuleOptionsInterface $moduleOptions */
        $moduleOptions = $moduleOptionsPluginManager->get(ModuleOptionsInterface::class);

        $metadataReaderCacheServiceName = $moduleOptions->getMetadataReaderCache();

        /** @var Cache $metadataReaderCache */
        $metadataReaderCache = $serviceLocator->get($metadataReaderCacheServiceName);

        $reader = new AnnotationReader();
        $reader = new CachedReader($reader, $metadataReaderCache);

        return new DiscriminatorEntryListener($reader);
    }
1250936
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $plugin = new CustomGroups();
        $config = $serviceLocator->getServiceLocator()->get('Config');
        if (isset($config['custom_groups'])) {
            $plugin->setConfig($config['custom_groups']);
        }
        return $plugin;
    }
1235932
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var \Eye4web\Zf2Board\Options\ModuleOptions $options */
        $options = $serviceLocator->get('Eye4web\Zf2Board\Options\ModuleOptions');

        /** @var \Zend\Authentication\AuthenticationService $service */
        $service = $serviceLocator->get($options->getAuthenticationService());

        return $service;
    }
637696
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $fileTypeAdapters = $serviceLocator->getServiceLocator()->get("prooph.link.fileconnector.file_type_adapter_manager");

        return new FileManagerController($fileTypeAdapters->getAvailableFileTypes());
    }