You are here

function FrxHostApplication::get_doctypes in Forena Reports 6.2

Same name and namespace in other branches
  1. 7.2 FrxHostApplication.inc \FrxHostApplication::get_doctypes()

* Gets the correct format function * to render the document and returns an * object of that class. * * If it fails it returns a 0;

File

./FrxHostApplication.inc, line 224

Class

FrxHostApplication

Code

function get_doctypes($fkey) {
  $controls = $this
    ->controls();
  foreach ($controls as $k => $r) {
    $provider = $r;
    if ($provider && method_exists($provider, 'doc_types')) {
      $f = $provider
        ->doc_types();
      if (isset($f[$fkey]) && method_exists($provider, $f[$fkey])) {

        // We found an object with the advertised method return it
        return $provider;
      }
    }
  }
  return 0;
}