RefineBar
in package
Provides the search refinement options in the admin UI
Table of Contents
Properties
- $curr_group : string
- $field_ops : array<string, string|null>
- $groups : array<string, array<string|int, RefineWidget>>
- $widgets : array<string|int, RefineWidget>
Methods
- addWidget() : void
- Add a refine widget
- get() : string
- Gets the bar
- getGroups() : array<string, array<string|int, RefineWidget>>
- Return a list of search widgets, in groups
- getOperator() : string|null
- Return the operator to use in WHERE clauses, for a given field
- hasField() : bool
- Returns true if any of the refine bar widgets refer to the specified field
- render() : void
- Renders the bar
- setGroup() : void
- Set the current group
Properties
$curr_group
private
string
$curr_group
= 'General'
$field_ops
private
array<string, string|null>
$field_ops
= []
$groups
private
array<string, array<string|int, RefineWidget>>
$groups
= array()
$widgets
private
array<string|int, RefineWidget>
$widgets
= array()
Methods
addWidget()
Add a refine widget
public
addWidget(RefineWidget $widget[, string $operator = null ]) : void
Parameters
- $widget : RefineWidget
-
Refinement widget to add
- $operator : string = null
-
Operator for WHERE clause, e.g. '=' or 'CONTAINS' The available values are the operators for Pdb::buildClause The value null indicates "auto-guess", which is CONTAINS for strings and = for integers
get()
Gets the bar
public
get() : string
Return values
string —HTML
getGroups()
Return a list of search widgets, in groups
public
getGroups() : array<string, array<string|int, RefineWidget>>
Return values
array<string, array<string|int, RefineWidget>>getOperator()
Return the operator to use in WHERE clauses, for a given field
public
getOperator(string $field_name) : string|null
Parameters
- $field_name : string
-
Field, e.g. 'first_name'
Return values
string|null —Operator e.g. 'CONTAINS' or null to auto-detect
hasField()
Returns true if any of the refine bar widgets refer to the specified field
public
hasField(string $field_name) : bool
Parameters
- $field_name : string
-
Field name, e.g. 'first_name'
Return values
bool —True if the field is referenced by a widget
render()
Renders the bar
public
render() : void
Return values
void —echoes HTML
setGroup()
Set the current group
public
setGroup(string $name) : void
Parameters
- $name : string
-
Group name, e.g. 'General'