ConfigurationContentDimensionPresetSource
class ConfigurationContentDimensionPresetSource implements ContentDimensionPresetSourceInterface (View source)
A Dimension Preset Source that gets presets from settings
Everything is configured in Settings.yaml in path "Neos.ContentRepository.contentDimensions".
Properties
protected array | $configuration | Dimension presets configuration indexed by dimension name, see ContentDimensionPresetSourceInterface |
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.
Checks if the given preset of the specified dimension is allowed according to the given constraints
No description
Finds for each configured dimension the best matching preset based on given target value for that dimension.
Compares the given $possibleBetterPreset to the $targetValues (based on the position of the contained values) and returns either $possibleBetterPreset or the $currentBestPreset, depending on the result.
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.
protected bool
isPresetAllowedByConstraints(string $dimensionName, string $presetIdentifier, array $constraints)
Checks if the given preset of the specified dimension is allowed according to the given constraints
void
setConfiguration(array $configuration)
No description
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.
protected array
comparePresetsForTargetValue(array $possibleBetterPreset, array $targetValues, array $currentBestPreset = null)
Compares the given $possibleBetterPreset to the $targetValues (based on the position of the contained values) and returns either $possibleBetterPreset or the $currentBestPreset, depending on the result.