Pimcore\Model\Object\ClassDefinition\Data\MultihrefMetadata::getCacheTags PHP Method

getCacheTags() public method

This is a dummy and is mostly implemented by relation types
public getCacheTags ( mixed $data, array $tags = [] ) : array
$data mixed
$tags array
return array
    public function getCacheTags($data, $tags = [])
    {
        $tags = is_array($tags) ? $tags : [];
        if (is_array($data) && count($data) > 0) {
            foreach ($data as $metaObject) {
                $element = $metaObject->getElement();
                if ($element instanceof Element\ElementInterface && !array_key_exists($element->getCacheTag(), $tags)) {
                    $tags = $element->getCacheTags($tags);
                }
            }
        }
        return $tags;
    }