Get service with common arguments

@return mixed
5972
protected function getCommonService() {
		if ($this->service === null) {
			if ($this->arguments === null) {
				$this->service = $this->initService();
			} else {
				$args = $this->normalizeArgs($this->arguments);
				$args = $this->processArgs($args);
				
				$this->service = $this->initService($args);
			}
		}
		
		return $this->service;
	}
530176
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new ServiceOptions();
			case 1:
				return new ServiceOptions(func_get_arg(0));
			case 2:
				return new ServiceOptions(func_get_arg(0), func_get_arg(1));
			case 3:
				return new ServiceOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new ServiceOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new ServiceOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new ServiceOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new ServiceOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new ServiceOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
1050130
public function getIOService()
    {
        if (null === $this->ioService) {
            $this->ioService = new IOService(
                $this->client,
                $this->inputDispatcher,
                $this->outputVisitor,
                $this->requestParser
            );
        }

        return $this->ioService;
    }
270508
protected function _getServicePath()
    {
        if (isset($this->_options['server'])) {
            return $this->_options['server']->getDirectory();
        }

        if (isset($this->_options['directories'])) {
            return $this->_options['directories'];
        }

        return array();
    }
590006
protected function getServiceByArgs($args) {
		$args = $this->normalizeArgs($args);
		$id   = $this->getIdByArgs($args);
		$args = $this->processArgs($args);
			
		if (! isset($this->servicesByArgs[$id])) {
			$this->servicesByArgs[$id] = $this->initService($args);
		}

		return $this->servicesByArgs[$id];
	}
753261
public function getServices()
	{
		$services = false;
		if (!empty($this->cache) && Yii::$app->has($this->cache)) {
			/** @var $cache \yii\caching\Cache */
			$cache = Yii::$app->get($this->cache);
			$services = $cache->get('EAuth.services');
		}

		if (false === $services || !is_array($services)) {
			$services = [];
			foreach ($this->services as $service => $options) {
				/** @var $class ServiceBase */
				$class = $this->getIdentity($service);
				$services[$service] = (object)[
					'id' => $class->getServiceName(),
					'title' => $class->getServiceTitle(),
					'type' => $class->getServiceType(),
					'jsArguments' => $class->getJsArguments(),
				];
			}
			if (isset($cache)) {
				$cache->set('EAuth.services', $services, $this->cacheExpire);
			}
		}
		return $services;
	}
87702
public static function getServicesList()
    {
        $map = [
          'GET' => 'get',
          'POST' => 'create',
          'PUT' => 'update',
          'DELETE' => 'delete',
        ];
        
        $table = new \Console_Table();
        $table->setHeaders(['Method', 'Type', 'Description', 'Parameters']);
        foreach (self::getServices() as $key => $service) {
            if ($service['type'] == 'entity') {
                foreach ($service['actions'] as $action) {
                    $table->addRow([
                        sprintf('xAC::%s()->%s()'
                            , $service['endpoint']
                            , $action['endpoint'] == 'default' ? $map[$action['method']] : $action['endpoint']
                            ), 
                        'entity/' . $action['type'], 
                        $action['description']
                    ]);
                }
            } else {
                $table->addRow(['xAC::' . $service['endpoint'] . '()->get()', $service['type'], $service['description']]);
            }
        }
        
        echo $table->getTable();
    }
973864
public function get($serviceName)
    {
        if ($this->registry->has($serviceName)) {
            $service = $this->registry->getStrict($serviceName);
        }
        elseif ($this->parameterContainer->has($serviceName)) {
            $service = $this->parameterContainer->get($serviceName);
        }
        else {
            $service = $this->resolveService($serviceName);
        }

        return $service;
    }
619646
public function getServiceDescription()
	{
		return array(
			$this->_name . '.init' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.finish' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.deleteItems' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.saveItems' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.searchItems' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "condition","optional" => true ),
					array( "type" => "integer","name" => "start","optional" => true ),
					array( "type" => "integer","name" => "limit","optional" => true ),
					array( "type" => "string","name" => "sort","optional" => true ),
					array( "type" => "string","name" => "dir","optional" => true ),
				),
				"returns" => "array",
			),
		);
	}
