You are here

public function ContentEntityConfirmFormBase::validateForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php \Drupal\Core\Entity\ContentEntityConfirmFormBase::validateForm()

Button-level validation handlers are highly discouraged for entity forms, as they will prevent entity validation from running. If the entity is going to be saved during the form submission, this method should be manually invoked from the button-level validation handler, otherwise an exception will be thrown.

Overrides ContentEntityForm::validateForm

File

core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php, line 121
Contains \Drupal\Core\Entity\ContentEntityConfirmFormBase.

Class

ContentEntityConfirmFormBase
Provides a generic base class for an entity-based confirmation form.

Namespace

Drupal\Core\Entity

Code

public function validateForm(array &$form, FormStateInterface $form_state) {

  // Override the default validation implementation as it is not necessary
  // nor possible to validate an entity in a confirmation form.
  return $this->entity;
}