SearchFilter
in package
Define search filter
Define the interface for search filter object, this class provides base method requirements so the filter can be used in our search engines in a generic way. Sub filter implementations need to implement the methods to be represented as solr query term at least should for sql as well
Tags
Table of Contents
- $empty : bool
- Allow empty
- $field : mixed
- $is_or : bool
- Is or filter
- $value : mixed
- Field() : mixed
- Get the filed
- IsOr() : bool
- Is or connection?
- ToQuery() : string
- To query Convert the search filter instance to search query string
- ToSqlQuery() : SqlTerm|array<string|int, SqlTerm>|null
- Create a sql query based on this filter
Properties
$empty
Allow empty
protected
bool
$empty
= false
$field
protected
mixed
$field
$is_or
Is or filter
protected
bool
$is_or
= false
$value
protected
mixed
$value
Methods
Field()
Get the filed
public
Field() : mixed
Return values
mixed —IsOr()
Is or connection?
public
IsOr() : bool
When merged with other filter use OR instead of AND
Return values
bool —Is or merge
ToQuery()
To query Convert the search filter instance to search query string
public
abstract ToQuery() : string
Return values
string —The search query
ToSqlQuery()
Create a sql query based on this filter
public
ToSqlQuery() : SqlTerm|array<string|int, SqlTerm>|null