PHP Интерфейс 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.
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

findPresetByDimensionValues() публичный Метод

Find a dimension preset by dimension values
public findPresetByDimensionValues ( string $dimensionName, array $dimensionValues ) : array
$dimensionName string
$dimensionValues array
Результат array The preset configuration, including the identifier as key "identifier" or NULL if none was found

findPresetsByTargetValues() публичный Метод

The $targetValues array should have the dimension as key and the target value (single value) as value.
public findPresetsByTargetValues ( array $targetValues ) : array
$targetValues array
Результат array

getAllPresets() публичный Метод

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
Результат array Presets configuration, indexed by dimension identifier

getAllowedDimensionPresetsAccordingToPreselection() публичный Метод

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
Результат array An array of presets only for the dimension specified in $dimensionName. Structure is: array($dimensionName => array('presets' => array(...))

getDefaultPreset() публичный Метод

Get the default preset of a dimension
public getDefaultPreset ( string $dimensionName ) : array
$dimensionName string The dimension name where the default preset should be returned
Результат array The preset configuration, including the identifier as key "identifier"

isPresetCombinationAllowedByConstraints() публичный Метод

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')
Результат boolean