852319
public function getService($service)
    {
        $service = $this->mapServiceName($service);

        if (isset($this->services[$service])) {
            return $this->services[$service];
        }

        return $this->services[$service] = $this->createService($service);
    }
1294588
public function &getService($service)
    {

        $classServiceName = basename($service);
        if (isset($this->$classServiceName)) {
            return $this->$classServiceName;
        } else {
            $service = ucfirst($service);
            $factoryClass = $service . "Factory";

            if (class_exists($factoryClass)) {
                $factory = new $factoryClass();
                if ($factory instanceof ServiceFactory) {
                    if (!$this->isUnderConstruction($service)) {
                        $this->underConstruction($service);
                        $newService = $factory->create();
                        $this->constructed($service);
                    } else {
                        if(isset($this->proxyObjects[$classServiceName])) {
                            return $this->proxyObjects[$classServiceName];
                        }else{
                            return $this->$classServiceName;
                        }
                    }

                    $this->$classServiceName = $newService;
                    return $newService;
                }
            }

            if (!$this->isUnderConstruction($service)) {
                $this->underConstruction($service);
                $object = new $service();
                if ($object instanceof ServiceFactory) {
                    $newService = $object->create();
                } else {
                    $newService = $object;
                }
                $this->constructed($service);
            } else {
                if(isset($this->proxyObjects[$classServiceName])) {
                    return $this->proxyObjects[$classServiceName];
                }else{
                    return $this->$classServiceName;
                }
            }

            $this->$classServiceName = $newService;
            return $newService;
        }
    }
466738
public function get($service)
    {
        return $this->has($service) ? $this->container->get($service) : null;
    }
399365
public function getServiceDescription()
	{
		return array(
			$this->name . '.init' => array(
				"parameters" => array(
					array( "type" => "string", "name" => "site", "optional" => false ),
					array( "type" => "array", "name" => "items", "optional" => false ),
				),
				"returns" => "array",
			),
			$this->name . '.finish' => array(
				"parameters" => array(
					array( "type" => "string", "name" => "site", "optional" => false ),
					array( "type" => "array", "name" => "items", "optional" => false ),
				),
				"returns" => "array",
			),
			$this->name . '.deleteItems' => array(
				"parameters" => array(
					array( "type" => "string", "name" => "site", "optional" => false ),
					array( "type" => "array", "name" => "items", "optional" => false ),
				),
				"returns" => "array",
			),
			$this->name . '.saveItems' => array(
				"parameters" => array(
					array( "type" => "string", "name" => "site", "optional" => false ),
					array( "type" => "array", "name" => "items", "optional" => false ),
				),
				"returns" => "array",
			),
			$this->name . '.searchItems' => array(
				"parameters" => array(
					array( "type" => "string", "name" => "site", "optional" => false ),
					array( "type" => "array", "name" => "condition", "optional" => true ),
					array( "type" => "integer", "name" => "start", "optional" => true ),
					array( "type" => "integer", "name" => "limit", "optional" => true ),
					array( "type" => "string", "name" => "sort", "optional" => true ),
					array( "type" => "string", "name" => "dir", "optional" => true ),
					array( "type" => "array", "name" => "options", "optional" => true ),
				),
				"returns" => "array",
			),
		);
	}
996280
public function getService()
    {
        $service = $this->getOption('service');

        return \Owl\Service\Container::getInstance()->get($service);
    }
502992
public function getServiceLocator()
    {
        if ($this->serviceLocator) {
            return $this->serviceLocator;
        }

        $this->serviceLocator = static::getDefaultServiceLocator();

        return $this->serviceLocator;
    }
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;
                },
            ),
        );
    }
907702
protected function getCompileService()
    {
        if ($this->compileService === null) {
            $this->compileService = GeneralUtility::makeInstance(CompileService::class);
        }
        return $this->compileService;
    }