Constructs a filter for multiple aliases that would return the requested LDAP objects in a single query.

@return string
425121
protected function getLdapFilterForAliases()
    {
        $filters = [];

        foreach (array_keys($this->aliases) as $alias) {
            $filters[] = $this->getLdapFilter($alias);
        }

        if (count($filters) == 1) {
            return $filters[0];
        } else {
            return bOr::SEPARATOR_START.bOr::SYMBOL.implode('', $filters).bOr::SEPARATOR_END;
        }
    }
945653
public function getListFilter()
    {
        if ($this->_aListFilter === null) {
            $this->_aListFilter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("where");
        }

        return $this->_aListFilter;
    }
1301597
protected function getQuery() {
        $query = '';

        foreach ($this->config['args'] as $index => $arg) {
            if (array_key_exists('command', $this->config) &&
                $arg === $this->config['command'] &&
                array_key_exists(($index + 1), $this->config['args'])) {
                $query = $this->config['args'][$index + 1];
                break;
            }
        }

        return $query;
    }
595253
protected function filters()
    {
        $where = $this->initFilters();

        $gf = $this->globalFilter();
        $where .= (empty($where) ? $gf : (empty($gf) ? '' : ' AND '.$gf));

        $gf = $this->individualColumnFilters();
        $where .= (empty($where) ? $gf : (empty($gf) ? '' : ' AND '.$gf));

        return $where;
    }
643710
private function getSearchQuery()
    {
        $queries = [];

        foreach ($this->queryProviders as $queryProvider) {
            $queries[] = $queryProvider->getQuery();
        }

        return array_filter($queries);
    }
142104
public function getCurrentFilter()
    {
        $alias = $this->filter_names[$this->position];
        $define = $this->filters[$alias];
        $filter = $this->getFilterByName($define['name'], $define['attributes']);
        return $filter;
    }
1231327
public function getQuery() : string {
        switch ($this->authType) {
            case self::CREDENTIAL:
                return sprintf('credentialToken=%s', $this->getCredentialToken());
            case self::HANDLER:
                return sprintf('handlerToken=%s', $this->getHandlerToken());
            case self::IDENTITY:
                return sprintf('identityToken=%s', $this->getIdentityToken());
        }
    }
782081
private function search(AbstractFilter $filter)
    {
        if ($this->ldapSearchOptions) {
            $ldapResource = $this->ldap->getResource();
            foreach ($this->ldapSearchOptions as $name => $options) {
                ldap_set_option($ldapResource, $name, $options);
            }
        }

        return $this->ldap->searchEntries($filter, null, Ldap::SEARCH_SCOPE_SUB, $this->entryAttributesToFetch);
    }
934467
private function getDeleteQuery()
    {
        $fromClause = null;

        if (isset($this->parts['from'][0]['alias'])) {
            $fromClause = $this->parts['from'][0]['alias'].' ';
        }

        $fromClause .= 'FROM '.$this->getFromClause();

        return 'DELETE '.$fromClause.
               (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null);
    }
557743
public function getServiceConfig()
    {
        return array(
            'aliases' => array(
            ),

            'invokables' => array(
                'dlcdiagramm_yuml_generator' => 'DlcDiagramm\Generator\Yuml',
                'dlcdiagramm_yuml_proxy' => 'DlcDiagramm\Proxy\Yuml',
                'dlcdiagramm_diagramm_service' => 'DlcDiagramm\Service\Diagramm',
            ),

            'factories' => array(
                'dlcdiagramm_yuml_filter' => function ($sm) {
                    $filter = new \Zend\Filter\FilterChain();
                    $filter->attach(new \Zend\Filter\Word\SeparatorToCamelCase(' '))
                           ->attach(new \Zend\Filter\Word\DashToUnderscore());
                    return $filter;
                },
                'dlcdiagramm_yuml_httpclient' => function ($sm) {
                    $url = $sm->get('dlcdiagramm_module_options')->getYumlUrl();
                    $httpClient = new \Zend\Http\Client($url, array('timeout' => 30));
                    $httpClient->setMethod(\Zend\Http\Request::METHOD_POST);
                    return $httpClient;
                },
                'dlcdiagramm_module_options' => function ($sm) {
                    $config = $sm->get('Config');
                    return new Options\ModuleOptions(isset($config['dlcdiagramm']) ? $config['dlcdiagramm'] : array());
                },
            ),
        );
    }
