protected function attachTopicToArticle(Topic $topic, Article $article) { $result = $article->addTopic($topic); if ($result) { $this->em->flush(); $this->dispatcher->dispatch('article-topic.attach', new GenericEvent($this, $this->getLogArray($topic, $article))); } return $result; }