/** * * @access protected * @param \CCDNForum\ForumBundle\Entity\Post $post * @return \CCDNForum\ForumBundle\Form\Handler\PostUpdateFormHandler */ protected function getFormHandlerToEditPost(Post $post) { // If post is the very first post of the topic then use a topic handler so user can change topic title. if ($post->getTopic()->getFirstPost()->getId() == $post->getId()) { $formHandler = $this->container->get('ccdn_forum_forum.form.handler.topic_update'); } else { $formHandler = $this->container->get('ccdn_forum_forum.form.handler.post_update'); } $formHandler->setPost($post); $formHandler->setUser($this->getUser()); $formHandler->setRequest($this->getRequest()); return $formHandler; }
/** * * @access public * @param \CCDNForum\ForumBundle\Entity\Forum $forum * @param \CCDNForum\ForumBundle\Entity\Post $post * @return \CCDNForum\ForumBundle\Component\Crumbs\Factory\CrumbTrail */ public function addUserPostShow(Forum $forum, Post $post) { return $this->addUserTopicShow($forum, $post->getTopic())->add('# ' . $post->getId(), array('route' => 'ccdn_forum_user_post_show', 'params' => array('forumName' => $forum->getName(), 'postId' => $post->getId()))); }