You are here

public function ConfigEntityRevisionsDeleteFormBase::getDescription in Config Entity Revisions 8.2

Same name and namespace in other branches
  1. 8 src/ConfigEntityRevisionsDeleteFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsDeleteFormBase::getDescription()
  2. 1.x src/ConfigEntityRevisionsDeleteFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsDeleteFormBase::getDescription()

Returns additional text to display as a description.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form description.

Overrides ConfirmFormBase::getDescription

File

src/ConfigEntityRevisionsDeleteFormBase.php, line 120

Class

ConfigEntityRevisionsDeleteFormBase
Provides a form for reverting a config entity revision.

Namespace

Drupal\config_entity_revisions

Code

public function getDescription() {
  if ($this->config_entity
    ->hasOwnContent()) {
    $count = $this->config_entity
      ->contentEntityCount($this->revision->revision->value);
    if ($count) {
      return \Drupal::service('string_translation')
        ->formatPlural($count, '1 submission will be deleted.', '@count submissions will be deleted.');
    }
  }
  return '';
}