class DiscussionSearch extends AbstractSearch

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

Properties

protected Builder $query from AbstractSearch
protected User $actor from AbstractSearch
protected $defaultSort {@inheritdoc}
protected GambitInterface[] $activeGambits from AbstractSearch
protected array $relevantPostIds

Methods

__construct(Builder $query, User $actor)

No description

Builder
getQuery()

Get the query builder for the search results query.

User
getActor()

Get the user who is performing the search.

array
getDefaultSort()

Get the default sort order for the search.

mixed
setDefaultSort(mixed $defaultSort)

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.

GambitInterface[]
getActiveGambits()

Get a list of the gambits that are active in this search.

void
addActiveGambit(GambitInterface $gambit)

Add a gambit as being active in this search.

int[]
getRelevantPostIds()

Get the related IDs for each result.

void
setRelevantPostIds(array $relevantPostIds)

Set the relevant post IDs for the results.

Details

__construct(Builder $query, User $actor)

Parameters

Builder $query
User $actor

Builder getQuery()

Get the query builder for the search results query.

Return Value

Builder

User getActor()

Get the user who is performing the search.

Return Value

User

array getDefaultSort()

Get the default sort order for the search.

Return Value

array

mixed setDefaultSort(mixed $defaultSort)

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.

Parameters

mixed $defaultSort 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.

Return Value

mixed

GambitInterface[] getActiveGambits()

Get a list of the gambits that are active in this search.

Return Value

GambitInterface[]

void addActiveGambit(GambitInterface $gambit)

Add a gambit as being active in this search.

Parameters

GambitInterface $gambit

Return Value

void

int[] getRelevantPostIds()

Get the related IDs for each result.

Return Value

int[]

void setRelevantPostIds(array $relevantPostIds)

Set the relevant post IDs for the results.

Parameters

array $relevantPostIds

Return Value

void