You are here

protected function EntityListBuilder::getLabel in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getLabel()

Gets the label of an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity being listed.

Return value

string The entity label.

Deprecated

in Drupal 8.0.x, will be removed before Drupal 9.0.0 Use $entity->label() instead. This method used to escape the entity label. The render system's autoescape is now relied upon.

1 call to EntityListBuilder::getLabel()
TaxonomyMenuListBuilder::buildRow in modules/taxonomy_menu/src/Controller/TaxonomyMenuListBuilder.php
Builds a row for an entity in the entity listing.

File

core/lib/Drupal/Core/Entity/EntityListBuilder.php, line 119
Contains \Drupal\Core\Entity\EntityListBuilder.

Class

EntityListBuilder
Defines a generic implementation to build a listing of entities.

Namespace

Drupal\Core\Entity

Code

protected function getLabel(EntityInterface $entity) {
  return $entity
    ->label();
}