\Alddesign\Crudkit\ClassesFilterDefinition

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

Summary

Methods
Properties
Constants
__construct()
toFilter()
$field
$operator
$type
$fieldnameOrValue
VALID_OPERATORS
VALID_TYPES
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

VALID_OPERATORS

VALID_OPERATORS = array('>', '<', '>=', '<=', '=', '!=', 'contains', 'startswith', 'endswith')

VALID_TYPES

VALID_TYPES = array('const', 'field')

Properties

$field

$field : string

Type

string — The field to filter

$operator

$operator : string

Type

string — The comparison operator

$type

$type : string

Type

string — Type of the filter ('const' or 'field')

$fieldnameOrValue

$fieldnameOrValue : string

Type

string — The value, or the reference field name

Methods

__construct()

__construct(string  $field, string  $operator, string  $type, string  $fieldnameOrValue) 

Constructor.

Parameters

string $field

The field to apply the filter

string $operator

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

string $type

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

string $fieldnameOrValue

toFilter()

toFilter(  $record = array()) : \Alddesign\Crudkit\Classes\Filter

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

Parameters

$record

Returns

\Alddesign\Crudkit\Classes\Filter —

Returns ready to use filter.