Condition Filters
Or
Definition
The condition filters $or
, and $and
are not required to be defined when allowing filters.
These filters are always allowed, due to these filters essentially being wrappers around other filters.
Array/Object Structure
value
array,min:2
requiredvalue.*
array
requiredAny other filter
Example
$filter = [
'type' => '$or',
'value' => [
[
'type' => '$like',
'target' => 'content',
'value' => 'awesome',
],
[
'type' => '$like',
'target' => 'content',
'value' => 'boring',
]
]
];
$sql = Comment::filter([$filter])->toRawSql();
SQL
select *
from "comments"
where (
("comments"."content" LIKE '%awesome%')
or
("comments"."content" LIKE '%boring%')
)
Modifiers
None available.