function RevisionDeleteForm::getBundleLabel

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php \Drupal\Core\Entity\Form\RevisionDeleteForm::getBundleLabel()

Returns the bundle label of an entity.

Parameters

\Drupal\Core\Entity\RevisionableInterface $entity: The entity.

Return value

string|null The bundle label.

1 call to RevisionDeleteForm::getBundleLabel()
RevisionDeleteForm::submitForm in core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php
Form submission handler.

File

core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php, line 199

Class

RevisionDeleteForm
Provides a form for deleting an entity revision.

Namespace

Drupal\Core\Entity\Form

Code

protected function getBundleLabel(RevisionableInterface $entity) : ?string {
    $bundleInfo = $this->bundleInformation
        ->getBundleInfo($entity->getEntityTypeId());
    return isset($bundleInfo[$entity->bundle()]['label']) ? (string) $bundleInfo[$entity->bundle()]['label'] : NULL;
}

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