Pimcore\Model\Document\Tag\Image::getCacheTags PHP Method

getCacheTags() public method

public getCacheTags ( $ownerDocument, $tags = [] )
$ownerDocument
    public function getCacheTags($ownerDocument, $tags = [])
    {
        $tags = is_array($tags) ? $tags : [];
        $image = $this->getImage();
        if ($image instanceof Asset) {
            if (!array_key_exists($image->getCacheTag(), $tags)) {
                $tags = $image->getCacheTags($tags);
            }
        }
        $getMetaDataCacheTags = function ($data, $tags) {
            if (!is_array($data)) {
                return $tags;
            }
            foreach ($data as $element) {
                if (array_key_exists("data", $element) && is_array($element["data"]) && count($element["data"]) > 0) {
                    foreach ($element["data"] as $metaData) {
                        if ($metaData["value"] instanceof Element\ElementInterface) {
                            if (!array_key_exists($metaData["value"]->getCacheTag(), $tags)) {
                                $tags = $metaData["value"]->getCacheTags($tags);
                            }
                        }
                    }
                }
            }
            return $tags;
        };
        $tags = $getMetaDataCacheTags($this->marker, $tags);
        $tags = $getMetaDataCacheTags($this->hotspots, $tags);
        return $tags;
    }