Commit bf4b8785 authored by gbyte.co's avatar gbyte.co

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 {
/**
* Returns a batch-ready data array for custom link generation.
*
* @return array $data
* @return array $paths
* Data to be processed.
*/
private function getCustomUrlsData() {
$link_generator = new CustomLinkGenerator();
return $link_generator->getCustomPaths($this->generator->getConfig('custom'));
$paths = [];
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
* and returns an array of batch-ready data sets for entity link generation.
*
* @return array $operations.
* @return array $data_sets.
*/
private function getEntityTypeData() {
$data_sets = [];
......
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