Wraps a plain (without nesting by dots) identifier (table name, column, database, etc.) with quotes and screens
inside quotes. Must wrap everything even . and *.

@param string $identifier
@return string
962431
public function quoteIdentifier(string $identifier): string
    {
        return ($this->grammar ?? $this->database->getGrammar())->quoteIdentifier($identifier);
    }
27447
public function quoteIdentifier($string)
    {
        $identifierQuoteCharacter = $this->getConnection()->getDatabasePlatform()->getIdentifierQuoteCharacter();

        if (!$identifierQuoteCharacter) {
            $identifierQuoteCharacter = '`';
        }

        $string = trim(str_replace($identifierQuoteCharacter, '', $string));
        try {
            $result = $this->getConnection()->quoteIdentifier($string);
        } catch (DBALException $exception) {
            $exception = $this->convertException($exception);
            $this->handleException($exception);
        } catch (PDOException $exception) {
            $exception = $this->convertException($exception);
            $this->handleException($exception);
        }

        return $result;
    }
670285
public function loadIdentifier($identifier)
    {
        $result = false;

        $identifier = AnService::getIdentifier($identifier);

        //Get the path
        $path = $identifier->filepath;

        if ($path !== false) {
            $result = self::loadFile($path);
        }

        return $result;
    }
786754
public function quoteNames(array $identifiers): array
    {
        foreach ($identifiers as $key => $identifier) {
            if ($identifier instanceof RawExp) {
                $identifiers[$key] = $identifier->getValue();
                continue;
            }
            $identifiers[$key] = $this->quoteName($identifier);
        }

        return $identifiers;
    }
81611
function mappingTable( $identifier )
    {
        if ( isset( $this->TransformationTables[$identifier] ) )
            return $this->TransformationTables[$identifier];
        return false;
    }
446668
public function quoteIdentifier($identifier)
    {
        $identifier = trim($identifier);

        if ($identifier === '*' || $identifier === '') {
            return $identifier;
        }

        // string
        if (preg_match('/^[\w-]+$/u', $identifier)) {
            return $this->_startQuote . $identifier . $this->_endQuote;
        }

        // string.string
        if (preg_match('/^[\w-]+\.[^ \*]*$/u', $identifier)) {
            $items = explode('.', $identifier);

            return $this->_startQuote . implode($this->_endQuote . '.' . $this->_startQuote, $items) . $this->_endQuote;
        }

        // string.*
        if (preg_match('/^[\w-]+\.\*$/u', $identifier)) {
            return $this->_startQuote . str_replace('.*', $this->_endQuote . '.*', $identifier);
        }

        // Functions
        if (preg_match('/^([\w-]+)\((.*)\)$/', $identifier, $matches)) {
            return $matches[1] . '(' . $this->quoteIdentifier($matches[2]) . ')';
        }

        // Alias.field AS thing
        if (preg_match('/^([\w-]+(\.[\w\s-]+|\(.*\))*)\s+AS\s*([\w-]+)$/ui', $identifier, $matches)) {
            return $this->quoteIdentifier($matches[1]) . ' AS ' . $this->quoteIdentifier($matches[3]);
        }

        // string.string with spaces
        if (preg_match('/^([\w-]+\.[\w][\w\s\-]*[\w])(.*)/u', $identifier, $matches)) {
            $items = explode('.', $matches[1]);
            $field = implode($this->_endQuote . '.' . $this->_startQuote, $items);

            return $this->_startQuote . $field . $this->_endQuote . $matches[2];
        }

        if (preg_match('/^[\w_\s-]*[\w_-]+/u', $identifier)) {
            return $this->_startQuote . $identifier . $this->_endQuote;
        }

        return $identifier;
    }
502691
public static function doEscapeIdentifier($Identifier, $instance=null) {
		self::prepareInstance($instance);
		return self::$instances[$instance]->escapeIdentifier($Identifier);
	}
626788
public function translate($identifier)
    {
        $pieces = explode('\\', $identifier);
        if (isset($this->aliases[$pieces[0]])) {
            $return = $this->aliases[$pieces[0]];
            if (count($pieces) > 1) {
                array_shift($pieces);
                $return .= '\\' . implode('\\', $pieces);
            }
        } else {
            $return = $this->namespace !== '' ? $this->namespace . '\\' . $identifier : $identifier;
        }
        return $return;
    }
