PHP Class Neos\ContentRepository\Domain\Service\ConfigurationContentDimensionPresetSource

Everything is configured in Settings.yaml in path "Neos.ContentRepository.contentDimensions".
Inheritance: implements Neos\ContentRepository\Domain\Service\ContentDimensionPresetSourceInterface
ファイルを表示 Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$configuration array Dimension presets configuration indexed by dimension name, see ContentDimensionPresetSourceInterface

Public Methods

Method Description
findPresetByDimensionValues ( $dimensionName, array $dimensionValues )
findPresetsByTargetValues ( array $targetValues )
getAllPresets ( )
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 ( $dimensionName )
isPresetCombinationAllowedByConstraints ( array $dimensionsNamesAndPresetIdentifiers ) : boolean Checks if the given combination of presets is allowed, according to possibly defined constraints in the content dimension configuration.
setConfiguration ( array $configuration ) : void

Protected Methods

Method Description
comparePresetsForTargetValue ( array $possibleBetterPreset, array $targetValues, array $currentBestPreset = null ) : array 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.
isPresetAllowedByConstraints ( string $dimensionName, string $presetIdentifier, array $constraints ) : boolean Checks if the given preset of the specified dimension is allowed according to the given constraints

Method Details

comparePresetsForTargetValue() protected method

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.
protected comparePresetsForTargetValue ( array $possibleBetterPreset, array $targetValues, array $currentBestPreset = null ) : array
$possibleBetterPreset array
$targetValues array
$currentBestPreset array
return array

findPresetByDimensionValues() public method

public findPresetByDimensionValues ( $dimensionName, array $dimensionValues )
$dimensionValues array

findPresetsByTargetValues() public method

public findPresetsByTargetValues ( array $targetValues )
$targetValues array

getAllPresets() public method

public getAllPresets ( )

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

public getDefaultPreset ( $dimensionName )

isPresetAllowedByConstraints() protected method

Checks if the given preset of the specified dimension is allowed according to the given constraints
protected isPresetAllowedByConstraints ( string $dimensionName, string $presetIdentifier, array $constraints ) : boolean
$dimensionName string Name of the dimension the preset belongs to
$presetIdentifier string Identifier of the preset to check
$constraints array Constraints to use for the check
return boolean

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

setConfiguration() public method

public setConfiguration ( array $configuration ) : void
$configuration array
return void

Property Details

$configuration protected_oe property

Dimension presets configuration indexed by dimension name, see ContentDimensionPresetSourceInterface
protected array $configuration
return array