class BlockContentDeleteForm

Same name and namespace in other branches
  1. 11.x core/modules/block_content/src/Form/BlockContentDeleteForm.php \Drupal\block_content\Form\BlockContentDeleteForm

Provides a confirmation form for deleting a custom block entity.

@internal

Hierarchy

Expanded class hierarchy of BlockContentDeleteForm

File

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

Namespace

Drupal\block_content\Form
View source
class BlockContentDeleteForm extends ContentEntityDeleteForm {
  
  /**
   * {@inheritdoc}
   */
  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();
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.