public function unmarshal($value, $object = null, $params = [])
{
if (is_array($value)) {
$image = new Object\Data\Hotspotimage();
$image->setHotspots($value["hotspots"]);
$image->setMarker($value["marker"]);
$image->setCrop($value["crop"]);
if ($value["image"]) {
$type = $value["image"]["type"];
$id = $value["image"]["id"];
$asset = Element\Service::getElementById($type, $id);
$image->setImage($asset);
}
return $image;
}
}