Menu

## FilterDefinition
in package

FilterDefinition.php : 10

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

FilterDefinition.php : 21
`public mixed VALID_OPERATORS = ['>', '<', '>=', '<=', '=', '!=', 'contains', 'startswith', 'endswith']`

#### VALID_TYPES

FilterDefinition.php : 22
`public mixed VALID_TYPES = ['const', 'field']`

### Properties

#### $field

FilterDefinition.php : 13
`public string $field = ''`

The field to filter

#### $fieldnameOrValue

FilterDefinition.php : 19
`public string $fieldnameOrValue = null`

The value, or the reference field name

#### $operator

FilterDefinition.php : 15
`public string $operator = ''`

The comparison operator

#### $type

FilterDefinition.php : 17
`public string $type = ''`

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

### Methods

#### __construct()

FilterDefinition.php : 31

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()

FilterDefinition.php : 54

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