/**
  *
  * @access public
  * @return \Symfony\Component\Form\Form
  */
 public function getForm()
 {
     if (null == $this->form) {
         // Store the old board before proceeding, as we will need it to update its stats
         // as it will be a topic down in its count at least, posts perhaps even more so.
         $this->oldBoard = $this->topic->getBoard();
         // Boards are pre-filtered for proper rights managements, moderators may move Topics,
         // but some boards may only be accessible by admins, so moderators should not see them.
         $filteredBoards = $this->boardModel->findAllBoardsForForumById($this->forum->getId());
         $options = array('boards' => $filteredBoards);
         $this->dispatcher->dispatch(ForumEvents::MODERATOR_TOPIC_CHANGE_BOARD_INITIALISE, new ModeratorTopicEvent($this->request, $this->topic));
         $this->form = $this->factory->create($this->formTopicChangeBoardType, $this->topic, $options);
     }
     return $this->form;
 }
 /**
  *
  * @access public
  * @return \Symfony\Component\Form\Form
  */
 public function getForm()
 {
     if (null == $this->form) {
         if (!is_object($this->board) || !$this->board instanceof Board) {
             throw new \Exception('Board must be specified to be create a Topic in TopicCreateFormHandler');
         }
         $filteredBoards = $this->boardModel->findAllBoardsForForumById($this->forum->getId());
         $topicOptions = array('boards' => $filteredBoards, 'auto_initialize' => false);
         $topic = $this->topicModel->createTopic();
         $topic->setBoard($this->board);
         $post = $this->postModel->createPost();
         $post->setTopic($topic);
         $post->setCreatedBy($this->user);
         $this->dispatcher->dispatch(ForumEvents::USER_TOPIC_CREATE_INITIALISE, new UserTopicEvent($this->request, $post->getTopic()));
         $this->form = $this->factory->create($this->formPostType, $post);
         $this->form->add($this->factory->create($this->formTopicType, $topic, $topicOptions));
     }
     return $this->form;
 }