File tree Expand file tree Collapse file tree 6 files changed +19
-32
lines changed
lib/internal/Magento/Framework/App Expand file tree Collapse file tree 6 files changed +19
-32
lines changed Original file line number Diff line number Diff line change 55 */
66namespace Magento \Framework \App ;
77
8+ use \Magento \Framework \App \FeedInterface ;
9+
810class Feed implements \Magento \Framework \App \FeedInterface
911{
1012 /**
@@ -26,9 +28,9 @@ public function __construct(\Zend_Feed_Abstract $feed)
2628 * @return string
2729 */
2830 public function getFormatedContentAs (
29- $ format = FeedOutputFormatsInterface ::DEFAULT_FORMAT
31+ $ format = FeedInterface ::DEFAULT_FORMAT
3032 ) {
31- if ($ format === FeedOutputFormatsInterface ::DEFAULT_FORMAT ) {
33+ if ($ format === FeedInterface ::DEFAULT_FORMAT ) {
3234 return $ this ->feed ->saveXml ();
3335 }
3436 throw new \Magento \Framework \Exception \RuntimeException (
Original file line number Diff line number Diff line change 66namespace Magento \Framework \App ;
77
88use Magento \Framework \App \FeedFactory ;
9+ use Magento \Framework \App \FeedFactoryInterface ;
910use Psr \Log \LoggerInterface ;
1011
1112/**
1213 * Feed factory
1314 */
14- class FeedFactory implements \ Magento \ Framework \ App \ FeedFactoryInterface
15+ class FeedFactory implements FeedFactoryInterface
1516{
1617 /**
1718 * @var \Zend_Feed
@@ -38,18 +39,20 @@ public function __construct(
3839 /**
3940 * Get a new \Magento\Framework\App\Feed object from a custom array
4041 *
41- * @throws \Magento\Framework\Exception\RuntimeException
42+ * @throws \Magento\Framework\Exception\InputException
4243 * @param array $data
4344 * @param string $format
4445 * @return \Magento\Framework\App\FeedInterface
4546 */
46- public function importArray (array $ data , $ format = FeedFormatsInterface::DEFAULT_FORMAT )
47- {
47+ public function create (
48+ array $ data ,
49+ $ format = FeedFactoryInterface::DEFAULT_FORMAT
50+ ) {
4851 try {
4952 return $ this ->feedProcessor ->importArray ($ data , $ format );
5053 } catch (\Zend_Feed_Exception $ e ) {
5154 $ this ->logger ->error ($ e ->getMessage ());
52- throw new \Magento \Framework \Exception \RuntimeException (
55+ throw new \Magento \Framework \Exception \InputException (
5356 __ ('There has been an error with import ' ),
5457 $ e
5558 );
Original file line number Diff line number Diff line change 88interface FeedFactoryInterface
99{
1010
11+ const DEFAULT_FORMAT = 'rss ' ;
12+
1113 /**
1214 * Returns FeedInterface object from a custom array
1315 *
@@ -16,8 +18,8 @@ interface FeedFactoryInterface
1618 * @param string $format
1719 * @return FeedInterface
1820 */
19- public function importArray (
21+ public function create (
2022 array $ data ,
21- $ format = FeedFormatsInterface ::DEFAULT_FORMAT
23+ $ format = self ::DEFAULT_FORMAT
2224 );
2325}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 77
88interface FeedInterface
99{
10+ const DEFAULT_FORMAT = 'xml ' ;
11+
1012 /**
1113 * @return string
1214 */
1315 public function getFormatedContentAs (
14- $ format = FeedOutputFormatsInterface ::DEFAULT_FORMAT
16+ $ format = self ::DEFAULT_FORMAT
1517 );
1618}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments