diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index d5afed6..0446c22 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -205,7 +205,7 @@ abstract class BaseModel extends Model // } //create , modify 직전 작업용 작업 - protected function changeFormData(string $action, string $field, array $formDatas, $entity) + protected function changeFormData(string $action, string $field, array $formDatas, $entity): BaseEntity { switch ($field) { case $this->primaryKey: diff --git a/app/Models/CategoryModel.php b/app/Models/CategoryModel.php index acbd814..8a7eb19 100644 --- a/app/Models/CategoryModel.php +++ b/app/Models/CategoryModel.php @@ -89,7 +89,7 @@ class CategoryModel extends BaseHierarchyModel } //Field별 Form Option용 - protected function changeFormData(string $action, string $field, array $formDatas, $entity) + protected function changeFormData(string $action, string $field, array $formDatas, $entity): CategoryEntity { switch ($field) { case "isaccess": @@ -109,7 +109,7 @@ class CategoryModel extends BaseHierarchyModel } break; default: - $entity = parent::changeFormData($action, $field, $formDatas, $entity); + $entity = new CategoryEntity(parent::changeFormData($action, $field, $formDatas, $entity)->toArray()); break; } return $entity; diff --git a/app/Models/UserModel.php b/app/Models/UserModel.php index 9ff8250..3c5a1f8 100644 --- a/app/Models/UserModel.php +++ b/app/Models/UserModel.php @@ -59,7 +59,7 @@ class UserModel extends BaseModel { return $this->where($conditions)->first() ?: throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 해당 데이터가 없습니다."); } - protected function changeFormData(string $action, string $field, array $formDatas, $entity) + protected function changeFormData(string $action, string $field, array $formDatas, $entity): UserEntity { switch ($field) { case "role": @@ -74,7 +74,7 @@ class UserModel extends BaseModel } break; default: - $entity = parent::changeFormData($action, $field, $formDatas, $entity); + $entity = new UserEntity(parent::changeFormData($action, $field, $formDatas, $entity)->toArray()); break; } return $entity;