Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::getPluralLabel()
  2. 9 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::getPluralLabel()

Gets the indefinite plural form of the name of the entity type.

This should return the human-readable name for more than one instance of the entity type. For example: "opportunities" (with the singular as "opportunity"), "children" (with the singular as "child"), or "content items" (with the singular as "content item").

Return value

string|\Drupal\Core\StringTranslation\TranslatableMarkup The plural label.

Overrides EntityTypeInterface::getPluralLabel

File

core/lib/Drupal/Core/Entity/EntityType.php, line 778

Class

EntityType
Provides an implementation of an entity type and its metadata.

Namespace

Drupal\Core\Entity

Code

public function getPluralLabel() {
  if (empty($this->label_plural)) {
    $lowercase_label = $this
      ->getSingularLabel();
    $this->label_plural = new TranslatableMarkup('@label entities', [
      '@label' => $lowercase_label,
    ], [], $this
      ->getStringTranslation());
  }
  return $this->label_plural;
}