You are here

public function FrxEditor::setCache in Forena Reports 7.4

File

./FrxEditor.inc, line 566
FrxEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

Class

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

Code

public function setCache($data) {
  $dom = $this->dom;
  $this
    ->verifyHeaderElements(array(
    'cache',
  ));
  $options = $dom
    ->getElementsByTagNameNS($this->xmlns, 'cache')
    ->item(0);
  foreach ($data as $key => $value) {
    if ($value) {
      $options
        ->setAttribute($key, $value);
    }
    else {
      if ($options
        ->hasAttribute($key)) {
        $options
          ->removeAttribute($key);
      }
    }
  }
}