PHP Class Neos\Media\TypeConverter\ArrayConverter

Inheritance: extends Neos\Flow\Property\TypeConverter\AbstractTypeConverter
Show file Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$priority integer
$sourceTypes array
$targetType string

Public Methods

Method Description
canConvertFrom ( mixed $source, string $targetType ) : boolean
convertFrom ( Neos\Media\Domain\Model\AssetInterface $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : array Convert an object from $source to an array
getSourceChildPropertiesToBeConverted ( mixed $source ) : array Return a list of sub-properties inside the source object.
getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string Return the type of a given sub-property inside the $targetType, in this case always "array"

Method Details

canConvertFrom() public method

public canConvertFrom ( mixed $source, string $targetType ) : boolean
$source mixed
$targetType string
return boolean

convertFrom() public method

Convert an object from $source to an array
public convertFrom ( Neos\Media\Domain\Model\AssetInterface $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : array
$source Neos\Media\Domain\Model\AssetInterface
$targetType string
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
return array The converted asset or NULL

getSourceChildPropertiesToBeConverted() public method

The "key" is the sub-property name, and the "value" is the value of the sub-property.
public getSourceChildPropertiesToBeConverted ( mixed $source ) : array
$source mixed
return array

getTypeOfChildProperty() public method

Return the type of a given sub-property inside the $targetType, in this case always "array"
public getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string
$targetType string is ignored
$propertyName string is ignored
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface is ignored
return string always "array"

Property Details

$persistenceManager protected property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface

$priority protected property

protected int $priority
return integer

$sourceTypes protected property

protected array $sourceTypes
return array

$targetType protected property

protected string $targetType
return string