SearchCriteria
class SearchCriteria implements SearchCriteriaInterface (View source)
Class SearchCriteria
Constants
CONJUNCTION_AND |
|
CONJUNCTION_OR |
|
Properties
protected | SearchCriteriaInterface[] | $clauses | A collection of SearchCriterion and SearchCriteria. |
|
protected | string[] | $conjunctions | The conjunctions used between Criteria (AND/OR). |
|
protected | SearchAdapterInterface|null | $adapter |
Methods
You can pass through a string value, Criteria object, or Criterion object for $target.
Static create method provided so that you can perform method chaining.
No description
No description
No description
Details
__construct(string|SearchCriterion $target, mixed $value = null, string|null $comparison = null, AbstractSearchQueryWriter $searchQueryWriter = null)
You can pass through a string value, Criteria object, or Criterion object for $target.
String value might be "SiteTree_Title" or whatever field in your index that you're trying to target.
If you require complex filtering then you can build your Criteria object first with multiple layers/levels of Criteria, and then pass it in here when you're ready.
If you have your own Criterion object that you've created that you want to use, you can also pass that in here.
static SearchCriteria
create($target, null $value = null, null $comparison = null, AbstractSearchQueryWriter $searchQueryWriter = null)
Static create method provided so that you can perform method chaining.
SearchAdapterInterface
getAdapter()
No description
$this
setAdapter(SearchAdapterInterface $adapter)
No description
void
appendPreparedStatementTo($ps)
No description
$this
addAnd(string|SearchCriteriaInterface $target, mixed $value = null, string|null $comparison = null, AbstractSearchQueryWriter $searchQueryWriter = null)
No description
$this
addOr(string|SearchCriteriaInterface $target, mixed $value = null, string|null $comparison = null, AbstractSearchQueryWriter $searchQueryWriter = null)
No description
protected SearchCriteriaInterface
getCriterionForCondition(string|SearchCriteriaInterface $target, mixed $value, string $comparison, AbstractSearchQueryWriter $searchQueryWriter = null)
No description
protected SearchCriteriaInterface[]
getClauses()
No description
protected
addClause(SearchCriteriaInterface $criterion)
No description
protected string[]
getConjunctions()
No description
protected string|null
getConjunction(int $key)
No description
protected
addConjunction(string $conjunction)
No description