diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php index c1eda08..1ba376b 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php @@ -9,7 +9,6 @@ use Drupal\aggregator\FeedStorageControllerInterface; use Drupal\Component\Utility\UrlHelper; -use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Form\FormBase; use Symfony\Component\DependencyInjection\ContainerInterface; use Guzzle\Http\Exception\RequestException; @@ -22,13 +21,6 @@ class OpmlFeedAdd extends FormBase { /** - * The entity query factory object. - * - * @var \Drupal\Core\Entity\Query\QueryFactory - */ - protected $queryFactory; - - /** * The feed storage. * * @var \Drupal\aggregator\FeedStorageControllerInterface @@ -45,15 +37,12 @@ class OpmlFeedAdd extends FormBase { /** * Constructs a database object. * - * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory - * The entity query object. * @param \Drupal\aggregator\FeedStorageControllerInterface $feed_storage * The feed storage. * @param \Guzzle\Http\ClientInterface $http_client * The Guzzle HTTP client. */ - public function __construct(QueryFactory $query_factory, FeedStorageControllerInterface $feed_storage, ClientInterface $http_client) { - $this->queryFactory = $query_factory; + public function __construct(FeedStorageControllerInterface $feed_storage, ClientInterface $http_client) { $this->feedStorageController = $feed_storage; $this->httpClient = $http_client; } @@ -63,7 +52,6 @@ public function __construct(QueryFactory $query_factory, FeedStorageControllerIn */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.query'), $container->get('entity.manager')->getStorageController('aggregator_feed'), $container->get('http_default_client') ); @@ -164,7 +152,7 @@ public function submitForm(array &$form, array &$form_state) { } // Check for duplicate titles or URLs. - $query = $this->queryFactory->get('aggregator_feed'); + $query = $this->feedStorageController->getQuery(); $condition = $query->orConditionGroup() ->condition('title', $feed['title']) ->condition('url', $feed['url']); diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php index caae9f7..ac94508 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php @@ -14,7 +14,6 @@ use Drupal\Core\Language\Language; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Datetime\DrupalDateTime; -use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Entity\EntityFormController; /** @@ -30,13 +29,6 @@ protected $patternType; /** - * The entity query factory. - * - * @var \Drupal\Core\Entity\Query\QueryFactory - */ - protected $queryFactory; - - /** * The date service. * * @var \Drupal\Core\Datetime\Date @@ -53,18 +45,15 @@ /** * Constructs a new date format form. * - * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory - * The entity query factory. * @param \Drupal\Core\Datetime\Date $date_service * The date service. * @param \Drupal\Core\Config\Entity\ConfigStorageControllerInterface $date_format_storage * The date format storage controller. */ - public function __construct(QueryFactory $query_factory, Date $date_service, ConfigStorageControllerInterface $date_format_storage) { + public function __construct(Date $date_service, ConfigStorageControllerInterface $date_format_storage) { $date = new DrupalDateTime(); $this->patternType = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP; - $this->queryFactory = $query_factory; $this->dateService = $date_service; $this->dateFormatStorage = $date_format_storage; } @@ -74,7 +63,6 @@ public function __construct(QueryFactory $query_factory, Date $date_service, Con */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.query'), $container->get('date'), $container->get('entity.manager')->getStorageController('date_format') ); @@ -94,8 +82,8 @@ public static function create(ContainerInterface $container) { * TRUE if this format already exists, FALSE otherwise. */ public function exists($entity_id, array $element, array $form_state) { - return (bool) $this->queryFactory - ->get($this->entity->getEntityTypeId()) + return (bool) $this->dateFormatStorage + ->getQuery() ->condition('id', $element['#field_prefix'] . $entity_id) ->execute(); }