\org_openpsa_core_filter_select

Helper class that encapsulates a single select filter

Summary

Methods
Properties
Constants
apply()
add_head_elements()
render()
set_label()
__construct()
set_callback()
$name
No constants found
_render_actions()
_get_options()
$_selection
$_label
$_options
$_option_callback
$_operator
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : string

The filter's unique name

Type

string

$_selection

$_selection : array

The filter selection, if any

Type

array

$_label

$_label : string

The filter label

Type

string

$_options

$_options : array

The filter's options, if any

Type

array

$_option_callback

$_option_callback : callable

Callabck to load the filter's options

Type

callable

$_operator

$_operator : string

The query operator

Type

string

Methods

apply()

apply(array  $selection, \midcom_core_query  $query) 

Apply filter to given query

Parameters

array $selection

The filter selection

\midcom_core_query $query

The query object

add_head_elements()

add_head_elements() 

render()

render() 

Renders the filter widget according to mode

set_label()

set_label(  $label) 

Parameters

$label

__construct()

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

Constructor

Parameters

string $name

The filter's name

string $operator

The constraint operator

array $options

The filter's options, if any

set_callback()

set_callback(  $callback) 

Parameters

$callback

_render_actions()

_render_actions() 

_get_options()

_get_options() 

Returns an option array for rendering,

May use option_callback config setting to populate the options array