Retrieve Search Containers for a given optimizer.

@param int $optimizerId The optimizer Id

@return array
181585
public function getSearchContainersFromOptimizerId($optimizerId)
    {
        $connection = $this->getConnection();

        $select = $connection->select();

        $select->from(
            $this->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER),
            [OptimizerInterface::SEARCH_CONTAINER, 'apply_to']
        )->where(OptimizerInterface::OPTIMIZER_ID . ' = ?', (int) $optimizerId);

        return $connection->fetchPairs($select);
    }
318138
public function getServiceIds()
    {
        $ids = array();

        if (!$this->methodMap && !$this instanceof ContainerBuilder && __CLASS__ !== static::class) {
            // We only check the convention-based factory in a compiled container (i.e. a child class other than a ContainerBuilder,
            // and only when the dumper has not generated the method map (otherwise the method map is considered to be fully populated by the dumper)
            @trigger_error('Generating a dumped container without populating the method map is deprecated since Symfony 3.2 and will be unsupported in 4.0. Update your dumper to generate the method map.', E_USER_DEPRECATED);

            foreach (get_class_methods($this) as $method) {
                if (preg_match('/^get(.+)Service$/', $method, $match)) {
                    $ids[] = self::underscore($match[1]);
                }
            }
        }
        $ids[] = 'service_container';

        return array_unique(array_merge($ids, array_keys($this->methodMap), array_keys($this->fileMap), array_keys($this->services)));
    }
1350287
public function get($blogId, $optParams = array()) {
      $params = array('blogId' => $blogId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Google_Blog($data);
      } else {
        return $data;
      }
    }
