/** * Update the model with the given attributes * * @param \GO\Base\Db\ActiveRecord $model * @param array $data * @return Boolean */ private function _updateModel($model, $data) { $changeAttributes = array(); foreach ($data as $attr => $value) { if ($value['edit']) { $changeAttributes[$value['name']] = $value['value']; } } $model->setAttributes($changeAttributes); return $model->save(); }