ContentDimensionPresetSourceInterface
interface ContentDimensionPresetSourceInterface implements ContentDimensionPresetSourceInterface (View source)
An interface for a Content Dimension Preset source
It allows to resolve a Content Dimension Preset for a given dimension and urlSegment or find a matching preset for a list of dimension values.
Content Dimension Preset
A Content Dimension Preset assigns an identifier to a list of dimension values. It has UI properties for a label and icon and further options for routing.
The default implementation ConfigurationContentDimensionPresetSource will read the available presets from settings.
Methods
Get the full presets configuration as an array
Get the default preset of a dimension
Find a dimension preset by dimension values
Returns a list of presets of the specified dimension which are allowed in combination with the given presets of other dimensions.
Checks if the given combination of presets is allowed, according to possibly defined constraints in the content dimension configuration.
Finds for each configured dimension the best matching preset based on given target value for that dimension.
Find a dimension preset by URI identifier
Details
array
getAllPresets()
Get the full presets configuration as an array
Example:
'language': defaultPreset: 'all' label: 'Language' icon: 'icon-language' presets: 'all': label: 'All languages' values: ['mul_ZZ'] uriSegment: 'intl' 'de_DE': label: 'Deutsch (Deutschland)' values: ['de_DE', 'de_ZZ', 'mul_ZZ'] uriSegment: 'deutsch'
array
getDefaultPreset(string $dimensionName)
Get the default preset of a dimension
array
findPresetByDimensionValues(string $dimensionName, array $dimensionValues)
Find a dimension preset by dimension values
array
getAllowedDimensionPresetsAccordingToPreselection(string $dimensionName, array $preselectedDimensionPresets)
Returns a list of presets of the specified dimension which are allowed in combination with the given presets of other dimensions.
bool
isPresetCombinationAllowedByConstraints(array $dimensionsNamesAndPresetIdentifiers)
Checks if the given combination of presets is allowed, according to possibly defined constraints in the content dimension configuration.
array
findPresetsByTargetValues(array $targetValues)
Finds for each configured dimension the best matching preset based on given target value for that dimension.
The $targetValues array should have the dimension as key and the target value (single value) as value.
array
findPresetByUriSegment(string $dimensionName, string $uriSegment)
Find a dimension preset by URI identifier