From 1c7426a4796bee91411725b1f3c4ff78c1955a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Fri, 6 Jun 2025 14:21:18 +0900 Subject: [PATCH] dbms_init...1 --- app/Models/CommonModel.php | 6 +++--- app/Services/CommonService.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/CommonModel.php b/app/Models/CommonModel.php index e9fc9b7..67ffdf6 100644 --- a/app/Models/CommonModel.php +++ b/app/Models/CommonModel.php @@ -145,7 +145,7 @@ abstract class CommonModel extends Model $entity->$field = htmlentities($formDatas[$field], ENT_QUOTES); break; default: - if ($this->getFieldRule($action, $field) != "if_exist|numeric") { + if ($this->getFormFieldRule($action, $field) != "if_exist|numeric") { if (array_key_exists($field, $formDatas) && $formDatas[$field] !== '') { $entity->$field = $formDatas[$field]; } @@ -180,7 +180,7 @@ abstract class CommonModel extends Model final function create(array $formDatas, mixed $entity): mixed { // Field에 맞는 Validation Rule 재정의 - $this->setValidationRules($this->getFieldRules(__FUNCTION__, $this->allowedFields)); + $this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->allowedFields)); LogCollector::debug("입력내용"); LogCollector::debug(var_export($formDatas, true)); foreach (array_keys($formDatas) as $field) { @@ -204,7 +204,7 @@ abstract class CommonModel extends Model final function modify(mixed $entity, array $formDatas): mixed { // Field에 맞는 Validation Rule 재정의 - $this->setValidationRules($this->getFieldRules(__FUNCTION__, $this->allowedFields)); + $this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->allowedFields)); // 저장하기 전에 데이터 값 변경이 필요한 Field LogCollector::debug("[{$entity->getPK()}/{$entity->getTitle()}] 변경 전 내용"); LogCollector::debug(var_export($formDatas, true)); diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index d92e402..fb8bd8d 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -63,7 +63,7 @@ abstract class CommonService $entity = is_array($where) ? $this->getModel()->where($where)->first() : $this->getModel()->find($where); if (!$entity) { if ($isThrow) { - throw new \Exception(__FUNCTION__ . " => 해당 정보를 찾을수 없습니다."); + throw new \Exception(__METHOD__ . "에서 해당 정보를 찾을수 없습니다."); } } return $entity;