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.
Afficher le fichier Open project: neos/neos-development-collection Interface Usage Examples

Méthodes publiques

Méthode 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 méthode

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

findPresetsByTargetValues() public méthode

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

getAllPresets() public méthode

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
Résultat array Presets configuration, indexed by dimension identifier

getAllowedDimensionPresetsAccordingToPreselection() public méthode

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
Résultat array An array of presets only for the dimension specified in $dimensionName. Structure is: array($dimensionName => array('presets' => array(...))

getDefaultPreset() public méthode

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

isPresetCombinationAllowedByConstraints() public méthode

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')
Résultat boolean