Backup of db before drupal security update
[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 class BlockContentDeleteForm extends ContentEntityDeleteForm {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function buildForm(array $form, FormStateInterface $form_state) {
17     $instances = $this->entity->getInstances();
18
19     $form['message'] = [
20       '#markup' => $this->formatPlural(count($instances), 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instances.'),
21       '#access' => !empty($instances),
22     ];
23
24     return parent::buildForm($form, $form_state);
25   }
26
27 }