class DiscussionSearcher

Takes a DiscussionSearchCriteria object, performs a search using gambits, and spits out a DiscussionSearchResults object.

Traits

Properties

protected GambitManager $gambits
protected DiscussionRepository $discussions
protected PostRepository $posts

Methods

applySort(AbstractSearch $search, array $sort = null)

<p>Apply sort criteria to a discussion search.</p>

applyOffset(AbstractSearch $search, int $offset)

No description

applyLimit(AbstractSearch $search, int|null $limit)

No description

__construct(GambitManager $gambits, DiscussionRepository $discussions, PostRepository $posts)

No description

search(SearchCriteria $criteria, int|null $limit = null, int $offset = 0, array $load = [])

No description

loadRelevantPosts(Collection $discussions, DiscussionSearch $search)

<p>Load relevant posts onto each discussion using information from the search.</p>

Details

protected applySort(AbstractSearch $search, array $sort = null)

<p>Apply sort criteria to a discussion search.</p>

Parameters

AbstractSearch $search
array $sort

protected applyOffset(AbstractSearch $search, int $offset)

Parameters

AbstractSearch $search
int $offset

protected applyLimit(AbstractSearch $search, int|null $limit)

Parameters

AbstractSearch $search
int|null $limit

__construct(GambitManager $gambits, DiscussionRepository $discussions, PostRepository $posts)

Parameters

GambitManager $gambits
DiscussionRepository $discussions
PostRepository $posts

Parameters

SearchCriteria $criteria
int|null $limit
int $offset
array $load <p>An array of relationships to load on the results.</p>

Return Value

SearchResults

protected loadRelevantPosts(Collection $discussions, DiscussionSearch $search)

<p>Load relevant posts onto each discussion using information from the search.</p>

Parameters

Collection $discussions
DiscussionSearch $search