Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
simple_sitemap
Commits
bf4b8785
Commit
bf4b8785
authored
Aug 17, 2016
by
Pawel G
Browse files
Remove unnecessary CustomLinkGenerator class
parent
ccdc97df
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/CustomLinkGenerator.php
deleted
100644 → 0
View file @
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
;
}
}
src/SitemapGenerator.php
View file @
bf4b8785
...
@@ -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 $
d
at
a
* @return array $
p
at
hs
* 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 $
operation
s.
* @return array $
data_set
s.
*/
*/
private
function
getEntityTypeData
()
{
private
function
getEntityTypeData
()
{
$data_sets
=
[];
$data_sets
=
[];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment