/** * Finds the Notificaciones model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Notificaciones the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Notificaciones::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Actualiza el estado de notificacion a leida * @return bool */ public function actualizar() { if ($this->validate()) { $model = Notificaciones::findOne($this->id); $model->leida = Notificaciones::VISTO_SI; if ($model->save()) { return true; } } return false; }