PHP Interface Neos\ContentRepository\Domain\Service\ContentDimensionPresetSourceInterface

It allows to find a matching preset for a list of dimension values. Or calculate all dimension combinations for you (the matrix of all configured presets). Content Dimension Preset ======================== A Content Dimension Preset assigns an identifier to a (fallback) list of dimension values. It can have additional properties like UI label and icon and further options for routing if needed. The default implementation ConfigurationContentDimensionPresetSource will read the available presets from settings.
Exibir arquivo Open project: neos/neos-development-collection Interface Usage Examples

Public Methods

Method Description
findPresetByDimensionValues ( string $dimensionName, array $dimensionValues ) : array Find a dimension preset by dimension values
findPresetsByTargetValues ( array $targetValues ) : array Finds for each configured dimension the best matching preset based on given target value for that dimension.
getAllPresets ( ) : array Get the full presets configuration as an array
getAllowedDimensionPresetsAccordingToPreselection ( string $dimensionName, array $preselectedDimensionPresets ) : array Returns a list of presets of the specified dimension which are allowed in combination with the given presets of other dimensions.
getDefaultPreset ( string $dimensionName ) : array Get the default preset of a dimension
isPresetCombinationAllowedByConstraints ( array $dimensionsNamesAndPresetIdentifiers ) : boolean Checks if the given combination of presets is allowed, according to possibly defined constraints in the content dimension configuration.

Method Details

findPresetByDimensionValues() public method

Find a dimension preset by dimension values
public findPresetByDimensionValues ( string $dimensionName, array $dimensionValues ) : array
$dimensionName string
$dimensionValues array
return array The preset configuration, including the identifier as key "identifier" or NULL if none was found

findPresetsByTargetValues() public method

The $targetValues array should have the dimension as key and the target value (single value) as value.
public findPresetsByTargetValues ( array $targetValues ) : array
$targetValues array
return array

getAllPresets() public method

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'
public getAllPresets ( ) : array
return array Presets configuration, indexed by dimension identifier

getAllowedDimensionPresetsAccordingToPreselection() public method

Returns a list of presets of the specified dimension which are allowed in combination with the given presets of other dimensions.
public getAllowedDimensionPresetsAccordingToPreselection ( string $dimensionName, array $preselectedDimensionPresets ) : array
$dimensionName string Name of the dimension to return presets for
$preselectedDimensionPresets array An array of dimension name and preset identifier specifying the presets which are already selected
return array An array of presets only for the dimension specified in $dimensionName. Structure is: array($dimensionName => array('presets' => array(...))

getDefaultPreset() public method

Get the default preset of a dimension
public getDefaultPreset ( string $dimensionName ) : array
$dimensionName string The dimension name where the default preset should be returned
return array The preset configuration, including the identifier as key "identifier"

isPresetCombinationAllowedByConstraints() public method

Checks if the given combination of presets is allowed, according to possibly defined constraints in the content dimension configuration.
public isPresetCombinationAllowedByConstraints ( array $dimensionsNamesAndPresetIdentifiers ) : boolean
$dimensionsNamesAndPresetIdentifiers array Preset pairs, for example array('language' => 'de', 'country' => 'GER', 'persona' => 'clueless')
return boolean