Commit 250f4b1c authored by gbyte.co's avatar gbyte.co

Clean up

parent 6d0ba743
......@@ -109,7 +109,7 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
}
/**
* @param $sitemap_variant
* @param string $sitemap_variant
* @return $this
*/
public function setSitemapVariant($sitemap_variant) {
......@@ -141,8 +141,7 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
}
/**
* Returns the sitemap index for all sitemap chunks of this type.
*
* @param array $chunk_info
* @return string
*/
protected function getIndexXml(array $chunk_info) {
......@@ -214,12 +213,9 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
}
/**
* Takes links along with their options and then generates and saves the
* sitemap.
*
* @param array $links
* All links with their multilingual versions and settings.
*
* @return $this
* @throws \Exception
*/
public function generate(array $links) {
$highest_id = $this->db->query('SELECT MAX(id) FROM {simple_sitemap}')->fetchField();
......@@ -239,6 +235,7 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
}
/**
* @return $this
* @throws \Exception
*/
public function generateIndex() {
......@@ -269,6 +266,9 @@ abstract class SitemapGeneratorBase extends SimplesitemapPluginBase implements S
return $this;
}
/**
* @return $this
*/
public function publish() {
$unpublished_chunk = $this->db->query('SELECT MAX(id) FROM {simple_sitemap} WHERE type = :type AND status = :status', [':type' => $this->sitemapVariant, ':status' => 0])
->fetchField();
......
......@@ -2,11 +2,8 @@
namespace Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator;
use Drupal\simple_sitemap\EntityHelper;
use Drupal\simple_sitemap\Logger;
use Drupal\simple_sitemap\Simplesitemap;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandler;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -30,23 +27,15 @@ class ArbitraryUrlGenerator extends UrlGeneratorBase {
* @param $plugin_id
* @param $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
* @param \Drupal\Core\Extension\ModuleHandler $module_handler
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
Simplesitemap $generator,
LanguageManagerInterface $language_manager,
EntityTypeManagerInterface $entity_type_manager,
Logger $logger,
EntityHelper $entityHelper,
ModuleHandler $module_handler
) {
parent::__construct(
......@@ -54,10 +43,7 @@ class ArbitraryUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$generator,
$language_manager,
$entity_type_manager,
$logger,
$entityHelper
$logger
);
$this->moduleHandler = $module_handler;
}
......@@ -72,10 +58,7 @@ class ArbitraryUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$container->get('simple_sitemap.generator'),
$container->get('language_manager'),
$container->get('entity_type.manager'),
$container->get('simple_sitemap.logger'),
$container->get('simple_sitemap.entity_helper'),
$container->get('module_handler')
);
}
......
......@@ -23,7 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* )
*
*/
class CustomUrlGenerator extends UrlGeneratorBase {
class CustomUrlGenerator extends EntityUrlGeneratorBase {
const PATH_DOES_NOT_EXIST_MESSAGE = 'The custom path @path has been omitted from the XML sitemaps as it does not exist. You can review custom paths <a href="@custom_paths_url">here</a>.';
......@@ -44,22 +44,20 @@ class CustomUrlGenerator extends UrlGeneratorBase {
* @param $plugin_id
* @param $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
* @param \Drupal\Core\Path\PathValidator $path_validator
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
Simplesitemap $generator,
Logger $logger,
LanguageManagerInterface $language_manager,
EntityTypeManagerInterface $entity_type_manager,
Logger $logger,
EntityHelper $entityHelper,
PathValidator $path_validator) {
parent::__construct(
......@@ -67,9 +65,9 @@ class CustomUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$generator,
$logger,
$language_manager,
$entity_type_manager,
$logger,
$entityHelper
);
$this->pathValidator = $path_validator;
......@@ -85,9 +83,9 @@ class CustomUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$container->get('simple_sitemap.generator'),
$container->get('simple_sitemap.logger'),
$container->get('language_manager'),
$container->get('entity_type.manager'),
$container->get('simple_sitemap.logger'),
$container->get('simple_sitemap.entity_helper'),
$container->get('path.validator')
);
......
......@@ -27,7 +27,7 @@ use Drupal\Core\Menu\MenuLinkBase;
*
* @todo Find way of adding just a menu link item pointer to the queue instead of whole object.
*/
class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
class EntityMenuLinkContentUrlGenerator extends EntityUrlGeneratorBase {
/**
* @var \Drupal\Core\Menu\MenuLinkTree
......@@ -40,9 +40,9 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
* @param $plugin_id
* @param $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
* @param \Drupal\Core\Menu\MenuLinkTree $menu_link_tree
*/
......@@ -51,9 +51,9 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
Simplesitemap $generator,
Logger $logger,
LanguageManagerInterface $language_manager,
EntityTypeManagerInterface $entity_type_manager,
Logger $logger,
EntityHelper $entityHelper,
MenuLinkTree $menu_link_tree
) {
......@@ -62,9 +62,9 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$generator,
$logger,
$language_manager,
$entity_type_manager,
$logger,
$entityHelper
);
$this->menuLinkTree = $menu_link_tree;
......@@ -80,9 +80,9 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$container->get('simple_sitemap.generator'),
$container->get('simple_sitemap.logger'),
$container->get('language_manager'),
$container->get('entity_type.manager'),
$container->get('simple_sitemap.logger'),
$container->get('simple_sitemap.entity_helper'),
$container->get('menu.link_tree')
);
......
......@@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* description = @Translation("Generates URLs for entity bundles and bundle overrides."),
* )
*/
class EntityUrlGenerator extends UrlGeneratorBase {
class EntityUrlGenerator extends EntityUrlGeneratorBase {
/**
* @var \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorManager
......@@ -32,9 +32,9 @@ class EntityUrlGenerator extends UrlGeneratorBase {
* @param $plugin_id
* @param $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
* @param \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorManager $url_generator_manager
*/
......@@ -43,9 +43,9 @@ class EntityUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
Simplesitemap $generator,
Logger $logger,
LanguageManagerInterface $language_manager,
EntityTypeManagerInterface $entity_type_manager,
Logger $logger,
EntityHelper $entityHelper,
UrlGeneratorManager $url_generator_manager
) {
......@@ -54,9 +54,9 @@ class EntityUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$generator,
$logger,
$language_manager,
$entity_type_manager,
$logger,
$entityHelper
);
$this->urlGeneratorManager = $url_generator_manager;
......@@ -72,9 +72,9 @@ class EntityUrlGenerator extends UrlGeneratorBase {
$plugin_id,
$plugin_definition,
$container->get('simple_sitemap.generator'),
$container->get('simple_sitemap.logger'),
$container->get('language_manager'),
$container->get('entity_type.manager'),
$container->get('simple_sitemap.logger'),
$container->get('simple_sitemap.entity_helper'),
$container->get('plugin.manager.simple_sitemap.url_generator')
);
......@@ -91,9 +91,8 @@ class EntityUrlGenerator extends UrlGeneratorBase {
if (isset($sitemap_entity_types[$entity_type_name])) {
// Skip this entity type if another plugin is written to override its generation.
// todo needs to be adjusted for variants
foreach ($this->urlGeneratorManager->getDefinitions() as $plugin) {
if (!empty($plugin['settings']['overrides_entity_type'])
if (isset($plugin['settings']['overrides_entity_type'])
&& $plugin['settings']['overrides_entity_type'] === $entity_type_name) {
continue 2;
}
......
<?php
namespace Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Url;
use Drupal\simple_sitemap\EntityHelper;
use Drupal\simple_sitemap\Logger;
use Drupal\simple_sitemap\Simplesitemap;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Session\AnonymousUserSession;
/**
* Class EntityUrlGeneratorBase
* @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator
*/
abstract class EntityUrlGeneratorBase extends UrlGeneratorBase {
/**
* @var \Drupal\Core\Language\LanguageInterface[]
*/
protected $languages;
/**
* @var string
*/
protected $defaultLanguageId;
/**
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* @var \Drupal\Core\Entity\EntityInterface|null
*/
protected $anonUser;
/**
* @var \Drupal\simple_sitemap\EntityHelper
*/
protected $entityHelper;
/**
* UrlGeneratorBase constructor.
* @param array $configuration
* @param $plugin_id
* @param $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
Simplesitemap $generator,
Logger $logger,
LanguageManagerInterface $language_manager,
EntityTypeManagerInterface $entity_type_manager,
EntityHelper $entityHelper
) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $generator, $logger);
$this->languages = $language_manager->getLanguages();
$this->defaultLanguageId = $language_manager->getDefaultLanguage()->getId();
$this->entityTypeManager = $entity_type_manager;
$this->anonUser = new AnonymousUserSession();
$this->entityHelper = $entityHelper;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('simple_sitemap.generator'),
$container->get('simple_sitemap.logger'),
$container->get('language_manager'),
$container->get('entity_type.manager'),
$container->get('simple_sitemap.entity_helper')
);
}
/**
* @param array $path_data
* @param \Drupal\Core\Url $url_object
* @return array
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
protected function getUrlVariants(array $path_data, Url $url_object) {
$url_variants = [];
if (!$url_object->isRouted()) {
// Not a routed URL, including only default variant.
$alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object);
}
elseif ($this->settings['skip_untranslated']
&& ($entity = $this->entityHelper->getEntityFromUrlObject($url_object)) instanceof ContentEntityBase) {
/** @var ContentEntityBase $entity */
$translation_languages = $entity->getTranslationLanguages();
if (isset($translation_languages[Language::LANGCODE_NOT_SPECIFIED])
|| isset($translation_languages[Language::LANGCODE_NOT_APPLICABLE])) {
// Content entity's language is unknown, including only default variant.
$alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object);
}
else {
// Including only translated variants of content entity.
$alternate_urls = $this->getAlternateUrlsForTranslatedLanguages($entity, $url_object);
}
}
else {
// Not a content entity or including all untranslated variants.
$alternate_urls = $this->getAlternateUrlsForAllLanguages($url_object);
}
foreach ($alternate_urls as $langcode => $url) {
$url_variants[] = $path_data + [
'langcode' => $langcode,
'url' => $url,
'alternate_urls' => $alternate_urls
];
}
return $url_variants;
}
/**
* @param \Drupal\Core\Url $url_object
* @return array
*/
protected function getAlternateUrlsForDefaultLanguage(Url $url_object) {
$alternate_urls = [];
if ($url_object->access($this->anonUser)) {
$alternate_urls[$this->defaultLanguageId] = $this->replaceBaseUrlWithCustom($url_object
->setOption('language', $this->languages[$this->defaultLanguageId])->toString()
);
}
return $alternate_urls;
}
/**
* @param \Drupal\Core\Entity\ContentEntityBase $entity
* @param \Drupal\Core\Url $url_object
* @return array
*/
protected function getAlternateUrlsForTranslatedLanguages(ContentEntityBase $entity, Url $url_object) {
$alternate_urls = [];
/** @var Language $language */
foreach ($entity->getTranslationLanguages() as $language) {
if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) {
if ($entity->getTranslation($language->getId())->access('view', $this->anonUser)) {
$alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object
->setOption('language', $language)->toString()
);
}
}
}
return $alternate_urls;
}
/**
* @param \Drupal\Core\Url $url_object
* @return array
*/
protected function getAlternateUrlsForAllLanguages(Url $url_object) {
$alternate_urls = [];
if ($url_object->access($this->anonUser)) {
foreach ($this->languages as $language) {
if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) {
$alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object
->setOption('language', $language)->toString()
);
}
}
}
return $alternate_urls;
}
/**
* @param mixed $data_set
* @return array
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
public function generate($data_set) {
$path_data = $this->processDataSet($data_set);
if (isset($path_data['url']) && $path_data['url'] instanceof Url) {
$url_object = $path_data['url'];
unset($path_data['url']);
return $this->getUrlVariants($path_data, $url_object);
}
else {
return FALSE !== $path_data ? [$path_data] : [];
}
}
/**
* @param string $entity_type_name
* @param string $entity_id
* @return array
*/
protected function getImages($entity_type_name, $entity_id) {
$images = [];
foreach ($this->entityHelper->getEntityImageUrls($entity_type_name, $entity_id) as $url) {
$images[]['path'] = $this->replaceBaseUrlWithCustom($url);
}
return $images;
}
}
......@@ -4,15 +4,8 @@ namespace Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator;
use Drupal\simple_sitemap\Plugin\simple_sitemap\SimplesitemapPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Url;
use Drupal\simple_sitemap\EntityHelper;
use Drupal\simple_sitemap\Logger;
use Drupal\simple_sitemap\Simplesitemap;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Session\AnonymousUserSession;
/**
* Class UrlGeneratorBase
......@@ -25,41 +18,16 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
*/
protected $generator;
/**
* @var \Drupal\Core\Language\LanguageInterface[]
*/
protected $languages;
/**
* @var string
*/
protected $defaultLanguageId;
/**
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* @var \Drupal\simple_sitemap\Logger
*/
protected $logger;
/**
* @var \Drupal\Core\Entity\EntityInterface|null
*/
protected $anonUser;
/**
* @var array
*/
protected $settings;
/**
* @var \Drupal\simple_sitemap\EntityHelper
*/
protected $entityHelper;
/**
* @var string
*/
......@@ -71,29 +39,18 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
* @param $plugin_id
* @param $plugin_definition
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\simple_sitemap\Logger $logger
* @param \Drupal\simple_sitemap\EntityHelper $entityHelper
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
Simplesitemap $generator,
LanguageManagerInterface $language_manager,
EntityTypeManagerInterface $entity_type_manager,
Logger $logger,
EntityHelper $entityHelper
Logger $logger
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->generator = $generator;
$this->languages = $language_manager->getLanguages();
$this->defaultLanguageId = $language_manager->getDefaultLanguage()->getId();
$this->entityTypeManager = $entity_type_manager;
$this->anonUser = new AnonymousUserSession();
$this->logger = $logger;
$this->entityHelper = $entityHelper;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
......@@ -102,10 +59,7 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
$plugin_id,
$plugin_definition,
$container->get('simple_sitemap.generator'),
$container->get('language_manager'),
$container->get('entity_type.manager'),
$container->get('simple_sitemap.logger'),
$container->get('simple_sitemap.entity_helper')
$container->get('simple_sitemap.logger')
);
}
......@@ -127,90 +81,6 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
return $this;
}
/**
* @param array $path_data
* @param \Drupal\Core\Url $url_object
* @return array
*/
protected function getUrlVariants(array $path_data, Url $url_object) {
$url_variants = [];
if (!$url_object->isRouted()) {
// Not a routed URL, including only default variant.
$alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object);
}
elseif ($this->settings['skip_untranslated']
&& ($entity = $this->entityHelper->getEntityFromUrlObject($url_object)) instanceof ContentEntityBase) {
/** @var ContentEntityBase $entity */
$translation_languages = $entity->getTranslationLanguages();
if (isset($translation_languages[Language::LANGCODE_NOT_SPECIFIED])
|| isset($translation_languages[Language::LANGCODE_NOT_APPLICABLE])) {
// Content entity's language is unknown, including only default variant.
$alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object);
}
else {
// Including only translated variants of content entity.
$alternate_urls = $this->getAlternateUrlsForTranslatedLanguages($entity, $url_object);
}
}
else {
// Not a content entity or including all untranslated variants.
$alternate_urls = $this->getAlternateUrlsForAllLanguages($url_object);
}
foreach ($alternate_urls as $langcode => $url) {
$url_variants[] = $path_data + [
'langcode' => $langcode,
'url' => $url,
'alternate_urls' => $alternate_urls
];
}
return $url_variants;
}
protected function getAlternateUrlsForDefaultLanguage(Url $url_object) {
$alternate_urls = [];
if ($url_object->access($this->anonUser)) {
$alternate_urls[$this->defaultLanguageId] = $this->replaceBaseUrlWithCustom($url_object
->setOption('language', $this->languages[$this->defaultLanguageId])->toString()
);
}
return $alternate_urls;
}
protected function getAlternateUrlsForTranslatedLanguages(ContentEntityBase $entity, Url $url_object) {
$alternate_urls = [];
/** @var Language $language */
foreach ($entity->getTranslationLanguages() as $language) {
if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) {
if ($entity->getTranslation($language->getId())->access('view', $this->anonUser)) {
$alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object
->setOption('language', $language)->toString()
);
}
}
}
return $alternate_urls;
}
protected function getAlternateUrlsForAllLanguages(Url $url_object) {
$alternate_urls = [];
if ($url_object->access($this->anonUser)) {
foreach ($this->languages as $language) {
if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) {
$alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object
->setOption('language', $language)->toString()
);
}
}
}
return $alternate_urls;
}
/**
* @param string $url
* @return string
......@@ -228,7 +98,7 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
/**
* @param $data_set
* @return array
* @return mixed
*/
abstract protected function processDataSet($data_set);
......@@ -238,31 +108,6 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
*/
public function generate($data_set) {
$path_data = $this->processDataSet($data_set);
if (!$path_data) {
return [];
}
if (isset($path_data['url']) && $path_data['url'] instanceof Url) {
$url_object = $path_data['url'];
unset($path_data['url']);
return $this->getUrlVariants($path_data, $url_object);
}
else {
return [$path_data];
}
}
/**
* @param $entity_type_name
* @param $entity_id
* @return array
*
* @todo
*/
protected function getImages($entity_type_name, $entity_id) {