public function EntityFormController::validate

Implements Drupal\Core\Entity\EntityFormControllerInterface::validate().

Overrides EntityFormControllerInterface::validate

7 calls to EntityFormController::validate()
10 methods override EntityFormController::validate()
AccountFormController::validate in drupal/core/modules/user/lib/Drupal/user/AccountFormController.php
Overrides Drupal\Core\Entity\EntityFormController::submit().
CategoryFormController::validate in drupal/core/modules/contact/lib/Drupal/contact/CategoryFormController.php
Overrides Drupal\Core\Entity\EntityFormController::validate().
CommentFormController::validate in drupal/core/modules/comment/lib/Drupal/comment/CommentFormController.php
Overrides Drupal\Core\Entity\EntityFormController::validate().
EntityFormControllerNG::validate in drupal/core/lib/Drupal/Core/Entity/EntityFormControllerNG.php
Overrides EntityFormController::validate().
NodeFormController::validate in drupal/core/modules/node/lib/Drupal/node/NodeFormController.php
Overrides Drupal\Core\Entity\EntityFormController::validate().

... See full list

File

drupal/core/lib/Drupal/Core/Entity/EntityFormController.php, line 156
Definition of Drupal\Core\Entity\EntityFormController.

Class

EntityFormController
Base class for entity form controllers.

Namespace

Drupal\Core\Entity

Code

public function validate(array $form, array &$form_state) {

  // @todo Exploit the Field API to validate the values submitted for the
  // entity properties.
  $entity = $this
    ->buildEntity($form, $form_state);
  $info = $entity
    ->entityInfo();
  if (!empty($info['fieldable'])) {
    field_attach_form_validate($entity
      ->entityType(), $entity, $form, $form_state);
  }

  // @todo Remove this.
  // Execute legacy global validation handlers.
  unset($form_state['validate_handlers']);
  form_execute_handlers('validate', $form, $form_state);
}