You are here

public function ReportEditor::setCategory in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 src/Editor/ReportEditor.php \Drupal\forena\Editor\ReportEditor::setCategory()

Set the report category Enter description here ...

Parameters

string $category: Category for listing the report in.

File

src/Editor/ReportEditor.php, line 535
ReportEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

Class

ReportEditor

Namespace

Drupal\forena\Editor

Code

public function setCategory($category) {
  $dom = $this->dom;
  $this
    ->verifyHeaderElements(array(
    'category',
  ));
  $head = $dom
    ->getElementsByTagName('head')
    ->item(0);
  $cnode = $dom
    ->getElementsByTagNameNS($this->xmlns, 'category')
    ->item(0);
  $node = $dom
    ->createElementNS($this->xmlns, 'category', $category);
  $head
    ->replaceChild($node, $cnode);
}