Commit bf4b8785 authored by Pawel G's avatar Pawel G
Browse files

Remove unnecessary CustomLinkGenerator class

parent ccdc97df
<?php
namespace Drupal\simple_sitemap;
/**
* CustomLinkGenerator class.
*/
class CustomLinkGenerator {
/**
* Returns an array of all urls of the custom paths.
*
* @param array $custom_paths
*
* @return array $urls
*
*/
public function getCustomPaths($custom_paths) {
$paths = [];
foreach($custom_paths as $i => $custom_path) {
$paths[$i]['path'] = $custom_path['path'];
$paths[$i]['priority'] = isset($custom_path['priority']) ? $custom_path['priority'] : NULL;
$paths[$i]['lastmod'] = NULL; //todo: implement lastmod
}
return $paths;
}
}
...@@ -58,19 +58,24 @@ class SitemapGenerator { ...@@ -58,19 +58,24 @@ class SitemapGenerator {
/** /**
* Returns a batch-ready data array for custom link generation. * Returns a batch-ready data array for custom link generation.
* *
* @return array $data * @return array $paths
* Data to be processed. * Data to be processed.
*/ */
private function getCustomUrlsData() { private function getCustomUrlsData() {
$link_generator = new CustomLinkGenerator(); $paths = [];
return $link_generator->getCustomPaths($this->generator->getConfig('custom')); foreach($this->generator->getConfig('custom') as $i => $custom_path) {
$paths[$i]['path'] = $custom_path['path'];
$paths[$i]['priority'] = isset($custom_path['priority']) ? $custom_path['priority'] : NULL;
$paths[$i]['lastmod'] = NULL; //todo: implement lastmod
}
return $paths;
} }
/** /**
* Collects entity metadata for entities that are set to be indexed * Collects entity metadata for entities that are set to be indexed
* and returns an array of batch-ready data sets for entity link generation. * and returns an array of batch-ready data sets for entity link generation.
* *
* @return array $operations. * @return array $data_sets.
*/ */
private function getEntityTypeData() { private function getEntityTypeData() {
$data_sets = []; $data_sets = [];
......
Supports Markdown
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