Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LayoutBuilderEntityViewDisplay.php

function LayoutBuilderEntityViewDisplay::label

@todo Move this upstream in https://www.drupal.org/node/2939931.

Overrides EntityBase::label

File

core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php, line 368

Class

LayoutBuilderEntityViewDisplay
Provides an entity view display entity that has a layout.

Namespace

Drupal\layout_builder\Entity

Code

public function label() {
    $bundle_info = \Drupal::service('entity_type.bundle.info')->getBundleInfo($this->getTargetEntityTypeId());
    $bundle_label = $bundle_info[$this->getTargetBundle()]['label'];
    $target_entity_type = $this->entityTypeManager()
        ->getDefinition($this->getTargetEntityTypeId());
    return new TranslatableMarkup('@bundle @label', [
        '@bundle' => $bundle_label,
        '@label' => $target_entity_type->getPluralLabel(),
    ]);
}
RSS feed
Powered by Drupal