You are here

public static function Frx::getDriver in Forena Reports 7.5

Factory method to return instance object

Parameters

unknown_type $parent:

unknown_type $key:

Return value

object

1 call to Frx::getDriver()
Frx::Context in ./Frx.inc
Factory object to get the context based on a name. IF the context doesn't exist we assume the default data context (FrxData).

File

./Frx.inc, line 269
Frx.incL General Forena Reporting Class

Class

Frx

Code

public static function getDriver($parent, $key) {
  static $objects = '';
  $o = NULL;
  if (!$objects) {
    $objects = array();
  }
  $plugins = Frx::drivers($parent);
  if (isset($plugins[$key])) {
    $class = @$plugins[$key]['class'];
    if (!isset($objects[$class])) {
      if (class_exists($class)) {
        $objects[$class] = new $class();
      }
    }
    $o = $objects[$class];
  }
  return $o;
}