fe0759cc16d501b9cecb61fec7a481b6de6d98ce
[yaffs-website] / web / core / modules / block_content / src / Form / BlockContentDeleteForm.php
1 <?php
2
3 namespace Drupal\block_content\Form;
4
5 use Drupal\Core\Entity\ContentEntityDeleteForm;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Provides a confirmation form for deleting a custom block entity.
10  *
11  * @internal
12  */
13 class BlockContentDeleteForm extends ContentEntityDeleteForm {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function buildForm(array $form, FormStateInterface $form_state) {
19     $instances = $this->entity->getInstances();
20
21     $form['message'] = [
22       '#markup' => $this->formatPlural(count($instances), 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instances.'),
23       '#access' => !empty($instances),
24     ];
25
26     return parent::buildForm($form, $form_state);
27   }
28
29 }