194424
public function listRevisions($fileId, $optParams = array()) {
      $params = array('fileId' => $fileId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('list', array($params));
      if ($this->useObjects()) {
        return new RevisionList($data);
      } else {
        return $data;
      }
    }
120297
private function getContainerConfiguration()
    {
        $containerName = $this->getRequest()->getParam('search_container_preview');

        $containerConfig = $this->containerConfigFactory->create(
            ['containerName' => $containerName, 'storeId' => $this->getOptimizer()->getStoreId()]
        );

        return $containerConfig;
    }
1332805
public function getResource(string $id = null): array
    {
        if ($id) {
            if (is_numeric($id)) {
                $filter = array_filter($this->resource, function ($row) use ($id) { return $row['id'] == $id; });
                return (array) array_pop($filter);
            }
            return (array) ($this->resource[$id] ?? []);
        }
        return $this->resource;
    }
601950
protected function getStaticContainerServices() {
    $container_builder = $this->containerBuilderGetter->getContainerBuilder();

    // We can get service IDs from the container,
    $static_container_reflection = new \ReflectionClass('\Drupal');
    $filename = $static_container_reflection->getFileName();
    $source = file($filename);

    $methods = $static_container_reflection->getMethods();
    $service_definitions = [];
    foreach ($methods as $method) {
      $name = $method->getName();

      // Skip any which have parameters: the service getter methods have no
      // parameters.
      if ($method->getNumberOfParameters() > 0) {
        continue;
      }

      $start_line = $method->getStartLine();
      $end_line = $method->getEndLine();

      // Skip any which have more than 2 lines: the service getter methods have
      // only 1 line of code.
      if ($end_line - $start_line > 2) {
        continue;
      }

      // Get the single code line.
      $code_line = $source[$start_line];

      // Extract the service ID from the call to getContainer().
      $matches = [];
      $code_line_regex = "@return static::getContainer\(\)->get\('([\w.]+)'\);@";
      if (!preg_match($code_line_regex, $code_line, $matches)) {
        continue;
      }
      $service_id = $matches[1];

      $docblock = $method->getDocComment();

      // Extract the interface for the service from the docblock @return.
      $matches = [];
      preg_match("[@return (.+)]", $docblock, $matches);
      $interface = $matches[1];

      // Extract a description from the docblock first line.
      $docblock_lines = explode("\n", $docblock);
      $doc_first_line = $docblock_lines[1];

      $matches = [];
      preg_match("@(the (.*))\.@", $doc_first_line, $matches);
      $description = ucfirst($matches[1]);
      $label = ucfirst($matches[2]);

      $definition = $container_builder->getDefinition($service_id);

      $service_definition = [
        'id' => $service_id,
        'label' => $label,
        'static_method' => $name, // not used.
        'class' => '\\' . $definition->getClass(),
        'interface' => $interface,
        'description' => $description,
      ];
      $service_definitions[$service_id] = $service_definition;
    }

    // Sort by ID.
    ksort($service_definitions);

    return $service_definitions;
  }
42589
public function findByProcessingId($processingId)
    {
        $handlers = [];

        $builder = $this->connection->createQueryBuilder();

        $builder->select('*')->from(Tables::MESSAGE_HANDLER)
            ->where($builder->expr()->eq('processing_id', ':processing_id'))
            ->setParameter('processing_id', $processingId);

        foreach($builder->execute() as $row) {
            $this->fromDatabase($row);
            array_push($handlers, $row);
        }

        return $handlers;
    }
1182155
public function getUserCapabilities(string $userId): array
    {
        if (empty($this->userCapabilities)) {
            $this->userCapabilities = Utils::fetchUserCapabilities($userId);
        }

        return $this->userCapabilities;
    }
603944
public static function getList($excludeId = 0)
    {
        $list = [];
        $query = self::find()->orderBy('position DESC, title');

        if (!empty($excludeId)) {
            $query->where('`id` != :excludeId', ['excludeId' => $excludeId]);
        }

        $models = $query->all();

        foreach ($models as $model) {
            $list[$model->id] = $model->title;
        }

        return $list;
    }
171686
private function getService($id)
    {
        if (null !== $this->container && $this->container->has($id)) {
            return $this->container->get($id);
        }

        return null;
    }
1156958
private function getOptimizer()
    {
        $optimizer = $this->optimizerFactory->create();
        $optimizer->setData($this->getRequest()->getPostValue());
        $ruleConditionPost = $this->getRequest()->getParam('rule_condition', []);
        $optimizer->getRuleCondition()->loadPost($ruleConditionPost);

        return $optimizer;
    }
1284488
public static function getControllers($extensionId) {
        try {
            $controllerClasses = ServiceManager::getServiceManager()->get('generis/cache')->get(self::EXTENSION_PREFIX.$extensionId);
        } catch (\common_cache_NotFoundException $e) {
            $factory = new Factory();
            $controllerClasses = array();
            foreach ($factory->getControllers($extensionId) as $controller) {
                $controllerClasses[] = $controller->getClassName();
            }
            ServiceManager::getServiceManager()->get('generis/cache')->put($controllerClasses, self::EXTENSION_PREFIX.$extensionId);
        }
        return $controllerClasses;
    }
516354
private function getQueryIdsLimitation($entity)
    {
        $searchContainerData = $entity->getData('quick_search_container');
        $applyTo  = is_array($searchContainerData) ? ((bool) $searchContainerData['apply_to'] ?? false) : false;
        $queryIds = [];

        if (($applyTo !== false) && (isset($searchContainerData['query_ids']) && !empty($searchContainerData['query_ids']))) {
            $ids = $queryIds = $searchContainerData['query_ids'];

            if (is_array(current($ids))) {
                $queryIds = [];
                foreach ($ids as $queryId) {
                    if (isset($queryId['id'])) {
                        $queryIds[] = (int) $queryId['id'];
                    }
                }
            }
        }

        return $queryIds;
    }
500136
private function getSearchRequest($storeId, $sessionIds)
    {
        $queryFilters = ['session.uid' => $sessionIds];

        return $this->searchRequestBuilder->create($storeId, self::SEARCH_REQUEST_CONTAINER, 0, 0, null, [], [], $queryFilters);
    }
147569
protected function getCombinesForPackage($packageId)
    {
        $cacheKey = 'packageCombines.'.$packageId;
        $packageCombines = $this->getCachedValue($cacheKey);
        if ($packageCombines === false) {
            $packageCombines = array();

            $data = $this->dataProvider->getData();
            if (isset($data[$packageId])) {
                $info = $data[$packageId];
                if (isset($info['Combines']) && is_array($info['Combines'])) {
                    $packageCombines = $info['Combines'];
                }
            }

            $this->setCachedValue($cacheKey, $packageCombines);
        }

        return $packageCombines;
    }
1138176
protected function criteriaToParameters(ContainerInterface $Container)
    {
        /*
         * @var CriteriumInterface $Criterium
         */
        $parameters = [];
        foreach ($Container->getCriteria()->getCriteriumCollection() as $Criterium) {
            $SqlPart = $Criterium->getSqlPart();
            $parameters[] = $SqlPart->getParameters();
        }

        return $parameters;
    }