@param QueryHandlerConfigurationInterface $queryHandlerConfiguration

@throws \UnexpectedValueException

@return QueryHandlerInterface
973648
public function createQueryHandler(
        QueryHandlerConfigurationInterface $queryHandlerConfiguration
    ): QueryHandlerInterface {
        return new EAVQueryHandler(
            $this->filterTypeRegistry,
            $queryHandlerConfiguration,
            $this->entityManager,
            $this->familyRegistry,
            $this->filterHelper,
            $this->dataLoader
        );
    }
285435
public function sendRequest(SolrClient $solr, $headers = null, array $options = array())
    {
        // If we don't have a request handler, then the passed request is only a
        // component and we cannot execute the search.
        if (null === $this->handlerName) {
            throw new \UnexpectedValueException('Unable to send request: handler name missing');
        }

        // @todo Add a method in \PSolr\Response\Response to normalize the XML
        // in to an array. Just use JSON and all is right in the world.
        $params = $this->toArray();
        $data = $solr->sendRequest($this->handlerName, $params, $this->renderBody(), $headers, $options);
        return is_array($data) ? new $this->responseClass($data, $params) : $data;
    }
533729
public function getAdapter()
    {
        if(!$this->_adapter instanceof KDatabaseAdapterInterface)
        {
            $this->_adapter = $this->getObject($this->_adapter);

            if(!$this->_adapter instanceof KDatabaseAdapterInterface)
            {
                throw new UnexpectedValueException(
                    'Adapter: '.get_class($this->_adapter).' does not implement KDatabaseAdapterInterface'
                );
            }
        }

        return $this->_adapter;
    }
1034176
public function findHandler(Query $query)
    {
        $query_name = get_class($query);

        return isset($this->handlers[$query_name]) ? $this->handlers[$query_name] : null;
    }
561290
public function getExceptionFor(RequestInterface $request): ClientExceptionInterface
    {
        try {
            return $this->exceptions[$request];
        } catch (\UnexpectedValueException $e) {
            throw new \UnexpectedValueException('Request not found', $e->getCode(), $e);
        }
    }
