You are here

public function MaestroBatchFunctionTask::validateTaskEditForm in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/EngineTasks/MaestroBatchFunctionTask.php \Drupal\maestro\Plugin\EngineTasks\MaestroBatchFunctionTask::validateTaskEditForm()

This method must be called by the template builder in order to validate the form entry values before saving.

Overrides MaestroEngineTaskInterface::validateTaskEditForm

File

src/Plugin/EngineTasks/MaestroBatchFunctionTask.php, line 230

Class

MaestroBatchFunctionTask
Maestro Batch Function Task Plugin.

Namespace

Drupal\maestro\Plugin\EngineTasks

Code

public function validateTaskEditForm(array &$form, FormStateInterface $form_state) {
  $handler = $form_state
    ->getValue('handler');

  // Let's validate the handler here to ensure that it actually exists.
  if (!function_exists($handler)) {
    $form_state
      ->setErrorByName('handler', $this
      ->t('This handler batch function does not exist.'));
  }
}