/** * @param $ownerDocument * @param array $blockedTags */ public function getCacheTags($ownerDocument, $tags = array()) { $tags = is_array($tags) ? $tags : array(); if ($this->image instanceof Asset) { if (!array_key_exists($this->image->getCacheTag(), $tags)) { $tags = $this->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; }