Backend\Widgets\Lists\HasSearch
Overview
HasSearch concern
Protected Properties
protected string $searchTerm
Filter the records by a search term.
protected string $searchMode
If searching the records, specifies a policy to use.
- all: result must contain all words
- any: result can contain any word
- exact: result must contain the exact phrase
protected string $searchScope
Use a custom scope method for performing searches.
Public Methods
public getSearchTerm()
public getSearchTerm(): string|null
getSearchTerm returns the active search term.
public getSearchableColumns()
public getSearchableColumns(): array
getSearchableColumns returns a collection of columns which can be searched.
public setSearchOptions()
public setSearchOptions(array $options = []): void
setSearchOptions applies a search options to the list search.
public setSearchTerm()
public setSearchTerm(string $term, boolean $resetState = false): void
setSearchTerm applies a search term to the list results.
Protected Methods
protected applySearchToQuery()
protected applySearchToQuery($query, $columns, $boolean = 'and'): void
applySearchToQuery applies the search constraint to a query.