function RestExampleClientDelete::validateForm

Same name in other branches
  1. 3.x modules/rest_example/src/Form/RestExampleClientDelete.php \Drupal\rest_example\Form\RestExampleClientDelete::validateForm()

Overrides FormBase::validateForm

File

modules/rest_example/src/Form/RestExampleClientDelete.php, line 74

Class

RestExampleClientDelete
Delete a new node on a remote Drupal site.

Namespace

Drupal\rest_example\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
    if (is_null($form_state->get('node_id')) || !is_numeric($form_state->get('node_id'))) {
        $form_state->setErrorByName('delete', $this->t('The ID passed in the URL is not an integer'));
    }
}