class FilterPlugin implements Structable

Traits

Properties

protected Collection $scopes 全局范围 from  UseScopes
protected Collection $items 表单内的表单条目集合

Methods

mixed
scope(string $key, string $label)

添加全局范围, 在添加全局范围之后, 如果不传入 Scope, 则默认为第一个 Scope

Collection
getScopes()

Get all filter scopes.

Collection
getScopesStruct()

范围结构

Scope|null
getCurrentScope()

获取当前的Scope, 支持未传入

__construct()

No description

addItem(FilterItem $item)

添加搜索条件

Collection
items()

获取表单的所有字段

FormItem|$this
__call(string $method, array $arguments = [])

Generate items and append to filter list

struct()

返回结构 规则解析参考 : https://github.com/yiminghe/async-validator

void
action(int $width = 4, bool $export = false)

按钮的宽度(默认 4), 这里不会处理按钮的位置

bool
getEnableExport()

是否启用了导出

array
prepare(string $type = 'params')

根据不同的类型返回不同的查询条件

where(Closure $query, mixed $label, mixed $column)

自定义查询条件

equal(mixed $column, mixed $label)

相等

notEqual(mixed $column, mixed $label)

不等

like(mixed $column, mixed $label)

匹配搜索

startsWith(mixed $column, mixed $label)

前半部分匹配

endsWith(mixed $column, mixed $label)

后半部分匹配

Gt
gt(mixed $column, mixed $label)

大于

Gte
gte(mixed $column, mixed $label)

大于等于

Lt
lt(mixed $column, mixed $label)

小于

Lte
lte(mixed $column, mixed $label)

小于

In
in(mixed $column, mixed $label)

包含

notIn(mixed $column, mixed $label)

不包含

between(mixed $column, mixed $label)

介于...

Details

in UseScopes at line 24
mixed scope(string $key, string $label)

添加全局范围, 在添加全局范围之后, 如果不传入 Scope, 则默认为第一个 Scope

Parameters

string $key
string $label

Return Value

mixed

in UseScopes at line 36
Collection getScopes()

Get all filter scopes.

Return Value

Collection

in UseScopes at line 45
Collection getScopesStruct()

范围结构

Return Value

Collection

in UseScopes at line 57
Scope|null getCurrentScope()

获取当前的Scope, 支持未传入

Return Value

Scope|null

at line 61
__construct()

No description

at line 72
FilterPlugin addItem(FilterItem $item)

添加搜索条件

Parameters

FilterItem $item

Return Value

FilterPlugin

at line 82
Collection items()

获取表单的所有字段

Return Value

Collection

at line 96
FormItem|$this __call(string $method, array $arguments = [])

Generate items and append to filter list

Parameters

string $method 类型
array $arguments 传入的参数

Return Value

FormItem|$this

Exceptions

ApplicationException
ReflectionException

at line 120
struct()

返回结构 规则解析参考 : https://github.com/yiminghe/async-validator

at line 142
void action(int $width = 4, bool $export = false)

按钮的宽度(默认 4), 这里不会处理按钮的位置

Parameters

int $width 宽度
bool $export 是否允许导出

Return Value

void

at line 153
bool getEnableExport()

是否启用了导出

Return Value

bool

at line 164
array prepare(string $type = 'params')

根据不同的类型返回不同的查询条件

Parameters

string $type

Return Value

array

at line 44
Where where(Closure $query, mixed $label, mixed $column)

自定义查询条件

Parameters

Closure $query
mixed $label
mixed $column

Return Value

Where

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

相等

Parameters

mixed $column
mixed $label

Return Value

Equal

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

不等

Parameters

mixed $column
mixed $label

Return Value

NotEqual

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

匹配搜索

Parameters

mixed $column
mixed $label

Return Value

Like

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

前半部分匹配

Parameters

mixed $column
mixed $label

Return Value

StartsWith

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

后半部分匹配

Parameters

mixed $column
mixed $label

Return Value

EndsWith

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

大于

Parameters

mixed $column
mixed $label

Return Value

Gt

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

大于等于

Parameters

mixed $column
mixed $label

Return Value

Gte

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

小于

Parameters

mixed $column
mixed $label

Return Value

Lt

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

小于

Parameters

mixed $column
mixed $label

Return Value

Lte

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

包含

Parameters

mixed $column
mixed $label

Return Value

In

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

不包含

Parameters

mixed $column
mixed $label

Return Value

NotIn

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

介于...

Parameters

mixed $column
mixed $label

Return Value

Between