abstract class AbstractSearch

An object which represents the internal state of a generic search: the search query, the user performing the search, the fallback sort order, and a log of which gambits have been used.

Properties

protected Builder $query
protected User $actor
protected array $defaultSort
protected GambitInterface[] $activeGambits

Methods

__construct(Builder $query, User $actor)

No description

Builder
getQuery()

<p>Get the query builder for the search results query.</p>

getActor()

<p>Get the user who is performing the search.</p>

array
getDefaultSort()

<p>Get the default sort order for the search.</p>

mixed
setDefaultSort(mixed $defaultSort)

<p>Set the default sort order for the search. This will only be applied if a sort order has not been specified in the search criteria.</p>

getActiveGambits()

<p>Get a list of the gambits that are active in this search.</p>

void
addActiveGambit(GambitInterface $gambit)

<p>Add a gambit as being active in this search.</p>

Details

__construct(Builder $query, User $actor)

Parameters

Builder $query
User $actor

Builder getQuery()

<p>Get the query builder for the search results query.</p>

Return Value

Builder

User getActor()

<p>Get the user who is performing the search.</p>

Return Value

User

array getDefaultSort()

<p>Get the default sort order for the search.</p>

Return Value

array

mixed setDefaultSort(mixed $defaultSort)

<p>Set the default sort order for the search. This will only be applied if a sort order has not been specified in the search criteria.</p>

Parameters

mixed $defaultSort <p>An array of sort-order pairs, where the column is the key, and the order is the value. The order may be 'asc', 'desc', or an array of IDs to order by.</p>

Return Value

mixed

GambitInterface[] getActiveGambits()

<p>Get a list of the gambits that are active in this search.</p>

Return Value

GambitInterface[]

void addActiveGambit(GambitInterface $gambit)

<p>Add a gambit as being active in this search.</p>

Parameters

GambitInterface $gambit

Return Value

void