You are here

public function BlockEditor::getBuilders in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 src/Editor/BlockEditor.php \Drupal\forena\Editor\BlockEditor::getBuilders()

Instantiate the builders if necessary

4 calls to BlockEditor::getBuilders()
BlockEditor::builderList in src/Editor/BlockEditor.php
BlockEditor::configForm in src/Editor/BlockEditor.php
Use the classes configForm method to build the form.
BlockEditor::configValidate in src/Editor/BlockEditor.php
Use the classes validate method to validate the block.
BlockEditor::generate in src/Editor/BlockEditor.php
Use the classes generate method to generate the block.

File

src/Editor/BlockEditor.php, line 247

Class

BlockEditor

Namespace

Drupal\forena\Editor

Code

public function getBuilders() {
  if (!$this->builders) {
    $this->builders = array();
    $builders = \Drupal::moduleHandler()
      ->invokeAll('forena_query_builders');
    foreach ($builders as $builder) {
      if (isset($builder['file'])) {
        @(include_once $builder['file']);
      }
      if (class_exists($builder['class'])) {
        $b = new $builder['class']();
        $this->builders[$builder['class']] = $b;
      }
    }
  }
}