Пример #1
0
 public function createForum(ArrayHash $values)
 {
     try {
         $f = new Forum((array) $values);
         $f->setEditor($this->getUser()->getIdentity());
         $this->forumService->createForum($f);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataSave(null, "this", $ex);
     }
     $this->redirect("default");
 }
Пример #2
0
 private function sportGroupsTypeHandle(Forum $e)
 {
     if ($e === null) {
         throw new Exceptions\NullPointerException("Argument event was null");
     }
     try {
         $coll = new ArrayCollection();
         foreach ($e->getGroups() as $eg) {
             $dbG = $this->sportGroupService->getSportGroup($eg, false);
             if ($dbG !== null) {
                 $coll->add($dbG);
             }
         }
         $e->setGroups($coll);
     } catch (\Exception $ex) {
         $this->logError($ex->getMessage());
         throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     }
     return $e;
 }