public function loadModelByUser($id) { $params = array('user_id' => $id); $model = ApplicationPersonalMentor::model()->findByAttributes($params); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function loadPersonalMentorForApproval($id) { $params = array('user_id' => $id, 'status' => 'Mentor'); $model = ApplicationPersonalMentor::model()->findByAttributes($params); return $model; }