ContentEntityForm::getEditedFieldNames

protected ContentEntityForm::getEditedFieldNames(FormStateInterface $form_state)

Gets the names of all fields edited in the form.

If the entity form customly adds some fields to the form (i.e. without using the form display), it needs to add its fields here and override flagViolations() for displaying the violations.

Parameters

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

Return value

string[] An array of field names.

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 125

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

protected function getEditedFieldNames(FormStateInterface $form_state) {
  return array_keys($this->getFormDisplay($form_state)->getComponents());
}
doc_Drupal
2016-10-29 08:57:15
Comments
Leave a Comment

Please login to continue.