Helper class that encapsulates a single query filter

package org.openpsa.core

 Methods

__construct (string $name, string $operator, array $options)

Constructor

Parameters

$name

stringThe filter's name

$operator

stringThe constraint operator

$options

arrayThe filter's options, if any

add_head_elements ()

apply (array $selection, \midcom_core_query $query)

Apply filter to given query

Parameters

$selection

arrayThe filter selection

$query

\midcom_core_queryThe query object

get_config (string $key)

Get filter configuration setting

Parameters

$key

stringThe config key to get

Returns

mixedThe current config value or null

render (string $url)

Renders the filter widget according to mode

Parameters

$url

stringThe backend URL to send the data to

set (string $key, mixed $value)

Modify filter configuration

Parameters

$key

stringThe config key to set

$value

mixedThe config value

_apply_timeframe_constraints ($query)

Parameters

$query

_get_options ()

Returns an option array for rendering,

May use option_callback config setting to populate the options array

_render_actions ()

_render_multiselect (array $options)

Renderer for 'multiselect' mode

Parameters

$options

arrayThe options to render

_render_singleselect (array $options)

Renderer for 'singleselect' mode

Parameters

$options

arrayThe options to render

_render_timeframe ()

Renderer for 'datepicker' mode

 Properties

 

string $name

The filter's unique name
 

array $_config

The filter's configuration.

Currently supported keys are 'mode', 'fieldname', 'operator', 'helptext' and 'option_callback'

 

array $_options

The filter's options, if any
 

array $_selection

The filter selection, if any