class Filterer

Main filterer class

Properties

protected string $searchQuery Search query
protected array $sortables Sortables
protected array $sortableColumns Sortable columns
protected array $searchableColumns Searchable columns
protected array $groups Filter groups
protected array $idColumns ID columns
protected array $filterColumnCallbacks Filter column callbacks
protected array $requiredColumns Required filter columns
protected string $queryKey Key for searching
protected string $sortKey Key for sortables
protected string $ignorePrefix Ignore keys prefixed with _
protected array $ignoreKeys Ignore "include" and "page" keys
protected string $baseClassname Base classname

Methods

array
parseSortable(string $string)

Parse sortable strings

string
getSearchQuery()

Get search query

array
getSortables()

Get sortables

array
getGroups()

Get filter groups

void
setSearchableColumns(array $columns)

Set searchable columns

void
setSortableColumns(array $columns)

Set sortable columns

void
addSortable(string $column, int $direction)

Add sortable column

void
addFilterColumn(string $column, callable $callback)

Add filter column with a callback

void
addIdColumn(string|array $column)

Add ID column

void
parseRequest(Request $request = null)

Parse HTTP request

getSearchGroup()

Get search filter group

void
checkForRequiredColumns(array $columns)

Check for required columns in filter

void
requireColumn(string $column)

Require specific column in filter

void
setBaseClassname(string $classname)

Set base classname to use against id-filters

Details

at line 115
protected array parseSortable(string $string)

Parse sortable strings

Parameters

string $string

Return Value

array

at line 131
string getSearchQuery()

Get search query

Return Value

string

at line 141
array getSortables()

Get sortables

Return Value

array

at line 151
array getGroups()

Get filter groups

Return Value

array

at line 162
void setSearchableColumns(array $columns)

Set searchable columns

Parameters

array $columns

Return Value

void

at line 173
void setSortableColumns(array $columns)

Set sortable columns

Parameters

array $columns

Return Value

void

at line 185
void addSortable(string $column, int $direction)

Add sortable column

Parameters

string $column
int $direction

Return Value

void

at line 201
void addFilterColumn(string $column, callable $callback)

Add filter column with a callback

Parameters

string $column
callable $callback

Return Value

void

at line 212
void addIdColumn(string|array $column)

Add ID column

Parameters

string|array $column

Return Value

void

at line 231
void parseRequest(Request $request = null)

Parse HTTP request

Parameters

Request $request

Return Value

void

at line 279
protected OrGroup getSearchGroup()

Get search filter group

Return Value

OrGroup

at line 297
protected void checkForRequiredColumns(array $columns)

Check for required columns in filter

Parameters

array $columns

Return Value

void

at line 312
void requireColumn(string $column)

Require specific column in filter

Parameters

string $column

Return Value

void

at line 323
void setBaseClassname(string $classname)

Set base classname to use against id-filters

Parameters

string $classname

Return Value

void