You are here

ConfigPagesTypeDeleteForm.php in Config Pages 8.2

File

src/Form/ConfigPagesTypeDeleteForm.php
View source
<?php

namespace Drupal\config_pages\Form;

use Drupal\Core\Entity\EntityDeleteForm;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides a confirmation form for deleting a config page type entity.
 */
class ConfigPagesTypeDeleteForm extends EntityDeleteForm {

  /**
   * The query factory to create entity queries.
   *
   * @var \Drupal\Core\Entity\EntityStorageInterface::getQuery()
   */
  public $queryFactory;

  /**
   * Constructs a query factory object.
   *
   * @param EntityTypeManagerInterface $entity_type_manager
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this->queryFactory = $entity_type_manager
      ->getStorage('config_pages')
      ->getQuery();
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('entity_type.manager'));
  }

}

Classes

Namesort descending Description
ConfigPagesTypeDeleteForm Provides a confirmation form for deleting a config page type entity.