You are here

public function BlockContentDeleteForm::getDescription in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/block_content/src/Form/BlockContentDeleteForm.php \Drupal\block_content\Form\BlockContentDeleteForm::getDescription()
  2. 10 core/modules/block_content/src/Form/BlockContentDeleteForm.php \Drupal\block_content\Form\BlockContentDeleteForm::getDescription()

Returns additional text to display as a description.

Return value

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

Overrides ContentEntityConfirmFormBase::getDescription

File

core/modules/block_content/src/Form/BlockContentDeleteForm.php, line 17

Class

BlockContentDeleteForm
Provides a confirmation form for deleting a custom block entity.

Namespace

Drupal\block_content\Form

Code

public function getDescription() {
  $instances = $this->entity
    ->getInstances();
  if (!empty($instances)) {
    return $this
      ->formatPlural(count($instances), 'This will also remove 1 placed block instance. This action cannot be undone.', 'This will also remove @count placed block instances. This action cannot be undone.');
  }
  return parent::getDescription();
}