You are here

public function BlockEditor::configValidate in Forena Reports 8

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

Use the classes validate method to validate the block.

Parameters

$builder:

$config:

Return value

array errors by field name.

File

src/Editor/BlockEditor.php, line 320

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;
}