You are here

public function FrxReportEditor::getOptions in Forena Reports 7

Same name and namespace in other branches
  1. 6.2 FrxReportEditor.inc \FrxReportEditor::getOptions()
  2. 6 FrxReportEditor.inc \FrxReportEditor::getOptions()
  3. 7.2 FrxReportEditor.inc \FrxReportEditor::getOptions()

Retrieve options element in array form

File

./FrxReportEditor.inc, line 305

Class

FrxReportEditor
Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

Code

public function getOptions() {
  $dom = $this->dom;
  $this
    ->verifyHeaderElements(array(
    'options',
  ));
  $opts = $dom
    ->getElementsByTagNameNS($this->xmlns, 'options')
    ->item(0);
  $ret = array();

  // Simplexml is easier to work with
  $options = simplexml_import_dom($opts);
  foreach ($options
    ->attributes() as $key => $value) {
    $ret[(string) $key] = (string) $value;
  }
  return $ret;
}