Example #1
0
 /**
  * @access public
  * @param \Magento\Catalog\Model\Category $category
  * @return mixed
  */
 public function getSelectedArticles(CategoryModel $category)
 {
     if (!$category->hasSelectedArticles()) {
         $articles = [];
         foreach ($this->getSelectedArticlesCollection($category) as $article) {
             $articles[] = $article;
         }
         $category->setSelectedArticles($articles);
     }
     return $category->getData('selected_articles');
 }