Skip to content

Commit a38d1f3

Browse files
committed
feat: Add whereLike clause to query builder
laravel/framework#52147
1 parent ba684a3 commit a38d1f3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Oci8/Query/Grammars/OracleGrammar.php

+22
Original file line numberDiff line numberDiff line change
@@ -720,4 +720,26 @@ protected function compileUnionSelectFromDual(array $values): string
720720
return 'select '.$values.' from dual';
721721
})->implode(' union all ');
722722
}
723+
724+
/**
725+
* Compile a "where like" clause.
726+
*
727+
* @param \Illuminate\Database\Query\Builder $query
728+
* @param array $where
729+
* @return string
730+
*/
731+
protected function whereLike(Builder $query, $where)
732+
{
733+
$where['operator'] = $where['not'] ? 'not like' : 'like';
734+
735+
if ($where['caseSensitive']) {
736+
return $this->whereBasic($query, $where);
737+
}
738+
739+
$value = $this->parameter($where['value']);
740+
741+
$operator = str_replace('?', '??', $where['operator']);
742+
743+
return 'upper('.$this->wrap($where['column']).') '.$operator.' upper('.$value.')';
744+
}
723745
}

0 commit comments

Comments
 (0)