removeTopic() public method

Remove a Topic from the Article.
public removeTopic ( Topic $topic ) : boolean
$topic Newscoop\NewscoopBundle\Entity\Topic the Topic to remove
return boolean
Example #1
0
 /**
  * Removes topic from the article.
  *
  * @param Topic   $topic   Topic object
  * @param Article $article Article object
  *
  * @return bool
  */
 protected function detachTopicFromArticle(Topic $topic, Article $article)
 {
     $result = $article->removeTopic($topic);
     if ($result) {
         $this->em->flush();
         $this->dispatcher->dispatch('article-topic.detach', new GenericEvent($this, $this->getLogArray($topic, $article)));
     }
     return $result;
 }