You are here

public function ConfigEntityRevisionsDeleteFormBase::getDescription in Config Entity Revisions 1.x

Same name and namespace in other branches
  1. 8.2 src/ConfigEntityRevisionsDeleteFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsDeleteFormBase::getDescription()
  2. 8 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 123

Class

ConfigEntityRevisionsDeleteFormBase
Provides a form for reverting a config entity revision.

Namespace

Drupal\config_entity_revisions

Code

public function getDescription() {
  if ($this->config_entity
    ->has_own_content()) {
    $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 '';
}