dbmsv4 init...1

This commit is contained in:
최준흠 2025-11-25 12:31:32 +09:00
parent 92caea4ba8
commit a0021cc5f8
25 changed files with 46 additions and 79 deletions

View File

@ -104,7 +104,7 @@ abstract class AbstractCRUDController extends AbstractWebController
}
$this->addViewDatas('entity', $entity);
$action = __FUNCTION__;
$this->action_init_process($action, [], $entity);
$this->action_init_process($action);
return $this->modify_form_result_process($action);
} catch (\Exception $e) {
return $this->action_redirect_process('error', "{$this->getTitle()}에서 {$uid} 수정폼 오류:" . $e->getMessage());

View File

@ -76,7 +76,7 @@ abstract class AbstractWebController extends Controller
/**
* 모든 액션 실행 공통 초기화 작업
*/
protected function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
protected function action_init_process(string $action, array $formDatas = []): void
{
$this->addViewDatas('action', $action);
$this->addViewDatas('authContext', $this->getAuthContext());

View File

@ -17,10 +17,10 @@ abstract class AdminController extends CommonController
$this->addActionPaths($this->_layout);
$this->layouts = LAYOUTS[$this->_layout];
}
protected function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
protected function action_init_process(string $action, array $formDatas = []): void
{
$this->service->action_init_process($action, $formDatas, $entity);
parent::action_init_process($action, $formDatas, $entity);
$this->service->action_init_process($action, $formDatas);
parent::action_init_process($action, $formDatas);
$this->addViewDatas('layout', $this->layouts);
$this->addViewDatas('title', $this->getTitle());
$this->addViewDatas('helper', $this->service->getHelper());

View File

@ -17,10 +17,10 @@ class Home extends AbstractWebController
}
$this->addActionPaths('home');
}
protected function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
protected function action_init_process(string $action, array $formDatas = []): void
{
// $this->service->action_init_process($action, $entity);
parent::action_init_process($action, $formDatas, $entity);
parent::action_init_process($action, $formDatas);
$this->addViewDatas('layout', LAYOUTS['admin']);
}
//Index,FieldForm관련

View File

@ -8,7 +8,6 @@ use RuntimeException;
abstract class CommonForm
{
private array $_attributes = [];
private array $_formDatas = [];
private array $_formFields = [];
private array $_formRules = [];
private array $_formFilters = [];
@ -29,19 +28,6 @@ abstract class CommonForm
}
return $this->_attributes[$key];
}
final public function setFormDatas(array $formDatas): void
{
$this->_formDatas = $formDatas;
}
//$fields 매치된것만 반환, []->전체
final public function getFormDatas(array $fields = []): array
{
if (empty($fields)) {
return $this->_formDatas;
}
// _formDatas 키를 비교하여 교집합을 반환합니다. $fields에 지정된 필드 정의만 추출됩니다.
return array_intersect_key($this->_formDatas, array_flip($fields));
}
final public function setFormFields(array $fields): void
{
foreach ($fields as $field) {

View File

@ -53,7 +53,7 @@ class BoardService extends CommonService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
'category',
@ -108,11 +108,10 @@ class BoardService extends CommonService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -30,7 +30,7 @@ abstract class CommonService
{
return $isArray ? $this->_classPaths : implode($delimeter, $this->_classPaths);
}
abstract public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void;
abstract public function action_init_process(string $action, array $formDatas = []): void;
/**
* 단일 엔티티를 조회합니다.
* @return CommonEntity|null CommonEntity 인스턴스 또는 찾지 못했을 경우 null

View File

@ -54,7 +54,7 @@ class AccountService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"clientinfo_uid",
@ -89,11 +89,10 @@ class AccountService extends CustomerService
$fields = [...$fields, 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class ClientService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
'site',
@ -98,11 +98,10 @@ class ClientService extends CustomerService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class CouponService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"clientinfo_uid",
@ -83,11 +83,10 @@ class CouponService extends CustomerService
$fields = [...$fields, 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class PointService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"clientinfo_uid",
@ -83,11 +83,10 @@ class PointService extends CustomerService
$fields = [...$fields, 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -56,7 +56,7 @@ class ServiceService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"site",
@ -115,11 +115,10 @@ class ServiceService extends CustomerService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class LineService extends EquipmentService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"type",
@ -84,11 +84,10 @@ class LineService extends EquipmentService
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -56,7 +56,7 @@ class ServerPartService extends EquipmentService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"serverinfo_uid",
@ -93,11 +93,10 @@ class ServerPartService extends EquipmentService
$fields = [...$fields, 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class ServerService extends EquipmentService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"code",
@ -106,11 +106,10 @@ class ServerService extends EquipmentService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -42,7 +42,7 @@ class MylogService extends CommonService implements PipelineStepInterface
}
return $this->_form;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = ['title', 'content'];
$filters = [];
@ -62,11 +62,10 @@ class MylogService extends CommonService implements PipelineStepInterface
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class CPUService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"title",
@ -81,11 +81,10 @@ class CPUService extends PartService
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class CSService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"type",
@ -108,11 +108,10 @@ class CSService extends PartService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class DISKService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"title",
@ -82,11 +82,10 @@ class DISKService extends PartService
$fields = [...$fields, "format", 'status', 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class IPService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"lineinfo_uid",
@ -99,11 +99,10 @@ class IPService extends PartService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class RAMService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"title",
@ -81,11 +81,10 @@ class RAMService extends PartService
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -40,7 +40,7 @@ class SOFTWAREService extends PartService
}
return $this->_form;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"title",
@ -67,11 +67,10 @@ class SOFTWAREService extends PartService
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class SWITCHService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"code",
@ -100,11 +100,10 @@ class SWITCHService extends PartService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class PaymentService extends CommonService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
"serviceinfo_uid",
@ -119,11 +119,10 @@ class PaymentService extends CommonService
];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}

View File

@ -54,7 +54,7 @@ class UserService extends CommonService
}
return $this->_helper;
}
public function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
public function action_init_process(string $action, array $formDatas = []): void
{
$fields = [
'id',
@ -84,11 +84,10 @@ class UserService extends CommonService
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
break;
}
$this->getFormService()->setFormDatas($formDatas);
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($action, $filters, $entity);
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}