function ContentEntityFormInterface::validateForm

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php \Drupal\Core\Entity\ContentEntityFormInterface::validateForm()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php \Drupal\Core\Entity\ContentEntityFormInterface::validateForm()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php \Drupal\Core\Entity\ContentEntityFormInterface::validateForm()

Note that extending classes should not override this method to add entity validation logic, but define further validation constraints using the entity validation API and/or provide a new validation constraint if necessary. This is the only way to ensure that the validation logic is correctly applied independently of form submissions; e.g., for REST requests. For more information about entity validation, see https://www.drupal.org/node/2015613.

Return value

\Drupal\Core\Entity\ContentEntityInterface The built entity.

Overrides FormInterface::validateForm

File

core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php, line 76

Class

ContentEntityFormInterface
Defines a common interface for content entity form classes.

Namespace

Drupal\Core\Entity

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.