$v) $assessment->$k = $v; $assessment->save(); return $assessment; } public static function updateAssessment($id, $iSurveyID, $language, array $data) { $assessment = self::model()->findByAttributes(array('id' => $id, 'sid'=> $iSurveyID, 'language' => $language)); if (!is_null($assessment)) { foreach ($data as $k => $v) $assessment->$k = $v; $assessment->save(); } } } ?>