You are here

public function BlockEditor::configValidate in Forena Reports 7.5

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

Use the classes validate method to validate the block.

Parameters

$builder:

$config:

Return value

multitype:

File

src/Editor/BlockEditor.php, line 308

Class

BlockEditor

Namespace

Drupal\forena\Editor

Code

public function configValidate($builder, &$config) {
  $this
    ->getBuilders();
  $errors = array();
  if (isset($this->builders[$builder])) {
    $b = $this->builders[$builder];
    if (method_exists($b, 'configValidate')) {
      $errors = $b
        ->configValidate($config);
    }
    if ($errors) {
      foreach ($errors as $name => $error) {
        form_set_error($name, $error);
      }
    }
  }
  return $errors;
}