CRUDKit api-doc [Developer]

FilterDefinition
in package

Represents a filter definition on a record (no acutaly filter)

Table of Contents

VALID_OPERATORS  = ['>', '<', '>=', '<=', '=', '!=', 'contains', 'startswith', 'endswith']
VALID_TYPES  = ['const', 'field']
$field  : string
$fieldnameOrValue  : string
$operator  : string
$type  : string
__construct()  : mixed
Constructor.
toFilter()  : Filter
Converts FilterDefinition array plus record data into ready to use array.

Constants

VALID_OPERATORS

public mixed VALID_OPERATORS = ['>', '<', '>=', '<=', '=', '!=', 'contains', 'startswith', 'endswith']

Properties

$fieldnameOrValue

public string $fieldnameOrValue = null

The value, or the reference field name

Methods

__construct()

Constructor.

public __construct(string $field, string $operator, string $type, string $fieldnameOrValue) : mixed
Parameters
$field : string

The field to apply the filter

$operator : string

['>','<','>=','<=','=','!=','contains','startswith','endswith']

$type : string

['const','field']. 'const' = fixed value, 'field' = the fieldname which provides the value.

$fieldnameOrValue : string
Return values
mixed

toFilter()

Converts FilterDefinition array plus record data into ready to use array.

public toFilter([mixed $record = [] ]) : Filter
Parameters
$record : mixed = []
Return values
Filter

Returns ready to use filter.

Search results