Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / paragraphs / src / Form / ParagraphsTypeDeleteConfirm.php
index fac3c1787d4e194a2771c6324af5bb4f6362f131..f3749e2c4bce99f74349a044a2b4db8d4277d2c5 100644 (file)
@@ -2,47 +2,19 @@
 
 namespace Drupal\paragraphs\Form;
 
-use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Entity\EntityDeleteForm;
 use Drupal\Core\Form\FormStateInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Provides a form for Paragraphs type deletion.
  */
 class ParagraphsTypeDeleteConfirm extends EntityDeleteForm {
 
-  /**
-   * The query factory to create entity queries.
-   *
-   * @var \Drupal\Core\Entity\Query\QueryFactory
-   */
-  protected $queryFactory;
-
-  /**
-   * Constructs a new ParagraphsTypeDeleteConfirm object.
-   *
-   * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
-   *   The entity query object.
-   */
-  public function __construct(QueryFactory $query_factory) {
-    $this->queryFactory = $query_factory;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('entity.query')
-    );
-  }
-
   /**
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    $num_paragraphs = $this->queryFactory->get('paragraph')
+    $num_paragraphs = $this->entityTypeManager->getStorage('paragraph')->getQuery()
       ->condition('type', $this->entity->id())
       ->count()
       ->execute();