class FieldValidationException

Exception thrown by field_attach_validate() on field validation errors.

Hierarchy

Expanded class hierarchy of FieldValidationException

5 files declare their use of FieldValidationException
field.attach.inc in drupal/core/modules/field/field.attach.inc
Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'.
FieldAttachOtherTest.php in drupal/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php
Definition of Drupal\field\Tests\FieldAttachOtherTest.
OptionsDynamicValuesValidationTest.php in drupal/core/modules/field/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesValidationTest.php
Definition of Drupal\options\Tests\OptionsDynamicValuesValidationTest.
TermFieldTest.php in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
Definition of Drupal\taxonomy\Tests\TermFieldTest.
TextFieldTest.php in drupal/core/modules/field/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
Definition of Drupal\text\TextFieldTest.

File

drupal/core/modules/field/lib/Drupal/field/FieldValidationException.php, line 13

Namespace

Drupal\field
View source
class FieldValidationException extends FieldException {

  /**
   * An array of field validation errors.
   *
   * @var array
   */
  public $errors;

  /**
   * Constructor for FieldValidationException.
   *
   * @param $errors
   *   An array of field validation errors, keyed by field name and
   *   delta that contains two keys:
   *   - 'error': A machine-readable error code string, prefixed by
   *     the field module name. A field widget may use this code to decide
   *     how to report the error.
   *   - 'message': A human-readable error message such as to be
   *     passed to form_error() for the appropriate form element.
   */
  function __construct($errors) {
    $this->errors = $errors;
    parent::__construct(t('Field validation errors'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FieldValidationException::$errors public property An array of field validation errors.
FieldValidationException::__construct function Constructor for FieldValidationException.