You are here

public function RendererBase::setFirstNode in Forena Reports 7.5

Sets the first child element to a node and returns it. IF the node

Parameters

DOMNode $node:

unknown $tag:

unknown $indent:

Return value

Ambigous <string, void, DOMElement>

6 calls to RendererBase::setFirstNode()
FrxCrosstab::generate in src/Renderer/FrxCrosstab.php
Generate the template from the configuration.
FrxFieldTable::generate in src/Renderer/FrxFieldTable.php
Generate the template from the configuration.
FrxSVGGraph::generate in src/Renderer/FrxSVGGraph.php
Generate the template from the configuration.
FrxSVGGraph::generateCrossTab in src/Renderer/FrxSVGGraph.php
Generate a crosstab table.
FrxSVGGraph::generateTable in src/Renderer/FrxSVGGraph.php
Generate a basic table.

... See full list

File

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

Class

RendererBase

Namespace

Drupal\forena\Renderer

Code

public function setFirstNode(DOMElement $parent_node, $indent = 0, $tag = 'div', $value = '', $attributes = array(), $frx_attributes = array()) {
  $dom = $this->frxReport->dom;
  if (!$parent_node) {
    return;
  }
  $nodes = $parent_node
    ->getElementsByTagName($tag);
  if ($nodes->length) {
    $node = $nodes
      ->item(0);
    $this
      ->setAttributes($node, $attributes, $frx_attributes);
  }
  else {
    $node = $this
      ->addNode($parent_node, $indent, $tag, $value, $attributes, $frx_attributes);
  }
  return $node;
}