N98\Magento\DbSettings::quoteIdentifier PHP Method

quoteIdentifier() private method

Mysql quoting of an identifier
private quoteIdentifier ( string $identifier ) : string
$identifier string UTF-8 encoded
return string quoted identifier
    private function quoteIdentifier($identifier)
    {
        $quote = '`';
        // le backtique
        $pattern = '~^(?:[\\x1-\\x7F]|[\\xC2-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2})+$~';
        if (!preg_match($pattern, $identifier)) {
            throw new InvalidArgumentException(sprintf('Invalid identifier, must not contain NUL and must be UTF-8 encoded in the BMP: %s (hex: %s)', var_export($identifier), bin2hex($identifier)));
        }
        return $quote . strtr($identifier, array($quote => $quote . $quote)) . $quote;
    }