PHP Class Neos\Flow\Property\PropertyMappingConfiguration

Inheritance: implements Neos\Flow\Property\PropertyMappingConfigurationInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$configuration array multi-dimensional array which stores type-converter specific configuration: 1. Dimension: Fully qualified class name of the type converter 2. Dimension: Configuration Key Value: Configuration Value
$mapUnknownProperties boolean If TRUE, unknown properties will be mapped.
$mapping array Keys which should be renamed
$propertiesNotToBeMapped array List of disallowed property names which will be ignored while property mapping
$propertiesToBeMapped array List of allowed property names to be converted
$propertiesToSkip array List of property names to be skipped during property mapping
$skipUnknownProperties boolean If TRUE, unknown properties will be skipped during property mapping
$subConfigurationForProperty array Stores the configuration for specific child properties.
$typeConverter Neos\Flow\Property\TypeConverterInterface

Méthodes publiques

Méthode Description
allowAllProperties ( ) : PropertyMappingConfiguration Allow all properties in property mapping, even unknown ones.
allowAllPropertiesExcept ( ) : PropertyMappingConfiguration Allow all properties during property mapping, but reject a few selected ones (blacklist).
allowProperties ( ) : PropertyMappingConfiguration Allow a list of specific properties. All arguments of allowProperties are used here (varargs).
forProperty ( string $propertyPath ) : PropertyMappingConfiguration Returns the configuration for the specific property path, ready to be modified. Should be used inside a fluent interface like: $configuration->forProperty('foo.bar')->setTypeConverterOption(.
getConfigurationFor ( string $propertyName ) : Neos\Flow\Property\PropertyMappingConfigurationInterface Returns the sub-configuration for the passed $propertyName. Must ALWAYS return a valid configuration object!
getConfigurationValue ( string $typeConverterClassName, string $key ) : mixed
getTargetPropertyName ( string $sourcePropertyName ) : string Maps the given $sourcePropertyName to a target property name.
getTypeConverter ( ) : Neos\Flow\Property\TypeConverterInterface Return the type converter set for this configuration.
setMapping ( string $sourcePropertyName, string $targetPropertyName ) : PropertyMappingConfiguration Define renaming from Source to Target property.
setTypeConverter ( Neos\Flow\Property\TypeConverterInterface $typeConverter ) : PropertyMappingConfiguration Set a type converter which should be used for this specific conversion.
setTypeConverterOption ( string $typeConverter, string $optionKey, mixed $optionValue ) : PropertyMappingConfiguration Set a single option (denoted by $optionKey) for the given $typeConverter.
setTypeConverterOptions ( string $typeConverter, array $options ) : PropertyMappingConfiguration Set all options for the given $typeConverter.
shouldMap ( string $propertyName ) : boolean The behavior is as follows:
shouldSkip ( string $propertyName ) : boolean Check if the given $propertyName should be skipped during mapping.
shouldSkipUnknownProperties ( ) : boolean Whether unknown (unconfigured) properties should be skipped during mapping, instead if causing an error.
skipProperties ( ) : PropertyMappingConfiguration Skip a list of specific properties. All arguments of skipProperties are used here (varargs).
skipUnknownProperties ( ) : PropertyMappingConfiguration When this is enabled, properties that are disallowed will be skipped instead of triggering an error during mapping.
traverseProperties ( array $splittedPropertyPath ) : PropertyMappingConfiguration Traverse the property configuration. Only used by forProperty().

Méthodes protégées

Méthode Description
getTypeConvertersWithParentClasses ( string $typeConverter ) : array Get type converter classes including parents for the given type converter

Method Details

allowAllProperties() public méthode

Allow all properties in property mapping, even unknown ones.
public allowAllProperties ( ) : PropertyMappingConfiguration
Résultat PropertyMappingConfiguration this

allowAllPropertiesExcept() public méthode

Example: allowAllPropertiesExcept('password', 'userGroup')
public allowAllPropertiesExcept ( ) : PropertyMappingConfiguration
Résultat PropertyMappingConfiguration this

allowProperties() public méthode

Example: allowProperties('title', 'content', 'author')
public allowProperties ( ) : PropertyMappingConfiguration
Résultat PropertyMappingConfiguration this

forProperty() public méthode

...)
public forProperty ( string $propertyPath ) : PropertyMappingConfiguration
$propertyPath string
Résultat PropertyMappingConfiguration (or a subclass thereof)

getConfigurationFor() public méthode

Returns the sub-configuration for the passed $propertyName. Must ALWAYS return a valid configuration object!
public getConfigurationFor ( string $propertyName ) : Neos\Flow\Property\PropertyMappingConfigurationInterface
$propertyName string
Résultat Neos\Flow\Property\PropertyMappingConfigurationInterface the property mapping configuration for the given $propertyName.

getConfigurationValue() public méthode

