public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue)
{
if (isset($value->data)) {
// Determine what needs to be stored
if (isset($value->data['width']) && isset($value->data['fieldId'])) {
// width + field id set means that something really needs to be stored
$storageFieldValue->dataText = $this->createLegacyXml($value->data);
} elseif (isset($value->data['fieldId'])) {
// $fieldId without width mleans an empty field
$storageFieldValue->dataText = $this->createEmptyLegacyXml($value->data);
}
// otherwise the image is unprocessed and the DB field stays empty
// there will be a subsequent call to this method, after the image
// has been stored
}
}