diff --git a/app/Controllers/Common/CommonController.php b/app/Controllers/Common/CommonController.php index d09d83e..80fad06 100644 --- a/app/Controllers/Common/CommonController.php +++ b/app/Controllers/Common/CommonController.php @@ -160,8 +160,8 @@ class CommonController extends BaseController } final public function update_form($uid) { + $entity = $this->_model->getEntity($uid); try { - $entity = $this->_model->getEntity($uid); $this->update_init(); $this->update_form_init(); $this->_viewDatas['entity'] = $this->update_form_process($entity); @@ -201,9 +201,9 @@ class CommonController extends BaseController } final public function update($uid) { + $entity = $this->_model->getEntity($uid); $message = ""; try { - $entity = $this->_model->getEntity($uid); $this->update_init(); $entity = $this->update_validate($entity); $entity = $this->update_process($entity); @@ -256,9 +256,9 @@ class CommonController extends BaseController } public function toggle($uid, string $field) { + $entity = $this->_model->getEntity($uid); $message = ""; try { - $entity = $this->_model->getEntity($uid); $this->toggle_init($field); $entity = $this->toggle_validate($entity); $entity = $this->toggle_process($entity); @@ -354,10 +354,9 @@ class CommonController extends BaseController } final public function delete($uid) { + $entity = $this->_model->getEntity($uid); $message = ""; try { - $entity = $this->_model->getEntity($uid); - $entity = $this->delete_process($entity); $message = "{$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."; Log::save("{$this->_viewDatas['title']} {$message}"); return alert_CommonHelper($message, session()->get(RETURN_URL)); diff --git a/app/Entities/CommonEntity.php b/app/Entities/CommonEntity.php index 2c45ae8..fea63d3 100644 --- a/app/Entities/CommonEntity.php +++ b/app/Entities/CommonEntity.php @@ -4,8 +4,10 @@ namespace App\Entities; use CodeIgniter\Entity\Entity; -abstract class CommonEntity extends Entity +class CommonEntity extends Entity { - abstract public function getPrimaryKey(); - abstract public function getTitle(); -} \ No newline at end of file + public function getTitle() + { + return "CommonEntity"; + } +}