public getConfigurationValue ( string $typeConverterClassName, string $key ) : mixed
$typeConverterClassName string
$key string
Résultat mixed configuration value for the specific $typeConverterClassName. Can be used by Type Converters to fetch converter-specific configuration.

getTargetPropertyName() public méthode

Maps the given $sourcePropertyName to a target property name.
public getTargetPropertyName ( string $sourcePropertyName ) : string
$sourcePropertyName string
Résultat string property name of target

getTypeConverter() public méthode

Return the type converter set for this configuration.
public getTypeConverter ( ) : Neos\Flow\Property\TypeConverterInterface
Résultat Neos\Flow\Property\TypeConverterInterface

getTypeConvertersWithParentClasses() protected méthode

When setting an option on a subclassed type converter, this option must also be set on all its parent type converters.
protected getTypeConvertersWithParentClasses ( string $typeConverter ) : array
$typeConverter string The type converter class
Résultat array Class names of type converters

setMapping() public méthode

Define renaming from Source to Target property.
public setMapping ( string $sourcePropertyName, string $targetPropertyName ) : PropertyMappingConfiguration
$sourcePropertyName string
$targetPropertyName string
Résultat PropertyMappingConfiguration this

setTypeConverter() public méthode

Set a type converter which should be used for this specific conversion.
public setTypeConverter ( Neos\Flow\Property\TypeConverterInterface $typeConverter ) : PropertyMappingConfiguration
$typeConverter Neos\Flow\Property\TypeConverterInterface
Résultat PropertyMappingConfiguration this

setTypeConverterOption() public méthode

Set a single option (denoted by $optionKey) for the given $typeConverter.
public setTypeConverterOption ( string $typeConverter, string $optionKey, mixed $optionValue ) : PropertyMappingConfiguration
$typeConverter string class name of type converter
$optionKey string
$optionValue mixed
Résultat PropertyMappingConfiguration this

setTypeConverterOptions() public méthode

Set all options for the given $typeConverter.
public setTypeConverterOptions ( string $typeConverter, array $options ) : PropertyMappingConfiguration
$typeConverter string class name of type converter
$options array
Résultat PropertyMappingConfiguration this

shouldMap() public méthode

- if a property has been explicitly forbidden using allowAllPropertiesExcept(...), it is directly rejected - if a property has been allowed using allowProperties(...), it is directly allowed. - if allowAllProperties* has been called, we allow unknown properties - else, return false.
public shouldMap ( string $propertyName ) : boolean
$propertyName string
Résultat boolean TRUE if the given propertyName should be mapped, FALSE otherwise.

shouldSkip() public méthode

Check if the given $propertyName should be skipped during mapping.
public shouldSkip ( string $propertyName ) : boolean
$propertyName string
Résultat boolean

shouldSkipUnknownProperties() public méthode

Whether unknown (unconfigured) properties should be skipped during mapping, instead if causing an error.

skipProperties() public méthode

Example: skipProperties('unused', 'dummy')
public skipProperties ( ) : PropertyMappingConfiguration
Résultat PropertyMappingConfiguration this

skipUnknownProperties() public méthode

When this is enabled, properties that are disallowed will be skipped instead of triggering an error during mapping.
public skipUnknownProperties ( ) : PropertyMappingConfiguration
Résultat PropertyMappingConfiguration this

traverseProperties() public méthode

Traverse the property configuration. Only used by forProperty().
public traverseProperties ( array $splittedPropertyPath ) : PropertyMappingConfiguration
$splittedPropertyPath array
Résultat PropertyMappingConfiguration (or a subclass thereof)

Property Details

$configuration protected_oe property

multi-dimensional array which stores type-converter specific configuration: 1. Dimension: Fully qualified class name of the type converter 2. Dimension: Configuration Key Value: Configuration Value
protected array $configuration
Résultat array

$mapUnknownProperties protected_oe property

If TRUE, unknown properties will be mapped.
protected bool $mapUnknownProperties
Résultat boolean

$mapping protected_oe property

Keys which should be renamed
protected array $mapping
Résultat array

$propertiesNotToBeMapped protected_oe property

List of disallowed property names which will be ignored while property mapping
protected array $propertiesNotToBeMapped
Résultat array

$propertiesToBeMapped protected_oe property

List of allowed property names to be converted
protected array $propertiesToBeMapped
Résultat array

$propertiesToSkip protected_oe property

List of property names to be skipped during property mapping
protected array $propertiesToSkip
Résultat array

$skipUnknownProperties protected_oe property

If TRUE, unknown properties will be skipped during property mapping
protected bool $skipUnknownProperties
Résultat boolean

$subConfigurationForProperty protected_oe property

Stores the configuration for specific child properties.
protected array $subConfigurationForProperty
Résultat array

$typeConverter protected_oe property

protected TypeConverterInterface,Neos\Flow\Property $typeConverter
Résultat Neos\Flow\Property\TypeConverterInterface