You are here

public function NodeAccessRebuildProgressiveSettingsForm::validateForm in Node Access Rebuild Progressive 8

Same name and namespace in other branches
  1. 2.x src/Form/NodeAccessRebuildProgressiveSettingsForm.php \Drupal\node_access_rebuild_progressive\Form\NodeAccessRebuildProgressiveSettingsForm::validateForm()

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

src/Form/NodeAccessRebuildProgressiveSettingsForm.php, line 55

Class

NodeAccessRebuildProgressiveSettingsForm
Configure settings for our module.

Namespace

Drupal\node_access_rebuild_progressive\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $chunk_size = $form_state
    ->getValue('chunk');
  if (!is_numeric($chunk_size) || $chunk_size <= 0) {
    $form_state
      ->setErrorByName('chunk', $this
      ->t('Chunk size must be a positive integer.'));
  }
}