label) */ public function attributeLabels(){ return array( ); } /** * Create instance form $id of model */ public function loadModel($id){ /** @var $model */ $model = ::model()->findByPk($id); if($model == null) throw new CException(404, Yii::t('common', 'msg.canNotFoundResource')); } /** * Save to database */ public function save(){ $model = new ; $result = $model->save(); if(!$result) return self::ERROR_DB; return self::ERROR_NONE; } /** * Save to database */ public function update($id){ /** @var $model */ $model = ::model()->findByPk($id); if($model == null) throw new CException(404, Yii::t('common', 'msg.canNotFoundResource')); $result = $model->save(); if(!$result) return self::ERROR_DB; return self::ERROR_NONE; } }