Nette\Database\Drivers\MySqlDriver::formatLike PHP Method

formatLike() public method

Encodes string for use in a LIKE statement.
public formatLike ( $value, $pos )
    public function formatLike($value, $pos)
    {
        $value = addcslashes(substr($this->connection->quote($value), 1, -1), '%_');
        return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
    }