public function convertFrom($source, $targetType = 'array', array $convertedChildProperties = array(), PropertyMappingConfigurationInterface $configuration = null)
{
$result = array();
foreach ($source as $processingInstruction) {
if ($processingInstruction['command'] !== '') {
$adjustment = null;
switch ($processingInstruction['command']) {
case 'crop':
$options = array();
$this->transferOptionFromCommandToAdjustment($processingInstruction['options'], $options, 'start.x', 'x');
$this->transferOptionFromCommandToAdjustment($processingInstruction['options'], $options, 'start.y', 'y');
$this->transferOptionFromCommandToAdjustment($processingInstruction['options'], $options, 'size.width', 'width');
$this->transferOptionFromCommandToAdjustment($processingInstruction['options'], $options, 'size.height', 'height');
$adjustment = new CropImageAdjustment($options);
break;
case 'resize':
$options = array();
$this->transferOptionFromCommandToAdjustment($processingInstruction['options'], $options, 'size.width', 'width');
$this->transferOptionFromCommandToAdjustment($processingInstruction['options'], $options, 'size.height', 'height');
$adjustment = new ResizeImageAdjustment($options);
break;
}
if ($adjustment !== null) {
$result[] = $adjustment;
}
}
}
return $result;
}