Neos\Neos\Ui\TypeConverter\ChangeCollectionConverter::convertFrom PHP Метод

convertFrom() публичный Метод

Converts a accordingly formatted, associative array to a change collection
public convertFrom ( array $source, string $targetType, array $subProperties = [], TYPO3\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : mixed
$source array
$targetType string not used
$subProperties array not used
$configuration TYPO3\Flow\Property\PropertyMappingConfigurationInterface not used
Результат mixed An object or \TYPO3\Flow\Error\Error if the input format is not supported or could not be converted for other reasons
    public function convertFrom($source, $targetType, array $subProperties = array(), PropertyMappingConfigurationInterface $configuration = null)
    {
        if (!is_array($source)) {
            return new \TYPO3\Flow\Error\Error(sprintf('Cannot convert %s to ChangeCollection.', gettype($source)));
        }
        $changeCollection = new ChangeCollection();
        foreach ($source as $changeData) {
            $convertedData = $this->convertChangeData($changeData);
            if ($convertedData instanceof \TYPO3\Flow\Error\Error) {
                return $convertedData;
            }
            $changeCollection->add($convertedData);
        }
        return $changeCollection;
    }
ChangeCollectionConverter