Example #1
0
 public function groupInit()
 {
     $group = null;
     $abbr = $this->groupValues["abbr"];
     try {
         $group = $this->groupService->getSportGroupAbbr($abbr);
     } catch (Exceptions\NoResultException $ex) {
         $this->logger->addDebug($ex);
     }
     if ($group === null) {
         $this->logger->addInfo("System module initializer - Sport Group - no group with abbr {$abbr} found. New one is gonna be created.");
         $g = new SportGroup((array) $this->getGroupValues());
         $this->groupService->createSportGroup($g);
     }
 }
Example #2
0
 public function createSportGroup(ArrayHash $values)
 {
     $type = new SportGroup();
     $type->fromArray((array) $values);
     try {
         $this->sportGroupService->createSportGroup($type);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataSave($values->id, "this", $ex);
     }
     $this->redirect("default");
 }