You are here

protected function EntityDisplayFormBase::getExtraFields in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getExtraFields()
  2. 10 core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getExtraFields()

Returns the extra fields of the entity type and bundle used by this form.

Return value

array An array of extra field info.

See also

\Drupal\Core\Entity\EntityFieldManagerInterface::getExtraFields()

1 call to EntityDisplayFormBase::getExtraFields()
EntityDisplayFormBase::form in core/modules/field_ui/src/Form/EntityDisplayFormBase.php
Gets the actual form array to be built.

File

core/modules/field_ui/src/Form/EntityDisplayFormBase.php, line 724

Class

EntityDisplayFormBase
Base class for EntityDisplay edit forms.

Namespace

Drupal\field_ui\Form

Code

protected function getExtraFields() {
  $context = $this->displayContext == 'view' ? 'display' : $this->displayContext;
  $extra_fields = $this->entityFieldManager
    ->getExtraFields($this->entity
    ->getTargetEntityTypeId(), $this->entity
    ->getTargetBundle());
  return isset($extra_fields[$context]) ? $extra_fields[$context] : [];
}