예제 #1
0
 /**
  * @return \Gemtoo\Blog\Model\ResourceModel\Article\Collection
  */
 public function getArticleCollection()
 {
     if (is_null($this->articleCollection)) {
         $this->articleCollection = $this->categoryModel->getSelectedArticlesCollection($this->getCategory())->addStoreFilter($this->_storeManager->getStore()->getId())->addFieldToFilter('is_active', 1);
         //TODO: use constant here
         $this->articleCollection->getSelect()->order('related_category.position');
     }
     return $this->articleCollection;
 }
예제 #2
0
파일: Article.php 프로젝트: pleminh/Gemtoo
 /**
  * @access public
  * @return array
  */
 public function getSelectedArticles()
 {
     $articles = array();
     $selected = $this->articleCategory->getSelectedArticles($this->getCategory());
     if (!is_array($selected)) {
         $selected = array();
     }
     foreach ($selected as $article) {
         /** @var \Gemtoo\Blog\Model\Article $article */
         $articles[$article->getId()] = $article->getPosition();
     }
     return $articles;
 }