Пример #1
0
 public function getGroup($groupId)
 {
     try {
         $group = Group::getById($groupId);
         if (is_null($group)) {
             throw new \Exception("Group " . $groupId . " does not exist");
         }
         $this->getApp()->render(200, ['data' => $group->toArray()]);
     } catch (\Exception $e) {
         $this->getApp()->render(500, ['error' => $e->getMessage()]);
     }
 }