ValueListProvider Class Reference
Detailed Description
ValueListProvider provides lists of key/values to be used with list input controls.
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 |
Get a list of key/value pairs defined by the given configuration.
- Parameters
-
$definition The list definition as given in the input_type definition in the 'list' parameter (e.g. '{"type":"config","section":"EntityStage"}') $valuePattern A regular expression pattern that the returned values should match (optional) $key A key value, if only one item should be returned (optional) $language The 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 |
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
-
$value The value to translate (might be a comma separated list for list controls) $inputType The description of the control as given in the 'input_type' property of a value $language The language if the value should be localized. Optional, default is Localization::getDefaultLanguage() $itemDelim Delimiter string for array values (optional, default: ", ")
- Returns
- String
Definition at line 84 of file ValueListProvider.php.
◆ getListStrategy()
|
staticprotected |
Get the ListStrategy instance for a given list type.
- Parameters
-
$listType The list type
- Returns
- ListStrategy instance
- Exceptions
-
ConfigurationException
Definition at line 124 of file ValueListProvider.php.
◆ getItemValue()
|
staticprotected |
Get the value of the item with the given key.
Returns the key, if it does not exist in the list.
- Parameters
-
$list Array of associative arrays with keys 'key' and 'value' $key The key to search
- Returns
- String
Definition at line 149 of file ValueListProvider.php.