public function getAsWhereArguments(FilterInterface $filter, array $handlers): array
{
$convertedFilter = $this->convertFilter($filter->filter);
$handledFilter = $convertedFilter instanceof Not ? $convertedFilter->filter : $convertedFilter;
$handler = $handlers[$handledFilter::class] ?? null;
if ($handler === null) {
throw new NotSupportedFilterException($handledFilter::class);
}
$where = $handler->getAsWhereArguments($handledFilter, $handlers);
if (!$convertedFilter instanceof Not) {
return $where;
}
$operator = $where[1];
$where[1] = match ($operator) {
'between', 'in', 'like' => "not $operator",
'=' => '!=',
default => $operator,
};
return $where;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.