示例#1
0
 /**
  * Action for displaying detail of wallpost
  * @Secured(resource="showWallpost")
  */
 public function actionShowWallPost($id, $abbr = self::ROOT_GROUP)
 {
     if (!is_numeric($id)) {
         $this->handleBadArgument($id);
     }
     $sg = null;
     $wp = [];
     try {
         if (is_string($abbr)) {
             $sg = $this->sportGroupService->getSportGroupAbbr($abbr);
         } elseif (is_numeric($abbr)) {
             $sg = $this->sportGroupService->getSportGroup($abbr);
         }
         $wp = $this->wallService->getWallPost($id);
         if ($wp !== null) {
             $this->setEntity($wp);
         }
         $type = $sg->getSportType();
         if ($type !== null) {
             $type = " ({$type->getName()})";
         } else {
             $type = "";
         }
         $this->template->groupLabel = $sg->getName() . $type;
         $this->template->data = $wp;
         $this->template->abbr = $abbr;
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataLoad($id, "default", $ex);
     }
 }
示例#2
0
 private function doDeleteWallPost($id)
 {
     try {
         $wpDb = $this->wallService->getWallPost($id);
         if ($wpDb !== null) {
             $this->wallService->removeWallPost($wpDb->getId());
         }
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataDelete($id, "this", $ex);
     }
 }