You are here

public function DataManager::createDataSource in Forena Reports 8

Load the driver class based on the class name.

Parameters

string $name:

Return value

\Drupal\forena\FrxPlugin\Driver\DriverBase The data provider object

1 call to DataManager::createDataSource()
DataManager::loadRepositoryConfig in src/DataManager.php

File

src/DataManager.php, line 143
DataManager.inc Enter description here ... @author davidmetzler

Class

DataManager

Namespace

Drupal\forena

Code

public function createDataSource($conf, $repo_path, $repos_name) {
  $o = NULL;
  @($name = $conf['driver']);
  $drivers = $this->drivers;

  // Instantiate the Data Driver object.
  if (isset($drivers[$name]) && class_exists($drivers[$name])) {
    $fileSystem = new DataFileSystem($name, $repo_path, $this);
    $class = $drivers[$name];
    $o = new $class($repos_name, $conf, $fileSystem);
  }
  else {
    AppService::instance()
      ->error('Driver not found for ' . $conf['title']);
  }
  return $o;
}