Пример #1
0
 public function getClubs()
 {
     $this->controller->get(\CommunityClub::model(), $this);
 }
Пример #2
0
 private function postSettings()
 {
     $required = array('community_filter' => true);
     $params = $this->controller->getParams($required);
     $clubIds = explode(',', $params['community_filter']);
     foreach ($clubIds as $clubId) {
         if (!\CommunityClub::model()->findByPk($clubId)) {
             throw new InvalidParamsApiException("Club with id {$clubId} not found.");
         }
     }
     /**
      * @var CommentatorsContestParticipant $participant
      */
     $participant = CommentatorsContestParticipant::model()->byContest(ContestManager::getCurrentActive()->id)->byUser($this->controller->identity->getId())->find();
     $participant->settings = \CJSON::encode($params);
     $participant->update(array('settings'));
     $this->controller->data = $participant;
 }