class Field

Filter field

Properties

protected string $key Filter key
protected string $value Filter value
protected Closure $callback Possible query callback
protected string $baseClassname Base classname
protected array $types Available comparison types and their query counterparts
protected string $wildcard Query wildcard character

Methods

__construct(string $key, string $value, Closure|null $callback = null)

Create a new field instance

void
getKey()

Get field key

string
getType()

Get field comparison type based on field value

boolean
isIdKey()

Is filter key an id key

integer
getModelId(string $id)

Resolve model id from key

string|null|array
getValue()

Get field value

Builder
apply(Builder $query)

Apply filter to query

void
setBaseClassname(string $classname)

Set base classname to use against id-filters

Details

at line 76
__construct(string $key, string $value, Closure|null $callback = null)

Create a new field instance

Parameters

string $key
string $value
Closure|null $callback

at line 88
protected void getKey()

Get field key

Return Value

void

at line 98
protected string getType()

Get field comparison type based on field value

Return Value

string

at line 113
protected boolean isIdKey()

Is filter key an id key

Return Value

boolean

at line 124
protected integer getModelId(string $id)

Resolve model id from key

Parameters

string $id

Return Value

integer

at line 152
protected string|null|array getValue()

Get field value

Return Value

string|null|array

at line 197
Builder apply(Builder $query)

Apply filter to query

Parameters

Builder $query

Return Value

Builder

at line 232
void setBaseClassname(string $classname)

Set base classname to use against id-filters

Parameters

string $classname

Return Value

void