3 namespace Drupal\node\Form;
5 use Drupal\Core\Entity\EntityDeleteForm;
6 use Drupal\Core\Form\FormStateInterface;
9 * Provides a form for content type deletion.
11 class NodeTypeDeleteConfirm extends EntityDeleteForm {
16 public function buildForm(array $form, FormStateInterface $form_state) {
17 $num_nodes = $this->entityTypeManager->getStorage('node')->getQuery()
18 ->condition('type', $this->entity->id())
22 $caption = '<p>' . $this->formatPlural($num_nodes, '%type is used by 1 piece of content on your site. You can not remove this content type until you have removed all of the %type content.', '%type is used by @count pieces of content on your site. You may not remove %type until you have removed all of the %type content.', ['%type' => $this->entity->label()]) . '</p>';
23 $form['#title'] = $this->getQuestion();
24 $form['description'] = ['#markup' => $caption];
28 return parent::buildForm($form, $form_state);