You are here

public function RendererBase::removeChildrenExcept in Forena Reports 7.5

Removes all chidren from the dome node expect those with a tagname specified by the the $tags argurment

Parameters

$node Parent node to remove from:

$tags array Tags to eingore:

File

src/Renderer/RendererBase.php, line 899
FrxRenderer.php Base class for Frx custom Renderer @author davidmetzler

Class

RendererBase

Namespace

Drupal\forena\Renderer

Code

public function removeChildrenExcept(DOMNode $node, $tags = array(
  'table',
)) {
  foreach ($node->childNodes as $child) {
    if ($child->nodeType != XML_ELEMENT_NODE || array_search($child->tagName, $tags) === FALSE) {
      $this
        ->removeChildren($child);
      $node
        ->removeChild($child);
    }
  }
}