get service options

@return UserServiceOptionsInterface
513634
public function getOptions()
    {
        if (!$this->options instanceof UserServiceOptionsInterface) {
            $this->setOptions($this->getServiceManager()->get('zfcuser_module_options'));
        }
        return $this->options;
    }
230495
public function getServiceConfig()
    {
        return array(
            'aliases' => array(
                'dlccategory_doctrine_em' => 'doctrine.entitymanager.orm_default',
            ),
            
            'invokables' => array(
                'dlccategory_category_mapper'   => 'DlcCategory\Mapper\Category',
                'dlccategory_category_service'  => 'DlcCategory\Service\Category',
                'dlccategory_setup_service'     => 'DlcCategory\Service\Setup',
            ),
            
            'factories' => array(
                
                'dlccategory_category_hydrator' => function ($sm) {
                    $objectManager = $sm->get('dlccategory_doctrine_em');
                    $options       = $sm->get('dlccategory_module_options');
                    $hydrator      = new \DoctrineModule\Stdlib\Hydrator\DoctrineObject(
                            $objectManager,
                            $options->getCategoryEntityClass()
                    );
                    
                    return $hydrator;
                },
                
                'dlccategory_addcategory_form' => function ($sm) {
                    $form = new \DlcCategory\Form\AddCategory();
                    $form->setServiceLocator($sm);
                    $form->init();
                    return $form;
                },
                
                'dlccategory_editcategory_form' => function ($sm) {
                    $form = new \DlcCategory\Form\EditCategory();
                    $form->setServiceLocator($sm);
                    $form->init();
                    return $form;
                },
            
                'dlccategory_module_options' => function ($sm) {
                    $config = $sm->get('Config');
                    return new Options\ModuleOptions(isset($config['dlccategory_module_options']) ? $config['dlccategory_module_options'] : array());
                },
                
                'dlccategory_nestedset_config' => function ($sm) {
                    $em = $sm->get('dlccategory_doctrine_em');
                    $options = $sm->get('dlccategory_module_options');
                    
                    $config = new \DoctrineExtensions\NestedSet\Config($em, $options->getCategoryEntityClass());
                    return $config;
                },
                
                'dlccategory_nestedset_manager' => function ($sm) {
                    $manager = new \DoctrineExtensions\NestedSet\Manager($sm->get('dlccategory_nestedset_config'));
                    return $manager;
                },
            ),
        );
    }
1212387
protected function getServiceManager()
    {
        try {
            $serviceManager = $this->getOriginalServiceManager();
        } catch (InvalidServiceManagerException $e) {
            $serviceManager = ServiceManager::getServiceManager();
        }
        return $serviceManager;
    }
