Commit cb5644af authored by bapi_22's avatar bapi_22 Committed by gbyte.co

Issue #2893540 by bapi_22: Remove deprecated method/Class QueryFactory calls from code base

parent f8be69a0
......@@ -7,7 +7,6 @@ services:
- '@simple_sitemap.entity_helper'
- '@config.factory'
- '@database'
- '@entity.query'
- '@entity_type.manager'
- '@path.validator'
- '@date.formatter'
......@@ -49,7 +48,6 @@ services:
- '@language_manager'
- '@entity_type.manager'
- '@path.validator'
- '@entity.query'
- '@simple_sitemap.logger'
simple_sitemap.custom_url_generator:
......@@ -61,7 +59,6 @@ services:
- '@language_manager'
- '@entity_type.manager'
- '@path.validator'
- '@entity.query'
- '@simple_sitemap.logger'
simple_sitemap.logger:
......
......@@ -73,7 +73,7 @@ class EntityUrlGenerator extends UrlGeneratorBase implements UrlGeneratorInterfa
* @return \Drupal\Core\Entity\EntityInterface[]
*/
protected function getBatchIterationEntities(array $entity_info) {
$query = $this->entityQuery->get($entity_info['entity_type_name']);
$query = $this->entityTypeManager->getStorage($entity_info['entity_type_name'])->getQuery();
if (!empty($entity_info['keys']['id'])) {
$query->sort($entity_info['keys']['id'], 'ASC');
......
......@@ -13,7 +13,6 @@ use Drupal\simple_sitemap\SitemapGenerator;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Path\PathValidator;
use Drupal\Core\Entity\Query\QueryFactory;
/**
* Class BatchUrlGenerator
......@@ -63,13 +62,6 @@ class UrlGeneratorBase {
*/
protected $pathValidator;
/**
* @var \Drupal\Core\Entity\Query\QueryFactory
*
* @todo Move to EntityUrlGenerator
*/
protected $entityQuery;
/**
* @var \Drupal\simple_sitemap\Logger
*/
......@@ -97,7 +89,6 @@ class UrlGeneratorBase {
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\Core\Path\PathValidator $path_validator
* @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
* @param \Drupal\simple_sitemap\Logger $logger
*/
public function __construct(
......@@ -106,7 +97,6 @@ class UrlGeneratorBase {
LanguageManagerInterface $language_manager,
EntityTypeManagerInterface $entity_type_manager,
PathValidator $path_validator,
QueryFactory $entity_query,
Logger $logger
) {
$this->generator = $generator;
......@@ -116,7 +106,6 @@ class UrlGeneratorBase {
$this->defaultLanguageId = $language_manager->getDefaultLanguage()->getId();
$this->entityTypeManager = $entity_type_manager;
$this->pathValidator = $path_validator;
$this->entityQuery = $entity_query;
$this->logger = $logger;
$this->anonUser = $this->entityTypeManager->getStorage('user')
->load(self::ANONYMOUS_USER_ID);
......
......@@ -6,7 +6,6 @@ use Drupal\simple_sitemap\Form\FormHelper;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Path\PathValidator;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Config\ConfigFactory;
use Drupal\Core\Datetime\DateFormatter;
......@@ -36,11 +35,6 @@ class Simplesitemap {
*/
protected $db;
/**
* @var \Drupal\Core\Entity\Query\QueryFactory
*/
protected $entityQuery;
/**
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
......@@ -65,7 +59,6 @@ class Simplesitemap {
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
* @param \Drupal\Core\Config\ConfigFactory $configFactory
* @param \Drupal\Core\Database\Connection $database
* @param \Drupal\Core\Entity\Query\QueryFactory $entityQuery
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* @param \Drupal\Core\Path\PathValidator $pathValidator
* @param \Drupal\Core\Datetime\DateFormatter $dateFormatter
......@@ -75,7 +68,6 @@ class Simplesitemap {
EntityHelper $entityHelper,
ConfigFactory $configFactory,
Connection $database,
QueryFactory $entityQuery,
EntityTypeManagerInterface $entityTypeManager,
PathValidator $pathValidator,
DateFormatter $dateFormatter
......@@ -84,7 +76,6 @@ class Simplesitemap {
$this->entityHelper = $entityHelper;
$this->configFactory = $configFactory;
$this->db = $database;
$this->entityQuery = $entityQuery;
$this->entityTypeManager = $entityTypeManager;
$this->pathValidator = $pathValidator;
$this->dateFormatter = $dateFormatter;
......@@ -321,7 +312,7 @@ class Simplesitemap {
// Menu fix.
$keys['bundle'] = $entity_type_id == 'menu_link_content' ? 'menu_name' : $keys['bundle'];
$query = $this->entityQuery->get($entity_type_id);
$query = $this->entityTypeManager->getStorage($entity_type_id)->getQuery();
if (!$this->entityHelper->entityTypeIsAtomic($entity_type_id)) {
$query->condition($keys['bundle'], $bundle_name);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment