Detailed Description

ValueListProvider provides lists of key/values to be used with list input controls.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 23 of file ValueListProvider.php.

Static Public Member Functions

static getList ($definition, $valuePattern=null, $key=null, $language=null)
 
static translateValue ($value, $inputType, $language=null, $itemDelim=", ")
 

Static Protected Member Functions

static getListStrategy ($listType)
 
static getItemValue ($list, $key)
 

Member Function Documentation

◆ getList()

static getList (   $definition,
  $valuePattern = null,
  $key = null,
  $language = null 
)
static

Get a list of key/value pairs defined by the given configuration.

Parameters
$definitionThe list definition as given in the input_type definition in the 'list' parameter (e.g. '{"type":"config","section":"EntityStage"}')
$valuePatternA regular expression pattern that the returned values should match (optional)
$keyA key value, if only one item should be returned (optional)
$languageThe language if the values should be localized (optional, default: Localization::getDefaultLanguage())
Returns
An assoziative array with keys 'items' (array of arrays with keys 'key' and 'value'), 'isStatic' (indicating if the list may change of not)

Definition at line 40 of file ValueListProvider.php.

◆ translateValue()

static translateValue (   $value,
  $inputType,
  $language = null,
  $itemDelim = ", " 
)
static

Translate a value with use of it's assoziated input type e.g.

get the location string from a location id. (this is only done when the input type has a list definition).

Parameters
$valueThe value to translate (might be a comma separated list for list controls)
$inputTypeThe description of the control as given in the 'input_type' property of a value
$languageThe language if the value should be localized. Optional, default is Localization::getDefaultLanguage()
$itemDelimDelimiter string for array values (optional, default: ", ")
Returns
String

Definition at line 84 of file ValueListProvider.php.

◆ getListStrategy()

static getListStrategy (   $listType)
staticprotected

Get the ListStrategy instance for a given list type.

Parameters
$listTypeThe list type
Returns
ListStrategy instance
Exceptions
ConfigurationException

Definition at line 124 of file ValueListProvider.php.

◆ getItemValue()

static getItemValue (   $list,
  $key 
)
staticprotected

Get the value of the item with the given key.

Returns the key, if it does not exist in the list.

Parameters
$listArray of associative arrays with keys 'key' and 'value'
$keyThe key to search
Returns
String

Definition at line 149 of file ValueListProvider.php.