W3cubDocs

/Drupal 8

public function WidgetBaseInterface::flagErrors

public WidgetBaseInterface::flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state)

Reports field-level validation errors against actual form elements.

Parameters

\Drupal\Core\Field\FieldItemListInterface $items: The field values.

\Symfony\Component\Validator\ConstraintViolationListInterface $violations: A list of constraint violations to flag.

array $form: The form structure where field elements are attached to. This might be a full form structure, or a sub-element of a larger form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

File

core/lib/Drupal/Core/Field/WidgetBaseInterface.php, line 68

Class

WidgetBaseInterface
Base interface definition for "Field widget" plugins.

Namespace

Drupal\Core\Field

Code

public function flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Field!WidgetBaseInterface.php/function/WidgetBaseInterface::flagErrors/8.1.x