Nicolaslopezj\Searchable\SearchableTrait::getCaseCompare PHP Метод

getCaseCompare() защищенный Метод

Returns the comparison string.
protected getCaseCompare ( string $column, string $compare, float $relevance ) : string
$column string
$compare string
$relevance float
Результат string
    protected function getCaseCompare($column, $compare, $relevance)
    {
        if ($this->getDatabaseDriver() == 'pgsql') {
            $field = "LOWER(" . $column . ") " . $compare . " ?";
            return '(case when ' . $field . ' then ' . $relevance . ' else 0 end)';
        }
        $column = str_replace('.', '`.`', $column);
        $field = "LOWER(`" . $column . "`) " . $compare . " ?";
        return '(case when ' . $field . ' then ' . $relevance . ' else 0 end)';
    }