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, $language=null)
 
static translateValue ($value, $inputType, $language=null)
 

Static Protected Member Functions

static getListStrategy ($listType)
 
static getItemValue ($list, $key, $strict=true)
 

Member Function Documentation

static getList (   $definition,
  $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"}')
$languageThe language if the values should be localized. Optional, default is 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 39 of file ValueListProvider.php.

static translateValue (   $value,
  $inputType,
  $language = null 
)
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()
Returns
String

Definition at line 82 of file ValueListProvider.php.

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 120 of file ValueListProvider.php.

static getItemValue (   $list,
  $key,
  $strict = true 
)
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
$strictBoolean whether to check the key type as well (optional, default: true)
Returns
String

Definition at line 146 of file ValueListProvider.php.