@@ -25,12 +25,12 @@ class Dashboard extends Template
2525 /**
2626 * Holds the blog feed url
2727 */
28- const BLOG_FEED_URL = ' http://www.magenerds.com/category/magento-2/feed/ ' ;
28+ const BLOG_FEED_URL = null ; # http://www.magenerds.com/category/magento-2/feed/
2929
3030 /**
3131 * Holds the news feed url
3232 */
33- const NEWS_FEED_URL = ' http://www.magenerds.com/category/dashboardnews/feed/ ' ;
33+ const NEWS_FEED_URL = null ; # http://www.magenerds.com/category/dashboardnews/feed/
3434
3535 /**
3636 * Holds the number of blog feeds
@@ -62,18 +62,21 @@ protected function getReader()
6262 public function getBlogFeeds ()
6363 {
6464 $ feeds = [];
65+ if (!static ::BLOG_FEED_URL ) {
66+ return $ feeds ;
67+ }
6568 $ reader = $ this ->getReader ();
6669
6770 $ ctr = 1 ;
6871 try {
69- foreach ($ reader ->import (self ::BLOG_FEED_URL ) as $ feed ) {
72+ foreach ($ reader ->import (static ::BLOG_FEED_URL ) as $ feed ) {
7073 $ feeds [] = [
7174 'link ' => $ feed ->getLink (),
7275 'title ' => $ feed ->getTitle (),
7376 'date ' => substr ($ feed ->getDateCreated (), 0 , 10 ),
74- 'description ' => $ feed ->getDescription ()
77+ 'description ' => $ feed ->getDescription (),
7578 ];
76- if ($ ctr == self ::NUMBER_BLOG_FEEDS ) {
79+ if ($ ctr == static ::NUMBER_BLOG_FEEDS ) {
7780 break ;
7881 }
7982 $ ctr ++;
@@ -93,18 +96,21 @@ public function getBlogFeeds()
9396 public function getNewsFeeds ()
9497 {
9598 $ feeds = [];
99+ if (!static ::NEWS_FEED_URL ) {
100+ return $ feeds ;
101+ }
96102 $ reader = $ this ->getReader ();
97103
98104 $ ctr = 1 ;
99105 try {
100- foreach ($ reader ->import (self ::NEWS_FEED_URL ) as $ feed ) {
106+ foreach ($ reader ->import (static ::NEWS_FEED_URL ) as $ feed ) {
101107 $ feeds [] = [
102108 'link ' => $ feed ->getLink (),
103109 'title ' => $ feed ->getTitle (),
104110 'date ' => substr ($ feed ->getDateCreated (), 0 , 10 ),
105- 'content ' => $ feed ->getContent ()
111+ 'content ' => $ feed ->getContent (),
106112 ];
107- if ($ ctr == self ::NUMBER_NEWS_FEEDS ) {
113+ if ($ ctr == static ::NUMBER_NEWS_FEEDS ) {
108114 break ;
109115 }
110116 $ ctr ++;
0 commit comments