44336
protected function getAttributeToQuery($alias)
    {
        $attribute = $this->getTranslatedAttribute($alias) ?: $this->getAttribute();

        // This avoids possible LDAP injection from unverified input for an attribute name.
        if (!LdapUtilities::isValidAttributeFormat($attribute)) {
            throw new LdapQueryException(sprintf('Attribute "%s" is not a valid name or OID.', $attribute));
        }

        return $attribute;
    }
809461
public function getFilter()
    {
        if (false === $this->filter) {
            return '';
        }
        if (is_array($this->filter)) {
            return Form::get()->select($this->dataProvider->filtersKey . '[' . $this->name . ']', $this->filter, null, array(), '');
        }
        
        if (is_string($this->filter) && (strlen($this->filter) > 10)){
            return $this->filter;
        }
        
        return Form::get()->input($this->dataProvider->filtersKey . '[' . $this->name . ']');
    }
829909
private function getLDAPUser($username)
    {
        $adldap = false;
        $adUser = false;

        try {
            $ldapQuery = Settings::get('eloquent-ldap.user_filter');
            if (strpos($ldapQuery, self::USER_TOKEN)) {
                $ldapQuery = str_replace(self::USER_TOKEN, $username, $ldapQuery);
            }
            else {
                throw new \Exception("Invalid AD/LDAP query filter, check the configuration of 'LDAP_USER_FILTER'.");
            }

            $ldapFields = [
                Settings::get('eloquent-ldap.username_field'),
                Settings::get('eloquent-ldap.first_name_field'),
                Settings::get('eloquent-ldap.last_name_field'),
                Settings::get('eloquent-ldap.email_field'),
                'useraccountcontrol',
                'dn',
            ];

            // Build connection info.
            $ldapConOp = $this->GetLDAPConnectionOptions();

            if (Settings::get('eloquent-ldap.debug')) {
                // Set LDAP debug log level - useful in DEV, dangerous in PROD!!
                ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
            }

            // Connect to AD/LDAP
            $adldap = new Adldap();
            $adldap->addProvider($ldapConOp);
            $provider = $adldap->connect();

            // Search...
            $adUser = $provider->search()->select($ldapFields)->rawFilter($ldapQuery)->first();
//            $adResults = $provider->search()->select($ldapFields)->rawFilter($ldapQuery)->get();
//
//            if (isset($adResults) && is_array($adResults) && isset($adResults[0])) {
//                $adResults = $adResults[0];
//            }

            if (!$adUser) {
                $this->handleLDAPError($adldap);
            }
        } catch (\Exception $ex) {
            Log::error('Exception retrieving user information: ' . $ex->getMessage());
            Log::error($ex->getTraceAsString());
        }

        // Close connection.
        if (isset($provider)) {
            unset($provider);
        }
        // Close connection.
        if (isset($adldap)) {
            unset($adldap);
        }

        return $adUser;
    }
230501
protected function buildQuery()
    {
        $query = [
            'name' => $this->names,
            'country_id' => $this->country,
            'language_id' => $this->lang,
            'apikey' => $this->apikey
        ];

        return array_filter($query);
    }
1083048
public function getFilters()
    {
        $filters = [];

        $names = explode('_', $this->name);
        $base = '';
        $filters = [];
        while ($name = array_shift($names)) {
            $filter = $this->_searchInControllerDir($base, 'filter.yml');
            if ($filter) $filters[] = $filter;

            // when has rest.
            if (count($names) > 0) {
                $base = $base . DS . ucfirst($name);

            // when last.
            } else {
                $filter = $this->_searchInControllerDir($base, "{$name}.filter.yml");
                if ($filter) $filters[] = $filter;
            }
        }

        return $filters;
    }
361905
public function getAliases()
    {
        $endpoint = new \Elasticsearch\Endpoints\Indices\Alias\Get();
        $endpoint->setName('*');

        $responseData = $this->requestEndpoint($endpoint)->getData();

        if (!isset($responseData[$this->getName()])) {
            return [];
        }

        $data = $responseData[$this->getName()];
        if (!empty($data['aliases'])) {
            return \array_keys($data['aliases']);
        }

        return [];
    }
745778
public function getAliases()
    {
        if ($this->aliases === null) {
            $this->aliases = AliasesParser::parseSource(file_get_contents($this->getFileName()), $this->getNamespaceName());
        }
        return $this->aliases;
    }