trafficmonitor init...2
This commit is contained in:
parent
2b1d4a4b0f
commit
4940171775
@ -59,7 +59,7 @@ abstract class CommonService
|
||||
{
|
||||
try {
|
||||
$entities = $this->getEntities_process($where, $columns);
|
||||
// echo static::class . DIRECTORY_SEPARATOR . __FUNCTION__ . " Query:" . $this->model->getLastQuery();
|
||||
log_message('debug', $this->model->getLastQuery());
|
||||
return $entities;
|
||||
} catch (DatabaseException $e) { // 💡 DB 오류를 명시적으로 잡음
|
||||
$errorMessage = sprintf(
|
||||
@ -137,6 +137,7 @@ abstract class CommonService
|
||||
//PrimaryKey 필드는 생성에서 제외
|
||||
unset($formDatas[$this->model->primaryKey]);
|
||||
$result = $this->model->insert($formDatas, $this->model->useAutoIncrement());
|
||||
log_message('debug', $this->model->getLastQuery());
|
||||
if ($result === false) {
|
||||
$errors = $this->model->errors();
|
||||
$errorMsg = is_array($errors) ? implode(", ", $errors) : "삽입 작업이 실패했습니다.";
|
||||
@ -168,12 +169,12 @@ abstract class CommonService
|
||||
//PrimaryKey 필드는 수정에서 제외
|
||||
unset($formDatas[$this->model->primaryKey]);
|
||||
$result = $this->model->update($uid, $formDatas);
|
||||
log_message('debug', $this->model->getLastQuery());
|
||||
if ($result === false) {
|
||||
$errors = $this->model->errors();
|
||||
$errorMsg = is_array($errors) ? implode(", ", $errors) : "업데이트 작업이 실패했습니다.";
|
||||
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg);
|
||||
}
|
||||
log_message('debug', $this->model->getLastQuery());
|
||||
return $this->handle_save_result($result, $uid);
|
||||
}
|
||||
public function modify($uid, object $dto): CommonEntity
|
||||
@ -200,6 +201,7 @@ abstract class CommonService
|
||||
{
|
||||
$entity = $this->delete_process($uid);
|
||||
$result = $this->model->delete($entity->getPK());
|
||||
log_message('debug', $this->model->getLastQuery());
|
||||
if ($result === false) {
|
||||
$errors = $this->model->errors();
|
||||
$errorMsg = is_array($errors) ? implode(", ", $errors) : "모델 삭제 작업이 실패했습니다.";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user