class Filter

筛选器

Properties

static protected array $supports
bool $expand 是否展开
protected $export
protected Model $model 当前的模型
protected array $filters
protected string $action 搜索表单的筛选条件
protected string $view
protected string $filterId
protected string $name
protected Collection $scopes
protected Layout $layout 布局
protected bool $thisFilterLayoutOnly

Set this filter only in the layout.

protected array $layoutOnlyFilterColumns

Columns of filter that are layout-only.

protected mixed $primaryKey

Primary key of giving model.

Methods

__construct(Model $model)

Create a new filter instance.

static 
extend(string $name, string $filterClass)

No description

setAction(string $action)

Set action of search form.

getModel()

Get grid model.

string
getFilterId()

Get filter ID.

$this
setFilterId(string $id)

Set ID of search form.

string
getName()

No description

setName(string $name)

No description

enableExport()

No description

removeFilterByID(mixed $id)

Remove filter by filter id.

array
conditions()

Get all conditions of the filters.

$this
layoutOnly()

Set this filter layout only.

use(FilterItem $filter)

Use a custom filter.

array
filters()

Get all filters.

mixed
scope(string $key, string $label = '')

No description

Collection
getScopes()

Get all filter scopes.

Scope|null
getCurrentScope()

Get current scope.

column(int|float $width, Closure $closure)

Add a new layout column.

array|Collection|mixed
execute(bool $toArray = true)

Execute the filter with conditions.

bool
chunk(callable $callback, int $count = 100)

No description

View|string
render()

Get the string contents of the filter view.

string
urlWithoutFilters()

Get url without filter queryString.

string
urlWithoutScopes()

Get url without scope queryString.

resolveFilter(string $abstract, array $arguments)

No description

FilterItem|$this
__call(string $method, array $arguments)

Generate a filter object and add to grid.

initLayout()

Initialize filter layout.

void
sanitizeInputs($inputs)

No description

addFilter(FilterItem $filter)

Add a filter to grid.

array
scopeConditions()

Get scope conditions.

string
fullUrlWithoutQuery(Arrayable|array|string $keys)

Get full url without query strings.

equal(mixed $column, mixed $label)

No description

notEqual(mixed $column, mixed $label)

No description

like(mixed $column, mixed $label)

No description

startsWith(mixed $column, mixed $label)

No description

endsWith(mixed $column, mixed $label)

No description

Gt
gt(mixed $column, mixed $label)

No description

Gte
gte(mixed $column, mixed $label)

No description

Lt
lt(mixed $column, mixed $label)

No description

Lte
lte(mixed $column, mixed $label)

No description

between(mixed $column, mixed $label)

No description

betweenDate(mixed $column, mixed $label)

No description

In
in(mixed $column, mixed $label)

No description

notIn(mixed $column, mixed $label)

No description

where(mixed $callback, mixed $label, mixed $column)

No description

date(mixed $column, mixed $label)

No description

month(mixed $column, mixed $label)

No description

year(mixed $column, mixed $label)

No description

hidden(mixed $name)

No description

query(mixed $name, mixed $label)

No description

group(mixed $column, mixed $label, mixed $builder)

No description

Details

at line 170
__construct(Model $model)

Create a new filter instance.

Parameters

Model $model

at line 185
static extend(string $name, string $filterClass)

No description

Parameters

string $name
string $filterClass

at line 201
Filter setAction(string $action)

Set action of search form.

Parameters

string $action

Return Value

Filter

at line 213
Model getModel()

Get grid model.

Return Value

Model

at line 228
string getFilterId()

Get filter ID.

Return Value

string

at line 240
$this setFilterId(string $id)

Set ID of search form.

Parameters

string $id

Return Value

$this

at line 250
string getName()

No description

Return Value

string

at line 260
Filter setName(string $name)

No description

Parameters

string $name

Return Value

Filter

at line 267
enableExport()

No description

at line 278
removeFilterByID(mixed $id)

Remove filter by filter id.

Parameters

mixed $id

at line 290
array conditions()

Get all conditions of the filters.

Return Value

array

at line 329
$this layoutOnly()

Set this filter layout only.

Return Value

$this

at line 343
FilterItem use(FilterItem $filter)

Use a custom filter.

Parameters

FilterItem $filter

Return Value

FilterItem

at line 353
array filters()

Get all filters.

Return Value

array

at line 364
mixed scope(string $key, string $label = '')

No description

Parameters

string $key
string $label

Return Value

mixed

at line 376
Collection getScopes()

Get all filter scopes.

Return Value

Collection

at line 386
Scope|null getCurrentScope()

Get current scope.

Return Value

Scope|null

at line 403
Filter column(int|float $width, Closure $closure)

Add a new layout column.

Parameters

int|float $width
Closure $closure

Return Value

Filter

at line 417
array|Collection|mixed execute(bool $toArray = true)

Execute the filter with conditions.

Parameters

bool $toArray

Return Value

array|Collection|mixed

at line 438
bool chunk(callable $callback, int $count = 100)

No description

Parameters

callable $callback
int $count

Return Value

bool

at line 453
View|string render()

Get the string contents of the filter view.

Return Value

View|string

Exceptions

Throwable

at line 471
string urlWithoutFilters()

Get url without filter queryString.

Return Value

string

at line 500
string urlWithoutScopes()

Get url without scope queryString.

Return Value

string

at line 512
FilterItem resolveFilter(string $abstract, array $arguments)

No description

Parameters

string $abstract
array $arguments

Return Value

FilterItem

Exceptions

ApplicationException

at line 529
FilterItem|$this __call(string $method, array $arguments)

Generate a filter object and add to grid.

Parameters

string $method
array $arguments

Return Value

FilterItem|$this

Exceptions

ApplicationException

at line 544
protected initLayout()

Initialize filter layout.

at line 553
protected void sanitizeInputs($inputs)

No description

Parameters

$inputs

Return Value

void

at line 574
protected FilterItem addFilter(FilterItem $filter)

Add a filter to grid.

Parameters

FilterItem $filter

Return Value

FilterItem

at line 593
protected array scopeConditions()

Get scope conditions.

Return Value

array

at line 609
protected string fullUrlWithoutQuery(Arrayable|array|string $keys)

Get full url without query strings.

Parameters

Arrayable|array|string $keys

Return Value

string

at line 62
Equal equal(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Equal

at line 62
NotEqual notEqual(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

NotEqual

at line 62
Like like(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Like

at line 62
StartsWith startsWith(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

StartsWith

at line 62
EndsWith endsWith(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

EndsWith

at line 62
Gt gt(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Gt

at line 62
Gte gte(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Gte

at line 62
Lt lt(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Lt

at line 62
Lte lte(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Lte

at line 62
Between between(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Between

at line 62
BetweenDate betweenDate(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

BetweenDate

at line 62
In in(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

In

at line 62
NotIn notIn(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

NotIn

at line 62
Where where(mixed $callback, mixed $label, mixed $column)

No description

Parameters

mixed $callback
mixed $label
mixed $column

Return Value

Where

at line 62
Date date(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Date

at line 62
Month month(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Month

at line 62
Year year(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Year

at line 62
Hidden hidden(mixed $name)

No description

Parameters

mixed $name

Return Value

Hidden

at line 62
Query query(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Query

at line 62
Group group(mixed $column, mixed $label, mixed $builder)

No description

Parameters

mixed $column
mixed $label
mixed $builder

Return Value

Group