Feed.php 677 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Framework\App;
  8. use Zend\Feed\Writer\FeedFactory;
  9. /**
  10. * Default XML feed class
  11. */
  12. class Feed implements FeedInterface
  13. {
  14. /**
  15. * @var array
  16. */
  17. private $feeds;
  18. /**
  19. * Feed constructor.
  20. * @param array $data
  21. */
  22. public function __construct(array $data)
  23. {
  24. $this->feeds = $data;
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function getFormattedContent() : string
  30. {
  31. return FeedFactory::factory($this->feeds)->export(FeedFactoryInterface::FORMAT_RSS);
  32. }
  33. }