115163
public function prefixTables($table, bool $use_identifier = false)
    {
        if ($table instanceof \Closure || is_resource($table)) {
            throw new \InvalidArgumentException(
                "Invalid value to be quote, table value could not be instance of `Closure` or as a `Resource`",
                E_USER_ERROR
            );
        }

        $prefix = $this->getTablePrefix();
        if (is_array($table)) {
            foreach ($table as $key => $value) {
                $table[$key] = $this->prefixTables($value, $use_identifier);
            }
            return $table;
        }
        if (is_object($table)) {
            foreach (get_object_vars($table) as $key => $value) {
                $table->{$key} = $this->prefixTables($value, $use_identifier);
            }
            return $table;
        }
        if (!is_string($table)) {
            return null;
        }
        if (strpos($table, $this->currentQuoteIdentifier) !== false) {
            $use_identifier = true;
        }
        if (!empty($prefix) && is_string($prefix) && trim($prefix)) {
            $tableArray = explode('.', $table);
            $tableArray    = $this->trimTableSelector($tableArray);
            if (count($tableArray) > 1) {
                $connectionParams = $this->getConnectionParams();
                if (isset($connectionParams['dbname']) && $tableArray[0] == $connectionParams['dbname']) {
                    $tableArray[1] = $this->prefixTableCallback($tableArray);
                }
                if ($use_identifier) {
                    return $this->currentQuoteIdentifier
                           . implode("{$this->currentQuoteIdentifier}.{$this->currentQuoteIdentifier}", $tableArray)
                           . $this->currentQuoteIdentifier;
                } else {
                    return implode(".", $tableArray);
                }
            } else {
                $table = $this->prefixTableCallback($tableArray[0]);
            }
        }

        return $use_identifier
            ? $this->currentQuoteIdentifier.$table.$this->currentQuoteIdentifier
            : $table;
    }
1076110
public static function parse(string $identifier): array
    {
        $matches = [];
        $identifiers = [];
        $num = preg_match_all('/(\w+)=(?<=\w=)(.+?)(?=;\w+=)|(\w+)=([^;]+);?$/', $identifier, $matches, PREG_SET_ORDER);

        foreach ($matches as $i => $match) {
            if ($i === $num - 1) {
                $identifiers[$match[3]] = $match[4];
                continue;
            }
            $identifiers[$match[1]] = $match[2];
        }

        return $identifiers;
    }
163832
protected static function getInternal($identifier)
    {
        $ids = explode('.', $identifier);
        $base = &self::$container;

        while ($current = array_shift($ids)) {
            if (is_array($base) && array_key_exists($current, $base)) {
                $base = &$base[$current];
            } else {
                return null;
            }
        }

        $result = $base;

        return $result;
    }
18446
public function quoteName(string $identifier): string
    {
        $identifier = trim($identifier);
        $separators = [' AS ', ' ', '.'];
        foreach ($separators as $sep) {
            $pos = strripos($identifier, $sep);
            if ($pos) {
                return $this->quoteNameWithSeparator($identifier, $sep, $pos);
            }
        }

        return $this->quoteIdentifier($identifier);
    }
552687
public function parseIdentifier(ObjectIdentifier $identifier)
    {
        $package = ucfirst($identifier->package);
        $path    = StringInflector::implode($identifier->path);
        $file    = ucfirst($identifier->name);
        $class   = $path.$file;

        $info = array(
            'class'      => $class,
            'package'    => $package,
            'path'       => $path,
            'file'       => $file,
        );

        return $info;
    }
846901
protected function _quoteIdentifier($identifier)
        {
            if (Arrays::is($identifier)) {
                $result = array_map(array($this, '_quoteOneIdentifier'), $identifier);

                return join(', ', $result);
            } else {
                return $this->_quoteOneIdentifier($identifier);
            }
        }
962793
protected static function _parseIdentifier($identifier)
    {
        $parts = array();
        $hash  = $identifier;

        // Validate the variable format
        if (strpos($identifier, '.') !== false) {
            // Split the variable name into it's parts
            $parts = explode('.', $identifier);

            // Validate the hash name
            $hash   = array_shift($parts);
        }

        $hash = strtoupper($hash);

        return array($hash, $parts);
    }
806841
public function get($identifier)
    {
        $identifier = (string) $identifier;

        if($this->offsetExists($identifier)) {
            $result = $this->offsetGet($identifier);
        } else {
            $result = null;
        }

        return $result;
    }
154714
final public function identifiers($identifier)
    {
        // Convert tabs or multiple spaces into single spaces
        $identifier = preg_replace('/[\t ]+/', ' ', $identifier);

        // If the item has an alias declaration we remove it and set it aside.
        // Basically we remove everything to the right of the first space
        $alias = '';
        if (strpos($identifier, ' ') !== FALSE) {
            $alias = strstr($identifier, " ");
            $identifier = substr($identifier, 0, -strlen($alias));
        }

        if (strpos($identifier, '.') !== FALSE) {

            //do something
        }

        //return for now
        return $identifier . $alias;
    }