Retorna o serviço da entidade.

@throws \InvalidArgumentException

@return mixed
336992
public function getEntityService()
    {
        if (null === $this->entityService) {
            $entityServiceClass = $this->getEntityServiceClass();
            if (!class_exists($entityServiceClass)) {
                throw new \RuntimeException("Classe $entityServiceClass inexistente!");
            }
            $this->entityService = new $entityServiceClass();
            $this->entityService->setServiceLocator($this->getServiceLocator());
        }

        return $this->entityService;
    }
1036785
public static function get_instance() {

        if (self::$_entityManager === null) {
            self::initConfig();
            //setando as configurações definidas anteriormente
            $config = Setup::createAnnotationMetadataConfiguration(self::$settings['entidades'], self::$settings['isDevMod']);
            $config->addCustomStringFunction('group_concat', 'Oro\ORM\Query\AST\Functions\String\GroupConcat');
            $config->addCustomNumericFunction('hour', 'Oro\ORM\Query\AST\Functions\SimpleFunction');
            $config->addCustomNumericFunction('timestampdiff', 'Oro\ORM\Query\AST\Functions\Numeric\TimestampDiff');
            $config->addCustomDatetimeFunction('date', 'Oro\ORM\Query\AST\Functions\SimpleFunction');
            //criando o Entity Manager com base nas configurações de dev e banco de dados
            self::$_entityManager = Em::create(self::$settings['dbParams'], $config);
        }

        return self::$_entityManager;
    }
1127310
public function toPayload()
    {
        if (empty($this->method) || !is_string($this->method)) {
            throw new InvalidArgumentException('Please check the method set properly.');
        }
        if (empty($this->id)) {
            $id = rand();
        } else {
            $id = $this->id;
        }
        $rpc = [
            'id' => $id,
            'jsonrpc' => $this->rpcVersion,
            'method' => $this->method
        ];

        if (count($this->arguments) > 0) {
            $rpc['params'] = $this->arguments;
        }
        return $rpc;
    }
341499
public function getServiceUtil()
    {
        if ($this->serviceUtil) {
            return $this->serviceUtil;
        }

        $className = $this->getServiceUtilClassName();
        $r = new ReflectionClass($className);
        $instance = $r->newInstance();

        if (!$instance instanceof ServiceUtilInterface) {
            $errMsg = sprintf('Service util not implement %s', ServiceUtilInterface::class);
            throw new Exception\RuntimeException($errMsg);
        }
        $this->serviceUtil = $instance;

        return $this->serviceUtil;
    }
255664
protected function getQtiResultService()
    {
        if (!$this->service) {
            $this->service = $this->getServiceManager()->get(ResultService::SERVICE_ID);
        }
        return $this->service;
    }
731996
public function getParser()
    {
        if (true === empty($this->parser)) {
            $typeParserClassName = sprintf('\ReadmeGen\Vcs\Type\%s', ucfirst($this->config['vcs']));

            if (false === class_exists($typeParserClassName)) {
                throw new \InvalidArgumentException(sprintf('Class "%s" does not exist', $typeParserClassName));
            }

            $this->parser = new Parser(new $typeParserClassName());
        }

        return $this->parser;
    }
1235900
protected function getResourceParameter()
    {
        $resource = parent::getResourceParameter();
        if ($resource->isInstanceOf($this->getClass(GenerisRdf::CLASS_GENERIS_USER))) {
            return $resource;
        }

        throw new InvalidArgumentException('Only user resource are allowed.');
    }
1317025
public function getServiceManager()
    {
        $serviceManager = $this->getServiceLocator();
        if ($serviceManager instanceof ServiceManager) {
            return $serviceManager;
        }
        $msg = is_null($serviceManager)
            ? 'ServiceLocator not initialized for '.get_class($this)
            : 'Alternate service locator not compatible with getServiceManager() in ' . __CLASS__;
        throw new InvalidServiceManagerException($msg);
    }
1116120
public function getAdapter()
    {
        $this->count++;
        if (is_null($this->adapter)) {
            $fss = $this->getServiceManager()->get(FileSystemService::SERVICE_ID);
            $this->adapter = $fss->getFileSystem($this->getOption('inner'))->getAdapter();
        }
        return $this->adapter;
    }
1260924
public function getService()
    {
        if (!$this->service) {
            $this->setService($this->getServiceLocator()->get('adfabcore_shortenurl_service'));
        }

        return $this->service;
    }
137062
public function createIngestClient() {

    $config = $this->configFactory->get('acm.connector');
    if (!strlen($config->get('url_ingest'))) {
      throw new \InvalidArgumentException('No Commerce Connector Service URL specified.');
    }

    $clientConfig = [
      'base_uri' => $config->get('url_ingest'),
      'timeout'  => (int) $config->get('timeout'),
      'verify'   => (bool) $config->get('verify_ssl'),
    ];

    return $this->clientFactory->fromOptions($clientConfig);
  }
138532
protected function getService($service)
    {
        if (!isset($this->app[$service])) {
            throw new \Exception('O serviço '.$service.' não foi registrado na aplicação!');
        }

        return $this->app[$service];
    }
996280
public function getService()
    {
        $service = $this->getOption('service');

        return \Owl\Service\Container::getInstance()->get($service);
    }
398748
public function get()
	{
		$fixCustomerKey = false;
		
		if ($this->filter && array_key_exists('Property', $this->filter) && $this->filter['Property'] == "CustomerKey" )
		{	
			$this->filter['Property'] = "DataExtension.CustomerKey";
			$fixCustomerKey = true;
		}				
		$response =  parent::get();	
		if ($fixCustomerKey )
		{
			$this->filter['Property'] = "CustomerKey";
		}
		
		return $response;
	}
133753
public function get()
    {
        if ($this->targetSize) {
            throw new \InvalidArgumentException('can\'t get original iamge if target size is already set');
        }
        $this->mode = 'default';
        $this->arguments = [];

        return $this->process();
    }
817135
public function getResponse()
    {
        if (! $this->_response instanceof LibBaseDispatcherResponse) {
            $this->_response = parent::getResponse();

            if (! $this->_response instanceof LibBaseDispatcherResponse) {
                throw new InvalidArgumentException(
                    'Response: '.get_class($this->_response).' must be an intance of LibBaseDispatcherResponse'
                );
            }

            $this->_response->setRequest($this->getRequest());
        }

        return $this->_response;
    }
1184289
public function order()
    {
        if (request()->ajax()) {
            $_order = request()->get('_order');
            $order = json_decode($_order, true);

            if (json_last_error() != JSON_ERROR_NONE) {
                throw new \InvalidArgumentException(json_last_error_msg());
            }

            Menu::saveOrder($order);
            return response()->json(['status' => 1, 'message' => 'success']);
        }

        return response()->json(['message' => '调整失败']);
    }