Neos\Flow\Property\TypeConverter\CollectionConverter::getTypeOfChildProperty PHP Méthode

getTypeOfChildProperty() public méthode

Return the type of a given sub-property inside the $targetType
public getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string
$targetType string
$propertyName string
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
Résultat string
    public function getTypeOfChildProperty($targetType, $propertyName, PropertyMappingConfigurationInterface $configuration)
    {
        $parsedTargetType = TypeHandling::parseType($targetType);
        return $parsedTargetType['elementType'];
    }

Usage Example

 /**
  * @test
  */
 public function getTypeOfChildPropertyReturnsEmptyStringForElementTypeIfNotGivenInTargetType()
 {
     $this->assertEquals('', $this->converter->getTypeOfChildProperty('array', '', $this->createMock(PropertyMappingConfigurationInterface::class)));
 }