public static function updateEventFromDialog($eventid, $codetitle, $title, $color) { //at update a $POST is coming in here $modelEvent = CalendarEvents::findOne($eventid); if ($modelEvent) { $modelEvent->title = $title; $modelEvent->color = $color; $modelEvent->code_title = $codetitle; $modelEvent->save(false); } }
/** * Finds the CalendarEvents model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return CalendarEvents the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { $model = null; $model = CalendarEvents::findOne($id); return $model; }
/** * Finds the CalendarEvents model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return CalendarEvents the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = CalendarEvents::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }