/** * * @access protected * @param \Map2u\ForumBundle\Entity\Post $post */ protected function onSuccess(Post $post) { $post->setCreatedDate(new \DateTime()); $post->setCreatedBy($this->user); $post->setTopic($this->topic); $post->setDeleted(false); $this->dispatcher->dispatch(ForumEvents::USER_TOPIC_REPLY_SUCCESS, new UserTopicEvent($this->request, $post->getTopic())); $this->postModel->savePost($post); $this->dispatcher->dispatch(ForumEvents::USER_TOPIC_REPLY_COMPLETE, new UserTopicEvent($this->request, $this->topic, $this->didAuthorSubscribe())); }