public function getClubs() { $this->controller->get(\CommunityClub::model(), $this); }
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; }