Neos\Flow\Property\PropertyMapper::buildPropertyMappingConfiguration PHP Method

buildPropertyMappingConfiguration() public method

Builds the default property mapping configuration.
public buildPropertyMappingConfiguration ( string $type = PropertyMappingConfiguration::class ) : PropertyMappingConfiguration
$type string the implementation class name of the PropertyMappingConfiguration to instantiate; must be a subclass of Neos\Flow\Property\PropertyMappingConfiguration
return PropertyMappingConfiguration
    public function buildPropertyMappingConfiguration($type = PropertyMappingConfiguration::class)
    {
        /** @var PropertyMappingConfiguration $configuration */
        $configuration = new $type();
        $configuration->setTypeConverterOptions(TypeConverter\PersistentObjectConverter::class, [TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED => true, TypeConverter\PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED => true]);
        $configuration->allowAllProperties();
        return $configuration;
    }

Usage Example

Beispiel #1
0
 /**
  * @test
  */
 public function getTargetPropertyNameShouldReturnTheUnmodifiedPropertyNameWithoutConfiguration()
 {
     $defaultConfiguration = $this->propertyMapper->buildPropertyMappingConfiguration();
     $this->assertTrue($defaultConfiguration->getConfigurationValue(\Neos\Flow\Property\TypeConverter\PersistentObjectConverter::class, \Neos\Flow\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED));
     $this->assertTrue($defaultConfiguration->getConfigurationValue(\Neos\Flow\Property\TypeConverter\PersistentObjectConverter::class, \Neos\Flow\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED));
     $this->assertNull($defaultConfiguration->getConfigurationFor('foo')->getConfigurationValue(\Neos\Flow\Property\TypeConverter\PersistentObjectConverter::class, \Neos\Flow\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED));
     $this->assertNull($defaultConfiguration->getConfigurationFor('foo')->getConfigurationValue(\Neos\Flow\Property\TypeConverter\PersistentObjectConverter::class, \Neos\Flow\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED));
 }
All Usage Examples Of Neos\Flow\Property\PropertyMapper::buildPropertyMappingConfiguration