Example #1
0
 private function forumTypeHandle(ForumThread $t)
 {
     try {
         $forum = null;
         $id = $this->getMixId($t->getForum());
         if ($id !== null) {
             $forum = $this->forumDao->find($id);
         }
         $t->setForum($forum);
     } catch (\Exception $ex) {
         $this->logError($ex->getMessage());
         throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     }
 }
Example #2
0
 private function createForumThread(ArrayHash $values)
 {
     $thread = new ForumThread((array) $values);
     try {
         $thread->setAuthor($this->getUser()->getIdentity());
         $thread->setCommentMode(CommentMode::ALLOWED);
         $this->forumService->createForumThread($thread);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataSave(null, "this", $ex);
     }
     $abbr = $this->getParameter("abbr");
     $this->redirect("showThread", [$thread->getAlias(), $abbr]);
 }
Example #3
0
 public function createForumThread(ArrayHash $values)
 {
     try {
         $f = new ForumThread((array) $values);
         $f->setAuthor($this->getUser()->getIdentity());
         $this->forumService->createForumThread($f);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataSave(null, "this", $ex);
     }
     $this->redirect("default");
 }