/** @return void */ public function renderDetail($articleId) { $articleCategories = $this->article->getAllCategories(); $articleComments = $this->article->getAllComments(); $this->template->article = $this->article; $this->template->articleCategories = $articleCategories; $this->template->articleComments = $articleComments; }
/** @return void */ public function renderDetail($articleId) { $articleCategories = $this->article->getAllCategories(); $articleNotCategories = $this->articles->getNotCategories($this->article, $this->categories->findAll()); $articleComments = $this->article->getAllComments(); $this->template->article = $this->article; $this->template->articleCategories = $articleCategories; $this->template->articleComments = $articleComments; $this->template->articleNotCategories = $articleNotCategories; }
/** * @param Article $article */ public function getNotCategories(Article $article, EntityCollection $categories) { /** @var array() $result */ $results = $categories->toArray(); foreach ($results as $key => $result) { foreach ($article->getAllCategories() as $articleCategory) { if ($articleCategory->getID() == $result->getId()) { unset($results[$key]); } } } return $results; }