You are here

public function MediaDeleteForm::getQuestion in Media Directories 2.x

Same name and namespace in other branches
  1. 8 modules/media_directories_ui/src/Form/MediaDeleteForm.php \Drupal\media_directories_ui\Form\MediaDeleteForm::getQuestion()
  2. 3.x modules/media_directories_ui/src/Form/MediaDeleteForm.php \Drupal\media_directories_ui\Form\MediaDeleteForm::getQuestion()

Returns the question to ask the user.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form question. The page title will be set to this value.

Overrides ConfirmFormInterface::getQuestion

1 call to MediaDeleteForm::getQuestion()
MediaDeleteForm::buildForm in modules/media_directories_ui/src/Form/MediaDeleteForm.php
Form constructor.

File

modules/media_directories_ui/src/Form/MediaDeleteForm.php, line 33

Class

MediaDeleteForm
A form to delete medias.

Namespace

Drupal\media_directories_ui\Form

Code

public function getQuestion() {
  if (count($this->entities) > 1) {
    return $this
      ->t('Do you want to delete @count items?', [
      '@count' => count($this->entities),
    ]);
  }
  $first_entity = reset($this->entities);
  return $this
    ->t('Do you want to delete @name?', [
    '@name' => $first_entity
      ->getName(),
  ]);
}