Feed.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Copyright © 2016 Ihor Vansach (ihor@magefan.com). All rights reserved.
  4. * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
  5. *
  6. * Glory to Ukraine! Glory to the heroes!
  7. */
  8. namespace Magefan\Blog\Block\Rss;
  9. use Magento\Store\Model\ScopeInterface;
  10. /**
  11. * Blog ree feed block
  12. */
  13. class Feed extends \Magefan\Blog\Block\Post\PostList\AbstractList
  14. {
  15. /**
  16. * Retrieve rss feed url
  17. * @return string
  18. */
  19. public function getLink()
  20. {
  21. return $this->_url->getUrl('feed', 'rss');
  22. }
  23. /**
  24. * Retrieve rss feed title
  25. * @return string
  26. */
  27. public function getTitle()
  28. {
  29. return $this->_scopeConfig->getValue('mfblog/rss_feed/title', ScopeInterface::SCOPE_STORE);
  30. }
  31. /**
  32. * Retrieve rss feed description
  33. * @return string
  34. */
  35. public function getDescription()
  36. {
  37. return $this->_scopeConfig->getValue('mfblog/rss_feed/description', ScopeInterface::SCOPE_STORE);
  38. }
  39. /**
  40. * Retrieve block identities
  41. * @return array
  42. */
  43. public function getIdentities()
  44. {
  45. return [\Magento\Cms\Model\Page::CACHE_TAG . '_blog_rss_feed' ];
  46. }
  47. }