\FAA\Obj\SearchFilter

Search filter object

This is the equality filter.

Summary

Methods
Properties
Constants
__construct()
Matches()
ToSqlQuery()
ToQuery()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(string|array  $field,mixed  $value,boolean  $is_or = false,boolean  $empty = false)

Filter constructor.

Create an equality search filter where field name must be the same as input

Parameters

string|array $field

Name of the search field

mixed $value

The search value, can be a scalar but an array as well

boolean $is_or

Merge with other filters with or

boolean $empty

Allow empty value

Matches()

Matches(array|object  $entity): boolean

Parameters

array|object $entity

Returns

boolean

ToSqlQuery()

ToSqlQuery(): \FAA\Obj\Search\SqlTerm|array<mixed,\FAA\Obj\Search\SqlTerm>|null

Create a sql query based on this filter

Returns

\FAA\Obj\Search\SqlTerm|array<mixed,\FAA\Obj\Search\SqlTerm>|null

ToQuery()

ToQuery(): string

Create query

Convert to solr search query like name:test

Returns

string —

The search query