public function doRestCreate($data) { $candidate = Candidate::model()->findByPk($data['candidate_id']); if (!$candidate) { throw new Exception('Candidate was not found'); } $data['election_id'] = $candidate->election_id; parent::doRestCreate($data); }
public function doRestCreate($data) { $data['user_id'] = Yii::app()->user->id; parent::doRestCreate($data); }