You are here

public function FieldValidationRuleSetEditForm::fieldValidationRuleValidate in Field Validation 8

Validate handler for fieldValidationRule.

File

src/Form/FieldValidationRuleSetEditForm.php, line 207

Class

FieldValidationRuleSetEditForm
Controller for blocktabs edit form.

Namespace

Drupal\field_validation\Form

Code

public function fieldValidationRuleValidate($form, FormStateInterface $form_state) {
  if (!$form_state
    ->getValue('new')) {
    $form_state
      ->setErrorByName('new', $this
      ->t('Select an rule to add.'));
  }
}