PHP Class Flarum\Core\Search\AbstractSearch

Datei anzeigen Open project: flarum/core Class Usage Examples

Protected Properties

Property Type Description
$activeGambits Flarum\Core\Search\GambitInterface[]
$actor Flarum\Core\User
$defaultSort array
$query Illuminate\Database\Query\Builder

Public Methods

Method Description
__construct ( Builder $query, User $actor )
addActiveGambit ( Flarum\Core\Search\GambitInterface $gambit ) : void Add a gambit as being active in this search.
getActiveGambits ( ) : Flarum\Core\Search\GambitInterface[] Get a list of the gambits that are active in this search.
getActor ( ) : User Get the user who is performing the search.
getDefaultSort ( ) : array Get the default sort order for the search.
getQuery ( ) : Builder Get the query builder for the search results query.
setDefaultSort ( array $defaultSort ) : mixed 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.

Method Details

__construct() public method

public __construct ( Builder $query, User $actor )
$query Illuminate\Database\Query\Builder
$actor Flarum\Core\User

addActiveGambit() public method

Add a gambit as being active in this search.
public addActiveGambit ( Flarum\Core\Search\GambitInterface $gambit ) : void
$gambit Flarum\Core\Search\GambitInterface
return void

getActiveGambits() public method

Get a list of the gambits that are active in this search.
public getActiveGambits ( ) : Flarum\Core\Search\GambitInterface[]
return Flarum\Core\Search\GambitInterface[]

getActor() public method

Get the user who is performing the search.
public getActor ( ) : User
return Flarum\Core\User

getDefaultSort() public method

Get the default sort order for the search.
public getDefaultSort ( ) : array
return array

getQuery() public method

Get the query builder for the search results query.
public getQuery ( ) : Builder
return Illuminate\Database\Query\Builder

setDefaultSort() public method

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.
public setDefaultSort ( array $defaultSort ) : mixed
$defaultSort array 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 mixed

Property Details

$activeGambits protected_oe property

protected GambitInterface[],Flarum\Core\Search $activeGambits
return Flarum\Core\Search\GambitInterface[]

$actor protected_oe property

protected User,Flarum\Core $actor
return Flarum\Core\User

$defaultSort protected_oe property

protected array $defaultSort
return array

$query protected_oe property

protected Builder,Illuminate\Database\Query $query
return Illuminate\Database\Query\Builder