trait Searchable (View source)

Traits

Searchable

Properties

protected array $additionalSearchFields

Define the additional fields we want to index.

protected array $additionalFilterableFields

Define the additional filterable fields.

protected array $additionalSortableFields

Define the additional sortable fields.

Methods

array
getSearchableAttributes()

Return our base (core) attributes we want searchable.

array
getFilterableAttributes()

Return our base attributes we want filterable.

void
addFilterableAttributes(array $attributes)

Add additional fields to filter on.

void
addSortableAttributes(array $attributes)

Add additional sortable attributes.

array
getSortableAttributes()

Return our base attributes we want sortable.

getObservableEvents()

{@inheritDoc}

void
addSearchableAttribute(string $key, string|mixed $value)

Add an attribute into the additional searchable fields.

toSearchableArray()

{@inheritDoc}

searchableUsing()

{@inheritDoc}

Details

array getSearchableAttributes()

Return our base (core) attributes we want searchable.

Return Value

array

array getFilterableAttributes()

Return our base attributes we want filterable.

Return Value

array

void addFilterableAttributes(array $attributes)

Add additional fields to filter on.

Parameters

array $attributes

Return Value

void

void addSortableAttributes(array $attributes)

Add additional sortable attributes.

Parameters

array $attributes

Return Value

void

array getSortableAttributes()

Return our base attributes we want sortable.

Return Value

array

getObservableEvents()

{@inheritDoc}

void addSearchableAttribute(string $key, string|mixed $value)

Add an attribute into the additional searchable fields.

Parameters

string $key
string|mixed $value

Return Value

void

toSearchableArray()

{@inheritDoc}

searchableUsing()

{@inheritDoc}