class Filter extends FilterButton

筛选器

Properties

protected Grid $grid from  AbstractTool
protected bool $disabled from  AbstractTool
protected string $view
bool $expand 是否展开
protected Model $model 当前的模型
protected array $filters
protected string $action 搜索表单的筛选条件
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.

static protected array $supports

Methods

$this
disable(bool $disable = true)

Toggle this button.

allowed()

If the tool is allowed.

$this
setGrid(Grid $grid)

Set parent grid.

getGrid()

No description

render()

Get the string contents of the filter view.

string
__toString()

No description

filter()

No description

__construct(Model $model)

Create a new filter instance.

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

$this
setName($name)

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(AbstractFilter $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

array
renderSkeleton()

No description

string
urlWithoutFilters()

Get url without filter queryString.

string
urlWithoutScopes()

Get url without scope queryString.

resolveFilter(string $abstract, array $arguments)

No description

__call(string $method, array $arguments)

Generate a filter object and add to grid.

static 
extend(string $name, string $filterClass)

No description

initLayout()

Initialize filter layout.

array
sanitizeInputs($inputs)

No description

addFilter(AbstractFilter $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

leftLike(mixed $column, mixed $label)

No description

like(mixed $column, mixed $label)

No description

contains(mixed $column, mixed $label)

No description

startsWith(mixed $column, mixed $label)

No description

endsWith(mixed $column, mixed $label)

No description

ilike(mixed $column, mixed $label)

No description

gt(mixed $column, mixed $label)

No description

lt(mixed $column, mixed $label)

No description

between(mixed $column, mixed $label)

No description

betweenDate(mixed $column, mixed $label)

No description

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

day(mixed $column, mixed $label)

No description

month(mixed $column, mixed $label)

No description

year(mixed $column, mixed $label)

No description

hidden(mixed $name, mixed $value)

No description

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

No description

Details

in AbstractTool at line 27
$this disable(bool $disable = true)

Toggle this button.

Parameters

bool $disable

Return Value

$this

in AbstractTool at line 37
allowed()

If the tool is allowed.

in AbstractTool at line 49
$this setGrid(Grid $grid)

Set parent grid.

Parameters

Grid $grid

Return Value

$this

in AbstractTool at line 59
Grid getGrid()

No description

Return Value

Grid

at line 414
render()

Get the string contents of the filter view.

Exceptions

Throwable

in AbstractTool at line 72
string __toString()

No description

Return Value

string

in FilterButton at line 35
protected Filter filter()

No description

Return Value

Filter

at line 148
__construct(Model $model)

Create a new filter instance.

Parameters

Model $model

at line 166
Filter setAction(string $action)

Set action of search form.

Parameters

string $action

Return Value

Filter

at line 178
Model getModel()

Get grid model.

Return Value

Model

at line 193
string getFilterId()

Get filter ID.

Return Value

string

at line 205
$this setFilterId(string $id)

Set ID of search form.

Parameters

string $id

Return Value

$this

at line 215
string getName()

No description

Return Value

string

at line 225
$this setName($name)

No description

Parameters

$name

Return Value

$this

at line 239
removeFilterByID(mixed $id)

Remove filter by filter id.

Parameters

mixed $id

at line 251
array conditions()

Get all conditions of the filters.

Return Value

array

at line 290
$this layoutOnly()

Set this filter layout only.

Return Value

$this

at line 304
AbstractFilter use(AbstractFilter $filter)

Use a custom filter.

Parameters

AbstractFilter $filter

Return Value

AbstractFilter

at line 314
array filters()

Get all filters.

Return Value

array

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

No description

Parameters

string $key
string $label

Return Value

mixed

at line 337
Collection getScopes()

Get all filter scopes.

Return Value

Collection

at line 347
Scope|null getCurrentScope()

Get current scope.

Return Value

Scope|null

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

Add a new layout column.

Parameters

int|float $width
Closure $closure

Return Value

Filter

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

Execute the filter with conditions.

Parameters

bool $toArray

Return Value

array|Collection|mixed

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

No description

Parameters

callable $callback
int $count

Return Value

bool

at line 427
array renderSkeleton()

No description

Return Value

array

at line 449
string urlWithoutFilters()

Get url without filter queryString.

Return Value

string

at line 478
string urlWithoutScopes()

Get url without scope queryString.

Return Value

string

at line 490
AbstractFilter resolveFilter(string $abstract, array $arguments)

No description

Parameters

string $abstract
array $arguments

Return Value

AbstractFilter

Exceptions

ApplicationException

at line 507
AbstractFilter|$this __call(string $method, array $arguments)

Generate a filter object and add to grid.

Parameters

string $method
array $arguments

Return Value

AbstractFilter|$this

Exceptions

ApplicationException

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

No description

Parameters

string $name
string $filterClass

at line 532
protected initLayout()

Initialize filter layout.

at line 542
protected array sanitizeInputs($inputs)

No description

Parameters

$inputs

Return Value

array

at line 563
protected AbstractFilter addFilter(AbstractFilter $filter)

Add a filter to grid.

Parameters

AbstractFilter $filter

Return Value

AbstractFilter

at line 582
protected array scopeConditions()

Get scope conditions.

Return Value

array

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

Get full url without query strings.

Parameters

Arrayable|array|string $keys

Return Value

string

at line 46
AbstractFilter equal(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter notEqual(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter leftLike(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter like(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter contains(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter startsWith(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter endsWith(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter ilike(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter gt(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter lt(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

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

No description

Parameters

mixed $column
mixed $label

Return Value

Between

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

No description

Parameters

mixed $column
mixed $label

Return Value

BetweenDate

at line 46
AbstractFilter in(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter notIn(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter where(mixed $callback, mixed $label, mixed $column)

No description

Parameters

mixed $callback
mixed $label
mixed $column

Return Value

AbstractFilter

at line 46
AbstractFilter date(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter day(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter month(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter year(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

AbstractFilter

at line 46
AbstractFilter hidden(mixed $name, mixed $value)

No description

Parameters

mixed $name
mixed $value

Return Value

AbstractFilter

at line 46
AbstractFilter group(mixed $column, mixed $label, mixed $builder)

No description

Parameters

mixed $column
mixed $label
mixed $builder

Return Value

AbstractFilter