9
9
namespace Magefan \Blog \Model ;
10
10
11
11
use Magento \Framework \App \ProductMetadataInterface ;
12
- use Magefan \Blog \Model \ Sitemap \ SitepamManagent ;
12
+ use Magefan \Blog \Api \ SitemapConfigInterface ;
13
13
14
14
/**
15
15
* Deprecated
@@ -26,39 +26,40 @@ class Sitemap extends \Magento\Sitemap\Model\Sitemap
26
26
protected function _initSitemapItems ()
27
27
{
28
28
29
+
29
30
$ objectManager = \Magento \Framework \App \ObjectManager::getInstance ();
30
31
31
32
$ megento = $ objectManager ->create (ProductMetadataInterface::class);
32
- $ sitemapManagent = $ objectManager ->create (SitepamManagent ::class);
33
+ $ sitemapConfig = $ objectManager ->create (SitemapConfigInterface ::class);
33
34
34
35
35
36
parent ::_initSitemapItems ();
36
37
37
38
$ sitemapItems = [];
38
- if ($ sitemapManagent ->isEnabledSitemap ('index_page ' )) {
39
+ if ($ sitemapConfig ->isEnabledSitemap ('index_page ' )) {
39
40
$ sitemapItems [] = new \Magento \Framework \DataObject (
40
41
[
41
- 'changefreq ' => $ sitemapManagent ->getFrequency (' index_page ' ),
42
- 'priority ' => $ sitemapManagent ->getPriority (' index_page ' ),
42
+ 'changefreq ' => $ sitemapConfig ->getFrequency (SitemapConfigInterface:: HOME_PAGE ),
43
+ 'priority ' => $ sitemapConfig ->getPriority (SitemapConfigInterface:: HOME_PAGE ),
43
44
'collection ' => \Magento \Framework \App \ObjectManager::getInstance ()->create (
44
45
\Magento \Framework \Data \Collection::class
45
46
)->addItem (
46
47
\Magento \Framework \App \ObjectManager::getInstance ()->create (
47
48
\Magento \Framework \DataObject::class
48
49
)->setData ([
49
- 'updatedAt ' => '2019-20-16 ' ,
50
+ 'updated_at ' => '' ,
50
51
'url ' => '' ,
51
52
])
52
53
)
53
54
]
54
55
);
55
56
}
56
57
57
- if ($ sitemapManagent ->isEnabledSitemap ('categories_pages ' )) {
58
+ if ($ sitemapConfig ->isEnabledSitemap ('categories_pages ' )) {
58
59
$ sitemapItems [] = new \Magento \Framework \DataObject (
59
60
[
60
- 'changefreq ' => $ sitemapManagent ->getFrequency (' categories_pages ' ),
61
- 'priority ' => $ sitemapManagent ->getPriority (' categories_pages ' ),
61
+ 'changefreq ' => $ sitemapConfig ->getFrequency (SitemapConfigInterface:: CATEGORIES_PAGE ),
62
+ 'priority ' => $ sitemapConfig ->getPriority (SitemapConfigInterface:: CATEGORIES_PAGE ),
62
63
'collection ' => \Magento \Framework \App \ObjectManager::getInstance ()->create (
63
64
\Magefan \Blog \Model \Category::class
64
65
)->getCollection ($ this ->getStoreId ())
@@ -68,11 +69,11 @@ protected function _initSitemapItems()
68
69
);
69
70
}
70
71
71
- if ($ sitemapManagent ->isEnabledSitemap ('posts_pages ' )) {
72
+ if ($ sitemapConfig ->isEnabledSitemap ('posts_pages ' )) {
72
73
$ sitemapItems [] = new \Magento \Framework \DataObject (
73
74
[
74
- 'changefreq ' => $ sitemapManagent ->getFrequency (' posts_pages ' ),
75
- 'priority ' => $ sitemapManagent ->getPriority (' posts_pages ' ),
75
+ 'changefreq ' => $ sitemapConfig ->getFrequency (SitemapConfigInterface:: POSTS_PAGE ),
76
+ 'priority ' => $ sitemapConfig ->getPriority (SitemapConfigInterface:: POSTS_PAGE ),
76
77
'collection ' => \Magento \Framework \App \ObjectManager::getInstance ()->create (
77
78
\Magefan \Blog \Model \Post::class
78
79
)->getCollection ($ this ->getStoreId ())
0 commit comments