dbmsv4 init...3

This commit is contained in:
최준흠 2025-12-15 11:43:34 +09:00
parent bec3fe8ec4
commit 5b9e3d59a5
6 changed files with 18 additions and 12 deletions

View File

@ -140,7 +140,7 @@ abstract class CommonForm
// run()에는 데이터만 전달 (setRules에서 이미 설정됨)
$result = $this->_validation->run($formDatas);
if ($result === false) {
$message = __METHOD__ . "에서 데이터 검증 오류발생: " . var_export($this->_validation->getErrors(), true);
$message = static::class . '->' . __FUNCTION__ . "에서 데이터 검증 오류발생: " . var_export($this->_validation->getErrors(), true);
log_message('debug', $message);
throw new RuntimeException($message);
} else {

View File

@ -67,7 +67,7 @@ abstract class CommonService
} catch (DatabaseException $e) {
$errorMessage = sprintf(
"\n------DB Query 오류 (%s)-----\nQuery: %s\nError: %s\n------------------------------\n",
__FUNCTION__,
static::class . '->' . __FUNCTION__,
$this->model->getLastQuery() ?? "No Query Available",
$e->getMessage()
);
@ -76,7 +76,7 @@ abstract class CommonService
} catch (\Exception $e) {
$errorMessage = sprintf(
"\n------일반 오류 (%s)-----\nError: %s\n------------------------------\n",
__FUNCTION__,
static::class . '->' . __FUNCTION__,
$e->getMessage()
);
throw new \Exception($errorMessage, $e->getCode(), $e);
@ -108,7 +108,7 @@ abstract class CommonService
} catch (DatabaseException $e) {
$errorMessage = sprintf(
"\n------DB Query 오류 (%s)-----\nQuery: %s\nError: %s\n------------------------------\n",
__FUNCTION__,
static::class . '->' . __FUNCTION__,
$this->model->getLastQuery() ?? "No Query Available",
$e->getMessage()
);
@ -117,7 +117,7 @@ abstract class CommonService
} catch (\Exception $e) {
$errorMessage = sprintf(
"\n------일반 오류 (%s)-----\nError: %s\n------------------------------\n",
__FUNCTION__,
static::class . '->' . __FUNCTION__,
$e->getMessage()
);
throw new \Exception($errorMessage, $e->getCode(), $e);
@ -199,7 +199,7 @@ abstract class CommonService
// DatabaseException을 포착하면 자동으로 롤백 처리됨
throw new RuntimeException(sprintf(
"\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n",
__METHOD__,
static::class . '->' . __FUNCTION__,
$this->model->getLastQuery(),
$e->getMessage()
), $e->getCode(), $e);
@ -263,7 +263,7 @@ abstract class CommonService
// DatabaseException을 포착하면 자동으로 롤백 처리됨
throw new RuntimeException(sprintf(
"\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n",
__METHOD__,
static::class . '->' . __FUNCTION__,
$this->model->getLastQuery(),
$e->getMessage()
), $e->getCode(), $e);
@ -342,7 +342,7 @@ abstract class CommonService
// DatabaseException을 포착하면 자동으로 롤백 처리됨
throw new RuntimeException(sprintf(
"\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n",
__METHOD__,
__FUNCTION__,
$this->model->getLastQuery(),
$e->getMessage()
), $e->getCode(), $e);
@ -385,7 +385,7 @@ abstract class CommonService
// DatabaseException을 포착하면 자동으로 롤백 처리됨
throw new RuntimeException(sprintf(
"\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n",
__METHOD__,
__FUNCTION__,
$this->model->getLastQuery(),
$e->getMessage()
), $e->getCode(), $e);

View File

@ -224,7 +224,7 @@ class ServerService extends EquipmentService
{
//필수항목검사
if (!array_key_exists('chassisinfo_uid', $formDatas)) {
throw new RuntimeException(__METHOD__ . '에서 오류발생: 샷시정보가 정의되지 않았습니다.');
throw new RuntimeException(static::class . '->' . __FUNCTION__ . '에서 오류발생: 샷시정보가 정의되지 않았습니다.');
}
//변경전 정보
$oldEntity = clone $entity;

View File

@ -24,7 +24,7 @@ abstract class PartType2Service extends PartService
$entity = $this->getPartEntityByServerPart($serverPartEntity);
//상태확인
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다.");
throw new \Exception(static::class . '->' . __FUNCTION__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다.");
}
//파트정보 수정
return parent::modify_process($entity, $formDatas);

View File

@ -23,7 +23,7 @@ abstract class PartType3Service extends PartType2Service
//파트정보가져오기
$entity = $this->getPartEntityByServer($serverEntity);
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다.");
throw new \Exception(static::class . '->' . __FUNCTION__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다.");
}
//파트정보 수정
return parent::modify_process($entity, $formDatas);

View File

@ -149,6 +149,12 @@ class PaymentService extends CommonService
//기본 기능부분
protected function getEntity_process(mixed $entity): PaymentEntity
{
$errorMessage = sprintf(
"\n------Last Query (%s)-----\nQuery: %s\n------------------------------\n",
static::class . '->' . __FUNCTION__,
$this->model->getLastQuery() ?? "No Query Available",
);
log_message('error', $errorMessage);
return $entity;
}
//List 검색용