function FrxReportGenerator::load_provider in Forena Reports 6.2
Same name and namespace in other branches
- 7.2 FrxReportGenerator.inc \FrxReportGenerator::load_provider()
Load the data provider class based on the class name.
Parameters
string $name:
Return value
object The data provider object
1 call to FrxReportGenerator::load_provider()
File
- ./
FrxReportGenerator.inc, line 207 - Common functions used throughout the project but loaded in this file to keep the module file lean.
Class
Code
function load_provider($conf, $repo_path) {
@($name = isset($conf['data provider']) ? $conf['data provider'] : $conf['data_engine']);
$this
->define_plugins();
// Instantiate the path
if (class_exists($name)) {
$o = new $name($conf, $repo_path);
return $o;
}
else {
$this->app
->error('Data provider not found for ' . $conf['title']);
}
}