Get the LDAP filter string representation of all the operators in the collection.

@param string|null $alias The alias to narrow the filter to.
@return string
961226
public function toLdapFilter($alias = null)
    {
        if (is_null($alias) && !empty($this->aliases)) {
            $filter = $this->getLdapFilterForAliases();
        } else {
            $filter = $this->getLdapFilter($alias);
        }

        return $filter;
    }
749691
public function alias(string $alias = null)
    {
        $clone = clone $this;
        $clone->value = sprintf('%s AS %s', $clone->value, $this->quoter->quoteName($alias));

        return $clone;
    }
590314
public function getIndexInfoByAlias($alias)
    {
        $responseData = $this->db->get(['_alias', $alias]);
        if (empty($responseData)) {
            return [];
        }

        return $responseData;
    }
1018513
public function getParametersForAlias($alias)
    {
        foreach ($this->classMap as $item => $parameters) {
            if ($parameters['alias'] == $alias) {
                $parameters['class'] = $item;

                return $parameters;
            }
        }

        return null;
    }
1351111
public function getInstance($alias = null)
    {
        if (!$alias && !$this->mainAlias) {
            $namespace = explode('\\', $this->_entityName);
            $alias = strtolower(end($namespace));
            $this->mainAlias = $alias;
        } elseif ($alias) {
            $this->mainAlias = $alias;
        }

        return $this->qb ? $this->qb : $this->qb = $this->createQueryBuilder($this->mainAlias);
    }
361419
protected function normalizeBoltName($alias)
    {
        $metadata = $this->loadMetadataForClass($alias);

        return $metadata ? $metadata->getBoltName() : null;
    }
1118315
public function getAlias($name)
    {
        $aliases = $this->getAliases();
        if (isset($aliases[$name])) {
            return $aliases[$name];
        }
        return null;
    }
712676
public function get($alias)
    {
        $alias = strtolower($alias);
        if (isset($this->_items[$alias])) {
            return $this->_items[$alias];
        }

        return null;
    }
1140202
function ldap_get_userlist($filter='*') {
        $fresult = array();

        $ldapconnection = $this->ldap_connect();

        if ($filter == '*') {
           $filter = '(&('.$this->config->user_attribute.'=*)'.$this->config->objectclass.')';
        }

        $contexts = explode(';', $this->config->contexts);
        if (!empty($this->config->create_context)) {
            array_push($contexts, $this->config->create_context);
        }

        $ldap_cookie = '';
        $ldap_pagedresults = ldap_paged_results_supported($this->config->ldap_version, $ldapconnection);
        foreach ($contexts as $context) {
            $context = trim($context);
            if (empty($context)) {
                continue;
            }

            do {
                if ($ldap_pagedresults) {
                    ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldap_cookie);
                }
                if ($this->config->search_sub) {
                    // Use ldap_search to find first user from subtree.
                    $ldap_result = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute));
                } else {
                    // Search only in this context.
                    $ldap_result = ldap_list($ldapconnection, $context, $filter, array($this->config->user_attribute));
                }
                if(!$ldap_result) {
                    continue;
                }
                if ($ldap_pagedresults) {
                    ldap_control_paged_result_response($ldapconnection, $ldap_result, $ldap_cookie);
                }
                $users = ldap_get_entries_moodle($ldapconnection, $ldap_result);
                // Add found users to list.
                for ($i = 0; $i < count($users); $i++) {
                    $extuser = core_text::convert($users[$i][$this->config->user_attribute][0],
                                                $this->config->ldapencoding, 'utf-8');
                    array_push($fresult, $extuser);
                }
                unset($ldap_result); // Free mem.
            } while ($ldap_pagedresults && !empty($ldap_cookie));
        }

        // If paged results were used, make sure the current connection is completely closed
        $this->ldap_close($ldap_pagedresults);
        return $fresult;
    }
510964
public function getFieldByAlias($alias)
    {
        foreach ($this->_fields as $column => $fields)
        {
            foreach ($fields as $field)
            {
                if ($field->getAlias() === $alias)
                {
                    return $field;
                }
            }
        }
        return null;
    }
547282
public function getAlias($property)
    {
        $alias = null;

        if (isset($this->_alias[$property])) {
            $alias = $this->_alias[$property];
        }

        return $alias;
    }
974670
public function getAliasNamespace($alias)
    {
        foreach (array_keys($this->getManagers()) as $name) {
            try {
                return $this->getManager($name)->getConfiguration()->getDocumentNamespace($alias);
            } catch (PHPCRException $e) {
            }
        }

        throw PHPCRException::unknownDocumentNamespace($alias);
    }
195459
public function createQueryBuilder($alias = null)
    {
        if ($alias === null) {
            $alias = $this->getAlias();
        }

        if (empty($alias)) {
            $select = '*';
        } else {
            $select = $alias . '.*';
        }

        return $this->em->createQueryBuilder()
            ->select($select)
            ->from($this->getTableName(), $alias);
    }
1251608
public function get(string $alias = null)
    {
        if (is_null($alias)) {
            return $this->aliases;
        }

        return $this->has($alias) ? $this->aliases[$alias] : false;
    }
841260
protected function get_component_select_sql($alias = '') {
        $component = $this->get_component();
        if ($alias) {
            $alias = $alias.'.';
        }
        if (empty($component)) {
            $componentwhere = "{$alias}component IS NULL";
            $component = null;
        } else {
            $componentwhere = "({$alias}component IS NULL OR {$alias}component = :component)";
        }
        return array($componentwhere, $component);
    }
817886
protected function getConfigFilename($alias)
    {
        $files = $this->getFilesByAlias($alias);

        return isset($files[1]) ? $files[1] : null;
    }
584209
public function getAlias($alias)
    {
        return isset($this->_aliases[$alias]) ? $this->_aliases[$alias] : $alias;
    }