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 349  
Class
- LayoutBuilderEntityViewDisplay
 - Provides an entity view display entity that has a layout.
 
Namespace
Drupal\layout_builder\EntityCode
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(),
  ]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.