You are here

public function SearchApiQueryFilterInterface::condition in Search API 7

Adds a new ($field $operator $value) condition.

Parameters

string $field: The field to filter on, e.g. 'title'.

mixed $value: The value the field should have (or be related to by the operator).

string $operator: The operator to use for checking the constraint. The following operators are supported for primitive types: "=", "<>", "<", "<=", ">=", ">". They have the same semantics as the corresponding SQL operators. If $field is a fulltext field, $operator can only be "=" or "<>", which are in this case interpreted as "contains" or "doesn't contain", respectively. If $value is NULL, $operator also can only be "=" or "<>", meaning the field must have no or some value, respectively.

Return value

SearchApiQueryFilterInterface The called object.

1 method overrides SearchApiQueryFilterInterface::condition()
SearchApiQueryFilter::condition in includes/query.inc
Adds a new ($field $operator $value) condition.

File

includes/query.inc, line 951
Contains SearchApiQueryInterface and SearchApiQuery.

Class

SearchApiQueryFilterInterface
Represents a filter on a search query.

Code

public function condition($field, $value, $operator = '=');