192061
protected void initializeQueryHandler() throws RepositoryException, RepositoryConfigurationException
   {
      // initialize query handler
      String className = config.getType();
      if (className == null)
      {
         throw new RepositoryConfigurationException("Content hanler       configuration fail");
      }

      try
      {
         Class<?> qHandlerClass = ClassLoading.forName(className, this);
         try
         {
            // We first try a constructor with the workspace id
            Constructor<?> constuctor =
               qHandlerClass.getConstructor(String.class, QueryHandlerEntry.class, ConfigurationManager.class);
            handler = (QueryHandler)constuctor.newInstance(wsContainerId, config, cfm);
         }
         catch (NoSuchMethodException e)
         {
            // No constructor with the workspace id can be found so we use the default constructor
            Constructor<?> constuctor =
               qHandlerClass.getConstructor(QueryHandlerEntry.class, ConfigurationManager.class);
            handler = (QueryHandler)constuctor.newInstance(config, cfm);
         }
         QueryHandler parentHandler = (this.parentSearchManager != null) ? parentSearchManager.getHandler() : null;
         QueryHandlerContext context = createQueryHandlerContext(parentHandler);
         handler.setContext(context);

         if (parentSearchManager != null)
         {
            changesFilter = initializeChangesFilter();
            parentSearchManager.setChangesFilter(changesFilter);
         }
      }
      catch (SecurityException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
      catch (IllegalArgumentException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
      catch (ClassNotFoundException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
      catch (NoSuchMethodException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
      catch (InstantiationException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
      catch (IllegalAccessException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
      catch (InvocationTargetException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }
   }
514337
private function getAdditionalConfig($paymentHandlerGroupId)
    {
        $additionalConfig = array();
        try {
            $systemName = $this->shopPaymentConfigLoaderDataAccess->getPaymentHandlerGroupSystemNameFromId(
                $paymentHandlerGroupId
            );
        } catch (DataAccessException $e) {
            throw new ConfigurationException(
                'Data access error while trying to load payment handler group system name for ID '.$paymentHandlerGroupId,
                $e->getCode(),
                $e
            );
        }

        if (isset($this->configProviderList[$systemName])) {
            /** @var ShopPaymentConfigProviderInterface $configProvider */
            $configProvider = $this->configProviderList[$systemName];
            $additionalConfig = $configProvider->getAdditionalConfiguration();
        }

        return $additionalConfig;
    }
1153380
public function execute(Query $query)
    {
        $handler = $this->resolveHandler($query);

        return $handler->handle($query);
    }
1331295
public function getRequest()
    {
        if(!$this->_request instanceof DispatcherRequestInterface)
        {
            //Setup the request
            $this->_request->user = $this->getUser();

            $this->_request = $this->getObject('dispatcher.request', ObjectConfig::unbox($this->_request));

            if(!$this->_request instanceof DispatcherRequestInterface)
            {
                throw new \UnexpectedValueException(
                    'Request: '.get_class($this->_request).' does not implement DispatcherRequestInterface'
                );
            }
        }

        return $this->_request;
    }
424909
public function handleRequest($requestUri = null, $requestMethod = null)
    {
        if (!$this->isConfigConsistent() && false) {
            throw new \LogicException('The client configuration is not consistent');
        }

        $pathInfo = $requestUri;

        if (false !== $pos = strpos($pathInfo, '?')) {
            $pathInfo = substr($pathInfo, 0, $pos);
        }

        $pathInfo = rawurldecode($pathInfo);

        $info = $this->getDispatcher()->dispatch($requestMethod, $pathInfo);

        if ($info[0] == Dispatcher::FOUND) {
            try {
                $response = $info[1]($this);

                if ($response instanceof ResponseInterface) {
                    $this->setResponse($response);
                }
            } catch (ResponseExceptionInterface $e) {
                $this->setResponse($e->getResponse());
            }
        } elseif (!$this->isAuthenticated()) {
            if (strtoupper($requestMethod) == 'GET') {
                $_SESSION[self::class][$this->getConfig()->getEntityID()]['targeted_path'] = $requestUri;
            }

            $request = $this->getSaml()->buildAuthnRequest();
            $_SESSION[self::class][$this->getConfig()->getEntityID()]['SAML_RelayState'] = $request->getRelayState();

            $this->setResponse($this->getSaml()->getHttpRedirectBindingResponse($request));
        }

        return $this;
    }
198527
public function createExecutor($requestHandler)
    {
        if (is_callable($requestHandler)) {
            $requestHandler = new CallbackRequestHandler($requestHandler);
        } elseif (!$requestHandler instanceof RequestHandlerInterface) {
            throw new \InvalidArgumentException(sprintf(
                'Expected argument of type "RequestHandlerInterface" or "callable", "%s" given',
                is_object($requestHandler) ? get_class($requestHandler) : gettype($requestHandler))
            );
        }

        $executor = new Executor($this->getServer(), $requestHandler, $this->getExceptionHandler());
        $executor->setLogger($this->getLogger());

        return $executor;
    }
1259642
public function grant()
    {
        if (!$this->name) {
            throw new UnexpectedValueException(
                'Cannot grant privileges to a user with no name'
            );
        }
        if (!$this->grants) {
            throw new UnexpectedValueException(
                'Cannot grant privileges without being told what privileges to grant'
            );
        }
        if (!$this->grantLevel) {
            throw new UnexpectedValueException(
                'Cannot grant privileges without being told on what to grant them'
            );
        }

        $params = array();
        $parts = array(
            sprintf(
                'GRANT %s ON %s',
                strtolower($this->grants) == 'all'
                    ? 'ALL PRIVILEGES'
                    : $this->grants,
                $this->grantLevel
            )
        );

        $parts[] = 'TO :user';
        $params[':user'] = $this->name;

        if ($this->host) {
            $parts[] = '@:host';
            $params[':host'] = strtolower($this->host) == 'any' ? '%' : $this->host;
        }

        if ($this->grantGrant) {
            $parts[] = 'WITH GRANT OPTION';
        }
        
        // Wrap in 'FLUSH PRIVILEGES' commands to update in-memory state
        $this->client->execute('FLUSH PRIVILEGES');
        $this->client->execute(implode(' ', $parts), $params);
        $this->client->execute('FLUSH PRIVILEGES');
    }
1099442
public function getHandler()
    {
        if(!$this->_handler instanceof UserSessionHandlerInterface)
        {
            $this->_handler = $this->getObject($this->_handler);

            if(!$this->_handler instanceof UserSessionHandlerInterface)
            {
                throw new \UnexpectedValueException(
                    'Handler: '.get_class($this->_handler).' does not implement UserSessionHandlerInterface'
                );
            }
        }

        return $this->_handler;
    }
43984
public function process(QueryInterface $query)
    {
        if (!$query->isType(QueryInterface::TYPE_ALTER)) {
            return null;
        }

        return $this->getAlterChain()->getResult($query);
    }
59459
public function createQueryHandlerConfiguration(
        string $code,
        array $configuration
    ): QueryHandlerConfigurationInterface {
        /** @var array[] $filters */
        $filters = $configuration['filters'];
        unset($configuration['filters']);

        $queryHandlerConfiguration = new QueryHandlerConfiguration(
            $code,
            $configuration
        );

        foreach ($filters as $filterCode => $filterConfiguration) {
            $queryHandlerConfiguration->addFilter(
                $this->filterFactory->createFilter($queryHandlerConfiguration, $filterCode, $filterConfiguration)
            );
        }

        return $queryHandlerConfiguration;
    }
654944
public function getRenderer()
    {
        if (!$this->_renderer instanceof KTemplateHelperInterface)
        {
            // Make sure we have an identifier
            if(!($this->_renderer instanceof KObjectIdentifier)) {
                $this->setRenderer($this->_renderer);
            }

            $this->_renderer = $this->getObject($this->_renderer);

            if(!$this->_renderer instanceof ComActivitiesActivityRendererInterface)
            {
                throw new UnexpectedValueException(
                    'Renderer: '.get_class($this->_renderer).' does not implement ComActivitiesActivityRendererInterface'
                );
            }

            $this->_renderer->getTemplate()->registerFunction('url', array($this, 'getUrl'));
        }

        return $this->_renderer;
    }
30901
public function setRequestHandler(RequestHandler $handler)
    {
        $handlerName = $handler->getName();
        $this->handlers[$handlerName] = $handler;
        return $this;
    }