Constants

DEFAULT_OPERATOR

DEFAULT_OPERATOR

DEFAULT_FUNC

DEFAULT_FUNC

DEFAULT_OPERAND

DEFAULT_OPERAND

DEFAULT_TABLE_NAME

DEFAULT_TABLE_NAME

Properties

$property

$property : string

Type

string

$val

$val : mixed

Type

mixed

$operator

$operator : string

Type

string

$func

$func : string

Type

string

$operand

$operand : string

Type

string

$tableName

$tableName : string

Type

string

$string

$string : string

Raw SQL clause.

Type

string

$active

$active : boolean

Inactive filter should be skipped completely.

Type

boolean

Methods

setData()

setData(array  $data) : \Charcoal\Source\Filter

Parameters

array $data

The filter data.

Returns

\Charcoal\Source\Filter

Chainable

setProperty()

setProperty(string  $property) : \Charcoal\Source\Filter

Parameters

string $property

The filter property.

Throws

\InvalidArgumentException

If the property argument is not a string.

Returns

\Charcoal\Source\Filter

(Chainable)

property()

property() : string

Returns

string

setVal()

setVal(mixed  $val) : \Charcoal\Source\Filter

Parameters

mixed $val

The filter value.

Returns

\Charcoal\Source\Filter

(Chainable)

val()

val() : mixed

Returns

mixed

parseVal()

parseVal(mixed  $val) : mixed

Parse the given value.

Parameters

mixed $val

The value to be parsed (normalized).

Returns

mixed —

Returns the parsed value.

setOperator()

setOperator(string  $operator) : \Charcoal\Source\Filter

Parameters

string $operator

The filter operator.

Throws

\InvalidArgumentException

If the parameter is not a valid operator.

Returns

\Charcoal\Source\Filter

(Chainable)

operator()

operator() : string

Returns

string

setFunc()

setFunc(string  $func) : \Charcoal\Source\Filter

Parameters

string $func

The filter function.

Throws

\InvalidArgumentException

If the parameter is not a valid function.

Returns

\Charcoal\Source\Filter

(Chainable)

func()

func() : string

Returns

string

setOperand()

setOperand(string  $operand) : \Charcoal\Source\Filter

Parameters

string $operand

The filter operand.

Throws

\InvalidArgumentException

If the parameter is not a valid operand.

Returns

\Charcoal\Source\Filter

(Chainable)

operand()

operand() : string

Returns

string

setTableName()

setTableName(string  $tableName) : \Charcoal\Source\Filter

Parameters

string $tableName

The filter table name.

Throws

\InvalidArgumentException

If the parameter is not a string.

Returns

\Charcoal\Source\Filter

(Chainable)

tableName()

tableName() : string

Returns

string

setString()

setString(string  $sql) : \Charcoal\Source\Filter

Parameters

string $sql

The custom filter SQL string.

Throws

\InvalidArgumentException

If the parameter is not a valid operand.

Returns

\Charcoal\Source\Filter

(Chainable)

string()

string() : string

Returns

string

setActive()

setActive(boolean  $active) : \Charcoal\Source\Filter

Parameters

boolean $active

The active flag.

Returns

\Charcoal\Source\Filter

(Chainable)

active()

active() : boolean

Returns

boolean

sql()

sql() : string

Retrieve the Filter's SQL string to append to a WHERE clause.

Returns

string

validOperators()

validOperators() : array

Supported operators

Returns

array

validOperands()

validOperands() : array

Supported operand types, uppercase

Returns

array

validFunc()

validFunc() : array

Supported functions, uppercase

Returns

array

sqlFields()

sqlFields() : array

Returns

array