947250
private function getOptionsResolver()
    {
        // TODO Use/Merge ConfigurationBuilder options resolver.
        if (!$this->optionsResolver) {
            $resolver = new OptionsResolver();

            $resolver
                ->setRequired(['namespace', 'id', 'classes'])
                ->setDefaults([
                    'name'        => function (Options $options) {
                        return Inflector::camelize($options['id']);
                    },
                    'parent_id'   => null,
                    'event'       => null,
                    'templates'   => null,
                    'translation' => null,
                ])
                ->setAllowedTypes('namespace', 'string')
                ->setAllowedTypes('id', 'string')
                ->setAllowedTypes('name', 'string')
                ->setAllowedTypes('parent_id', ['null', 'string'])
                ->setAllowedTypes('classes', 'array')
                ->setAllowedTypes('event', ['null', 'string', 'array'])
                ->setAllowedTypes('templates', ['null', 'string', 'array'])
                ->setAllowedTypes('translation', ['null', 'array']);


            // Classes option
            $classesResolver = new OptionsResolver();
            $classesResolver
                ->setRequired(['entity'])
                ->setDefaults([
                    'form_type'  => null, // @TODO/WARNING no longer required (behavior refactoring)
                    'repository' => null,
                ])
                ->setAllowedTypes('entity', 'string')
                ->setAllowedTypes('repository', ['null', 'string'])
                ->setAllowedTypes('form_type', ['null', 'string']); // @TODO/WARNING no longer required (behavior refactoring)

            $resolver
                ->setNormalizer('classes', function (Options $options, $value) use ($classesResolver) {
                    foreach ($value as $class) {
                        if ($class && !class_exists($class)) {
                            throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                        }
                    }

                    $entity = $value['entity'];
                    if (null !== $options['translation'] && !is_subclass_of($entity, TranslatableInterface::class)) {
                        throw new InvalidOptionsException(sprintf(
                            "Class '%s' must implements '%s'.",
                            $entity,
                            TranslatableInterface::class));
                    }

                    $repository = array_key_exists('repository', $value) ? $value['repository'] : null;
                    if (null === $repository) {
                        $value['repository'] = null !== $options['translation']
                            ? TranslatableResourceRepository::class
                            : ResourceRepository::class;
                    } elseif (null !== $options['translation']) {
                        if (!is_subclass_of($repository, TranslatableResourceRepositoryInterface::class)) {
                            throw new InvalidOptionsException(sprintf(
                                "Class '%s' must implements '%s'.",
                                $repository,
                                TranslatableResourceRepositoryInterface::class
                            ));
                        }
                    } else {
                        if (!is_subclass_of($repository, ResourceRepositoryInterface::class)) {
                            throw new InvalidOptionsException(sprintf(
                                "Class '%s' must implements '%s'.",
                                $repository,
                                ResourceRepositoryInterface::class
                            ));
                        }
                    }

                    return $classesResolver->resolve($value);
                });


            // Translation option
            $translationResolver = new OptionsResolver();
            $translationResolver
                ->setRequired(['entity', 'fields'])
                ->setDefault('repository', null)
                ->setAllowedTypes('entity', 'string')
                ->setAllowedTypes('fields', 'array')
                ->setAllowedTypes('repository', ['null', 'string'])
                ->setAllowedValues('entity', function ($class) {
                    if (!class_exists($class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                    }
                    if (!is_subclass_of($class, TranslationInterface::class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' must implements '%s'.", $class, TranslationInterface::class));
                    }

                    return true;
                })
                ->setAllowedValues('fields', function ($fields) {
                    if (empty($fields)) {
                        throw new InvalidOptionsException("Translatable fields cannot be empty.");
                    }

                    return true;
                })
                ->setAllowedValues('repository', function ($class) {
                    if (null !== $class && !class_exists($class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                    }

                    return true;
                });

            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('translation', function (Options $options, $value) use ($translationResolver) {
                if (is_array($value)) {
                    return $translationResolver->resolve($value);
                }

                return $value;
            });


            // Event option
            $eventResolver = new OptionsResolver();
            $eventResolver
                ->setRequired(['class'])
                ->setDefaults([
                    'class'    => $this->defaultEventClass,
                    'priority' => 0,
                ])
                ->setAllowedTypes('class', 'string')
                ->setAllowedTypes('priority', 'int');

            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('event', function (Options $options, $value) use ($eventResolver) {
                if (is_string($value)) {
                    $value = ['class' => $value];
                }

                $value = $eventResolver->resolve((array)$value);

                if (!is_subclass_of($value['class'], ResourceEventInterface::class)) {
                    throw new InvalidOptionsException(sprintf(
                        "Class '%s' must implements '%s'.",
                        $value['class'],
                        ResourceEventInterface::class
                    ));
                }

                return $value;
            });


            // Templates option
            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('templates', function (Options $options, $value) {
                return $this->buildTemplateList($value);
            });


            $this->optionsResolver = $resolver;
        }

        return $this->optionsResolver;
    }
880692
public function getServiceInstances()
    {
        $instances = [];

        foreach ($this->getServices() as $name => $info) {
            if (!isset($info['type'])) {
                continue;
            }
            $type = $info['type'];
            unset($info['type']);

            $instances[$name] = [
                'type' => $type,
                'options' => $info,
                'instance' => static::loadService($this, $type, $name),
            ];
        }

        return $instances;
    }
6530
public function getServiceConfig()
    {
        return [
            'factories' => [
                'doctrine.entitymanager.orm_sro_account' => new Service\EntityManagerFactory('orm_sro_account'),
                'doctrine.connection.orm_sro_account' => new Service\DBALConnectionFactory('orm_sro_account'),
                'doctrine.configuration.orm_sro_account' => new Service\ConfigurationFactory('orm_sro_account'),
                'doctrine.entitymanager.orm_sro_shard' => new Service\EntityManagerFactory('orm_sro_shard'),
                'doctrine.connection.orm_sro_shard' => new Service\DBALConnectionFactory('orm_sro_shard'),
                'doctrine.configuration.orm_sro_shard' => new Service\ConfigurationFactory('orm_sro_shard'),
                'doctrine.entitymanager.orm_sro_log' => new Service\EntityManagerFactory('orm_sro_log'),
                'doctrine.connection.orm_sro_log' => new Service\DBALConnectionFactory('orm_sro_log'),
                'doctrine.configuration.orm_sro_log' => new Service\ConfigurationFactory('orm_sro_log'),
            ]
        ];
    }
891432
public function getOptions()
    {
        foreach ($this->defaultOpts() as $k => $v) {
            if (!isset($this->_options[$k])) {
                $this->_options[$k] = $v;
            }
        }
        // !important see headerCallback() function
        $this->_options[CURLOPT_HEADER] = false;
        return $this->_options;
    }
4881
protected function getOptions()
    {
        $options = array();

        foreach ($this->getModuleServices() as $module)
        {
            // Create a new option object based on the <option /> element.
            $tmp = \JHtml::_(
                'select.option', $module,
                \JText::_(trim((string) $module)), 'value', 'text'
            );

            // Add the option object to the result set.
            $options[] = $tmp;
        }

        reset($options);

        return $options;
    }
1050130
public function getIOService()
    {
        if (null === $this->ioService) {
            $this->ioService = new IOService(
                $this->client,
                $this->inputDispatcher,
                $this->outputVisitor,
                $this->requestParser
            );
        }

        return $this->ioService;
    }
1295746
private function getOptionsResolver()
    {
        if (!$this->optionsResolver) {
            $this->optionsResolver = new OptionsResolver();
            $this->configureResolver($this->optionsResolver);
        }

        return $this->optionsResolver;
    }
862259
protected function getUserChannels() {
        if (!$this->_userChannels) {
            $this->_userChannels = new UserChannelList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_userChannels;
    }
416347
public function getServiceLocator()
	{
		if (is_null($this->_serviceLocator))
			$this->_serviceLocator = new ServiceManager(new Config()); //ServiceLocatorFactory::getInstance();
		return $this->_serviceLocator;
	}
1156104
public function getServiceIds()
    {
        return array_unique(array_merge(['service_container'], array_keys($this->fileMap), array_keys($this->methodMap), array_keys($this->services)));
    }
933190
protected function setEngineServiceOptions()
    {
        $project = ProjectX::getProjectType();

        if ($project instanceof EngineServiceInterface) {
            $engine = ProjectX::getEngineType();

            $classname = get_class($engine);
            $this->options[$classname::getTypeId()] = [
                'services' => $project->defaultServices()
            ];
        }

        return $this;
    }
646962
public function getUserDomainService()
    {
        if (! $this->userDomainService) {
            $this->userDomainService = $this->getServiceLocator()->get('playgroundflow_user_domain_service');
        }
    
        return $this->userDomainService;
    }
543617
public function getOptionArray()
    {
        $result = [];
        foreach ($this->userCollectionFactory->create() as $user) {
            $result[$user->getId()] = $user->getName();
        }

        return $result;
    }
342222
protected function getClientOptions()
    {
        $options = $this->clientOptions;
        
        if ($this->items !== null)
            $options['core']['data'] = $this->items;
        
        $options['core']['check_callback'] = isset($options['core']['check_callback']) ? $options['core']['check_callback'] : true;
                
        return $options;
    }