You are here

public function DocManager::setDocument in Forena Reports 8

Parameters

string $type: Document type

Return value

\Drupal\forena\FrxPlugin\Document\DocumentInterface Generated class

1 call to DocManager::setDocument()
DocManager::__construct in src/DocManager.php
Initilaize Document Manager

File

src/DocManager.php, line 49

Class

DocManager
Implements \Drupal\forena\DocManager @package Drupal\forena

Namespace

Drupal\forena

Code

public function setDocument($type = '') {
  if (!$type) {
    $type = 'drupal';
  }
  if (!isset($this->writers[$type])) {
    $class = $this->docTypes[$type];
    $this->writers[$type] = new $class();
  }
  $this->type = $type;
  return $this->writers[$this->type];
}