PHP Class Flarum\Core\Search\AbstractSearch

Afficher le fichier Open project: flarum/core Class Usage Examples

Protected Properties

Свойство Type Description
$activeGambits Flarum\Core\Search\GambitInterface[]
$actor Flarum\Core\User
$defaultSort array
$query Illuminate\Database\Query\Builder

Méthodes publiques

Méthode 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 méthode

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

addActiveGambit() public méthode

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

getActiveGambits() public méthode

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

getActor() public méthode

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

getDefaultSort() public méthode

Get the default sort order for the search.
public getDefaultSort ( ) : array
Résultat array

getQuery() public méthode

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

setDefaultSort() public méthode

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.
Résultat mixed

Property Details

$activeGambits protected_oe property

protected GambitInterface[],Flarum\Core\Search $activeGambits
Résultat Flarum\Core\Search\GambitInterface[]

$actor protected_oe property

protected User,Flarum\Core $actor
Résultat Flarum\Core\User

$defaultSort protected_oe property

protected array $defaultSort
Résultat array

$query protected_oe property

protected Builder,Illuminate\Database\Query $query
Résultat Illuminate\Database\Query\Builder