/**
* @return Media
*/
public function hydrateProductImage(array
$data) { $media =
$this->
hydrate($data);
$translation =
$this->
getTranslation($data, '__image'
);
$data =
array_merge($data,
$translation);
$media->
setName($data['__image_description'
]);
$media->
setPreview($data['__image_main'
] == 1
);
if (!
empty($data['__imageAttribute_id'
])) { $this->attributeHydrator->
addAttribute($media,
$data, 'imageAttribute', 'image', 'image'
);
} return $media;
} private function isUpdateRequired(Media
$media, array
$data): bool
{ if ($media->
getType() !== Media::TYPE_IMAGE
) {