コード例 #1
3
 /**
  * Return a similar articles by category
  * @param Article $article
  * @return Article array
  */
 public function getSimilarArticlesByCategory(Article $article)
 {
     $category = $article->getCategory();
     $similarArticles = $this->articleRepository->findBy(array('category' => $category), array('date' => 'ASC'), 3);
     unset($similarArticles[array_search($article, $similarArticles)]);
     return $similarArticles;
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 public function getCategory()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getCategory', array());
     return parent::getCategory();
 }