Pimcore\Model\Object\ClassDefinition\Data\Hotspotimage::getDataForResource PHP Method

getDataForResource() public method

See also: Object\ClassDefinition\Data::getDataForResource
public getDataForResource ( Pimcore\Model\Object\Data\Hotspotimage $data, null | AbstractObject $object = null, mixed $params = [] ) : integer | null
$data Pimcore\Model\Object\Data\Hotspotimage
$object null | Pimcore\Model\Object\AbstractObject
$params mixed
return integer | null
    public function getDataForResource($data, $object = null, $params = [])
    {
        if ($data instanceof Object\Data\Hotspotimage) {
            $imageId = null;
            if ($data->getImage()) {
                $imageId = $data->getImage()->getId();
            }
            $metaData = ["hotspots" => $data->getHotspots(), "marker" => $data->getMarker(), "crop" => $data->getCrop()];
            $metaData = Serialize::serialize($metaData);
            return [$this->getName() . "__image" => $imageId, $this->getName() . "__hotspots" => $metaData];
        }
        return [$this->getName() . "__image" => null, $this->getName() . "__hotspots" => null];
    }