123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * Copyright © 2016 Ihor Vansach (ihor@magefan.com). All rights reserved.
- * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
- *
- * Glory to Ukraine! Glory to the heroes!
- */
- namespace Magefan\Blog\Model;
- /**
- * Overide sitemap
- */
- class Sitemap extends \Magento\Sitemap\Model\Sitemap
- {
- /**
- * Initialize sitemap items
- *
- * @return void
- */
- protected function _initSitemapItems()
- {
- parent::_initSitemapItems();
- $this->_sitemapItems = [];
- $this->_sitemapItems[] = new \Magento\Framework\DataObject(
- [
- 'changefreq' => 'weekly',
- 'priority' => '0.25',
- 'collection' => \Magento\Framework\App\ObjectManager::getInstance()->create(
- 'Magefan\Blog\Model\Category'
- )->getCollection($this->getStoreId())
- ->addStoreFilter($this->getStoreId())
- ->addActiveFilter(),
- ]
- );
- $this->_sitemapItems[] = new \Magento\Framework\DataObject(
- [
- 'changefreq' => 'weekly',
- 'priority' => '0.25',
- 'collection' => \Magento\Framework\App\ObjectManager::getInstance()->create(
- 'Magefan\Blog\Model\Post'
- )->getCollection($this->getStoreId())
- ->addStoreFilter($this->getStoreId())
- ->addActiveFilter(),
- ]
- );
- }
- /**
- * Disable save action
- * @return sekf
- */
- public function save()
- {
- return $this;
- }
- }
|