function EntityDisplayModeFormBase::getEntityDisplay

Same name in other branches
  1. 10 core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php \Drupal\field_ui\Form\EntityDisplayModeFormBase::getEntityDisplay()

Returns an entity display object to be used by this form.

Parameters

string $entity_type_id: The target entity type ID of the entity display.

string $bundle: The target bundle of the entity display.

string $mode: A view or form mode.

Return value

\Drupal\Core\Entity\Display\EntityDisplayInterface An entity display.

File

core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php, line 221

Class

EntityDisplayModeFormBase
Provides the generic base class for entity display mode forms.

Namespace

Drupal\field_ui\Form

Code

private function getEntityDisplay($entity_type_id, $bundle, $mode) {
    return match ($this->displayContext) {    'view' => $this->entityDisplayRepository
            ->getViewDisplay($entity_type_id, $bundle, $mode),
        'form' => $this->entityDisplayRepository
            ->getFormDisplay($entity_type_id, $bundle, $mode),
    
    };
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.