You are here

public function WebformSubmissionsPurgeForm::getDescription in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Form/WebformSubmissionsPurgeForm.php \Drupal\webform\Form\WebformSubmissionsPurgeForm::getDescription()

Returns additional text to display as a description.

Return value

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

Overrides WebformDeleteFormBase::getDescription

File

src/Form/WebformSubmissionsPurgeForm.php, line 60

Class

WebformSubmissionsPurgeForm
Webform for webform submission purge webform.

Namespace

Drupal\webform\Form

Code

public function getDescription() {
  $form_total = $this->entityTypeManager
    ->getStorage('webform')
    ->getQuery()
    ->count()
    ->execute();
  $submission_total = $this
    ->getSubmissionTotal();
  $t_args = [
    '@submission_total' => $submission_total,
    '@submissions' => $this
      ->formatPlural($submission_total, 'submission', 'submissions'),
    '@form_total' => $form_total,
    '@forms' => $this
      ->formatPlural($form_total, 'webform', 'webforms'),
  ];
  return [
    'title' => [
      '#markup' => $this
        ->t('This action will…'),
    ],
    'list' => [
      '#theme' => 'item_list',
      '#items' => [
        $this
          ->t('Remove @submission_total @submissions in @form_total @forms', $t_args),
        [
          '#markup' => '<em>' . $this
            ->t('Take a few minutes to complete') . '</em>',
        ],
      ],
    ],
  ];
}