EntityFormDisplayInterface::flagWidgetsErrorsFromViolations

public EntityFormDisplayInterface::flagWidgetsErrorsFromViolations(EntityConstraintViolationListInterface $violations, array &$form, FormStateInterface $form_state)

Flags entity validation violations as form errors.

This method processes all violations passed, thus any violations not related to fields of the form display must be processed before this method is invoked.

The method flags constraint violations related to fields shown on the form as form errors on the correct form elements. Possibly pre-existing violations of hidden fields (so fields not appearing in the display) are ignored. Other, non-field related violations are passed through and set as form errors according to the property path of the violations.

Parameters

\Drupal\Core\Entity\EntityConstraintViolationListInterface $violations: The 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/Entity/Display/EntityFormDisplayInterface.php, line 177

Class

EntityFormDisplayInterface
Provides a common interface for entity form displays.

Namespace

Drupal\Core\Entity\Display

Code

public function flagWidgetsErrorsFromViolations(EntityConstraintViolationListInterface $violations, array &$form, FormStateInterface $form_state);
doc_Drupal
2016-10-29 09:06:25
Comments
Leave a Comment

Please login to continue.