/** * @Secured(resource="showThread") */ public function actionShowThread($id, $abbr) { $thread = $sg = null; try { if (is_numeric($abbr)) { $sg = $this->sportGroupService->getSportGroup($abbr); } elseif (is_string($abbr)) { $sg = $this->sportGroupService->getSportGroupAbbr($abbr); } if (is_numeric($id)) { $thread = $this->forumService->getForumThread($id); } elseif (is_string($id)) { $thread = $this->forumService->getForumThreadAlias($id); } } catch (Exceptions\DataErrorException $ex) { $this->handleDataLoad($id, "default", $ex); } $type = $sg->getSportType(); if ($type !== null) { $type = " ({$type->getName()})"; } else { $type = ""; } $groupLabel = $sg->getName() . $type; $this->template->groupLabel = $groupLabel; $this->template->abbr = $sg->getAbbr(); $forum = $thread->getForum(); $this->template->forumTitle = $forum->getTitle(); $this->template->forumAlias = $forum->getAlias(); $this->template->thread = $thread; $this->setEntity($thread); }
/** * @Secured(resource="updateForumThread") */ public function actionUpdateForumThread($id) { if (!is_numeric($id)) { $this->handleBadArgument($id); } try { $fDb = $this->forumService->getForumThread($id); if ($fDb !== null) { $form = $this->getComponent("updateForumThreadForm"); $form->setDefaults($fDb->toArray()); $this->template->title = $fDb->getTitle(); } } catch (Exceptions\DataErrorException $ex) { $this->handleDataLoad($id, "default", $ex); } }