function ContentEntityBase::label

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::label()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::label()
  3. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::label()
2 methods override ContentEntityBase::label()
Item::label in core/modules/aggregator/src/Entity/Item.php
Gets the label of the entity.
Media::label in core/modules/media/src/Entity/Media.php
Gets the label of the entity.

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 1264

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function label() {
  if ($this->getEntityType()
    ->getKey('label')) {
    return $this->getEntityKey('label');
  }
}

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