public function save() { $model = Configuration::findOne($this->id); foreach ($this as $key => $value) { $model->{$key} = $value; } return $model->save(); }