dbms_init...1

This commit is contained in:
최준흠 2025-06-06 17:38:08 +09:00
parent daa4d81c80
commit 295346ad1a
4 changed files with 8 additions and 7 deletions

View File

@ -155,12 +155,13 @@ abstract class CommonController extends BaseController
$this->setIndexFields($this->getService()->getIndexFields());
$this->setViewFields($this->getService()->getViewFields());
$this->setFilterFields($this->getService()->getFilterFields());
foreach ($this->getFormFields() as $field) {
foreach ($this->getViewFields() as $field) {
$this->setFieldRule($field, $this->getFormFieldRule($this->getAction(), $field));
}
foreach ($this->getFilterFields() as $field) {
$this->setFilterFieldOption($field, $this->getFormFieldOption($field, $this->getFilterFieldOptions()));
$this->setFilterFieldOption($field, $this->getFormFieldOption($field));
}
$this->setBatchJobFields($this->getService()->getBatchJobFields());
}
protected function getFormFieldRule(string $action, string $field): string
{

View File

@ -62,7 +62,7 @@ abstract class CommonModel extends Model
{
return constant("static::TITLE");
}
final public function getFields(): array
final public function getAllowedFields(): array
{
return $this->allowedFields;
}
@ -180,7 +180,7 @@ abstract class CommonModel extends Model
final function create(array $formDatas, mixed $entity): mixed
{
// Field에 맞는 Validation Rule 재정의
$this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->allowedFields));
$this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->getAllowedFields()));
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->getFormFieldRules(__FUNCTION__, $this->allowedFields));
$this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->getAllowedFields()));
// 저장하기 전에 데이터 값 변경이 필요한 Field
LogCollector::debug("[{$entity->getPK()}/{$entity->getTitle()}] 변경 전 내용");
LogCollector::debug(var_export($formDatas, true));

View File

@ -26,7 +26,7 @@ abstract class CommonService
}
public function getViewFields(): array
{
return $this->getModel()->getFields();
return $this->getModel()->getAllowedFields();
}
final public function __get($name)
{

View File

@ -24,7 +24,7 @@ trait MylogTrait
MyLogService::log("{$entity->getTitle()}를 수정하였습니다.");
break;
case 'delete':
foreach ($this->getModel()->getFields() as $field) {
foreach ($this->getModel()->getAllowedFields() as $field) {
MyLogService::log("{$field}:{$entity->$field}");
}
MyLogService::log("{$entity->getTitle()}를 삭제하였습니다.");