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

Breadcrumb

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

function EntityBase::label

Overrides EntityInterface::label

6 calls to EntityBase::label()
ConfigurableLanguage::getName in core/modules/language/src/Entity/ConfigurableLanguage.php
Gets the name of the language.
EntityBase::toLink in core/lib/Drupal/Core/Entity/EntityBase.php
Generates the HTML for a link to this entity.
FieldConfigBase::getLabel in core/lib/Drupal/Core/Field/FieldConfigBase.php
Returns a human readable label.
FieldStorageConfig::getLabel in core/modules/field/src/Entity/FieldStorageConfig.php
Returns the human-readable label for the field.
FilterFormat::preSave in core/modules/filter/src/Entity/FilterFormat.php
Acts on an entity before the presave hook is invoked.

... See full list

5 methods override EntityBase::label()
Block::label in core/modules/block/src/Entity/Block.php
Gets the label of the entity.
ContentEntityBase::label in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Gets the label of the entity.
Editor::label in core/modules/editor/src/Entity/Editor.php
Gets the label of the entity.
LayoutBuilderEntityViewDisplay::label in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
@todo Move this upstream in https://www.drupal.org/node/2939931.
View::label in core/modules/views/src/Entity/View.php
Gets the label of the entity.

File

core/lib/Drupal/Core/Entity/EntityBase.php, line 150

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public function label() {
    if (($label_key = $this->getEntityType()
        ->getKey('label')) && isset($this->{$label_key})) {
        return $this->{$label_key};
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal