You are here

public function DataManager::load_provider in Forena Reports 7.5

Load the data provider class based on the class name.

Parameters

string $name:

Return value

object The data provider object

1 call to DataManager::load_provider()
DataManager::load_repository in src/DataManager.php

File

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

Class

DataManager

Namespace

Drupal\forena

Code

public function load_provider($conf, $repo_path, $repos_name) {
  @($name = isset($conf['data provider']) ? $conf['data provider'] : $conf['data_engine']);
  $drivers = Frx::drivers('FrxDataSource');

  // Instantiate the path
  if (isset($drivers[$name]) && class_exists($drivers[$name]['class'])) {
    $class = $drivers[$name]['class'];
    $o = new $class($conf, $repo_path, $repos_name);
    return $o;
  }
  else {
    Frx::error('Data provider not found for ' . $conf['title']);
  }
}