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 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.

protected getSearchableColumns()

protected getSearchableColumns(): array 

getSearchableColumns returns a collection of columns which can be searched.