src/lib/eZ/RichText/Converter/Render/Embed.php
protected function isLinkWrapped(DOMElement $element)
    {
        $parentNode = $element->parentNode;

        if ($parentNode instanceof DOMDocument) {
            return false;
        } elseif ($parentNode->localName === 'link') {
            $childCount = 0;

            /** @var \DOMText|\DOMElement $node */
            foreach ($parentNode->childNodes as $node) {
                if (!($node->nodeType === XML_TEXT_NODE && $node->isWhitespaceInElementContent())) {
                    ++$childCount;
                }
            }

            if ($childCount === 1) {
                return false;
            } else {
                return true;
            }
        }

        return $this->isLinkWrapped($parentNode);
    }
protected function isLinkWrapped(DOMElement $element)
    {
        $parentNode = $element->parentNode;

        if ($parentNode instanceof DOMDocument) {
            return false;
        } elseif ($parentNode->localName === 'link') {
            $childCount = 0;

            /** @var \DOMText|\DOMElement $node */
            foreach ($parentNode->childNodes as $node) {
                if (!($node->nodeType === XML_TEXT_NODE && $node->isWhitespaceInElementContent())) {
                    ++$childCount;
                }
            }

            if ($childCount === 1) {
                return false;
            } else {
                return true;
            }
        }

        return $this->isLinkWrapped($parentNode);
    }
protected function isLinkWrapped ( DOMElement $ element ) { $ parentNode = $ element -> parentNode ; if ( $ parentNode instanceof DOMDocument ) { return false ; } elseif ( $ parentNode -> localName === 'link' ) { $ childCount = 0 ; /** @var \DOMText|\DOMElement $node */ foreach ( $ parentNode -> childNodes as $ node ) { if ( ! ( $ node -> nodeType === XML_TEXT_NODE && $ node -> isWhitespaceInElementContent ( ) ) ) { ++ $ childCount ; } } if ( $ childCount === 1 ) { return false ; } else { return true ; } } return $ this -> isLinkWrapped ( $ parentNode ) ; }
Returns boolean signifying if the embed is contained in a link element of not.

After EmbedLinking converter pass this should be possible only for inline level embeds.

@param \DOMElement $element

@return bool
Returns boolean signifying if the embed is contained in a link element of not .