/** * Finds the Request model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Request the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Request::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * dropping a request//private function * * @param type $req_id */ private static function dropRequest($req_id) { $data = Request::findOne($req_id); $data->delete(); }