Nette\Database\Drivers\PgSqlDriver::formatLike PHP Метод

formatLike() публичный Метод

Encodes string for use in a LIKE statement.
public formatLike ( $value, $pos )
    public function formatLike($value, $pos)
    {
        $bs = substr($this->connection->quote('\\', \PDO::PARAM_STR), 1, -1);
        // standard_conforming_strings = on/off
        $value = substr($this->connection->quote($value, \PDO::PARAM_STR), 1, -1);
        $value = strtr($value, ['%' => $bs . '%', '_' => $bs . '_', '\\' => '\\\\']);
        return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
    }