public function deletePregunta($id) { $model = Pregunta::findOne($id); $model->eliminado = 1; $model->save(); }
/** * Finds the Pregunta model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Pregunta the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Pregunta::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Finds the Pregunta model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @param string $codFormulario * @return Pregunta the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id, $codFormulario) { if (($model = Pregunta::findOne(['id' => $id, 'codFormulario' => $codFormulario])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }