dbms_init...1

This commit is contained in:
choi.jh 2025-07-02 13:21:18 +09:00
parent 9672d9d9a5
commit 73e3d56aaa
2 changed files with 4 additions and 12 deletions

View File

@ -91,7 +91,6 @@ class UserController extends AdminController
];
// $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
$this->initAction(__FUNCTION__, $fields);
$this->setFormFields($this->getService()->getFormFields());
//FieldRule정의
foreach ($this->getFormFields() as $field) {
$this->setFieldRule($field, $this->getFormFieldRule($this->getAction(), $field));

View File

@ -80,13 +80,6 @@ abstract class CommonModel extends Model
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // variant 10
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}
final protected function getFormFieldRules(string $action, array $fields, $rules = []): array
{
foreach ($fields as $field) {
$rules[$field] = $this->getFormFieldRule($action, $field);
}
return $rules;
}
public function getFormFieldRule(string $action, string $field): string
{
if (is_array($field)) {
@ -181,11 +174,11 @@ abstract class CommonModel extends Model
public function create(array $formDatas, mixed $entity): mixed
{
// Field에 맞는 Validation Rule 재정의
$this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->getAllowedFields()));
LogCollector::debug("입력내용");
LogCollector::debug(var_export($formDatas, true));
foreach (array_keys($formDatas) as $field) {
// Field에 맞는 Validation Rule 재정의
$this->setValidationRule($field, $this->getFormFieldRule(__FUNCTION__, $field));
$entity = $this->convertEntityData(__FUNCTION__, $field, $formDatas, $entity);
}
// primaryKey가 자동입력이 아니면
@ -205,13 +198,13 @@ abstract class CommonModel extends Model
}
final public function modify(mixed $entity, array $formDatas): mixed
{
// Field에 맞는 Validation Rule 재정의
$this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->getAllowedFields()));
// 저장하기 전에 데이터 값 변경이 필요한 Field
LogCollector::debug("[{$entity->getPK()}/{$entity->getTitle()}] 변경 전 내용");
LogCollector::debug(var_export($formDatas, true));
LogCollector::debug(var_export($entity->toArray(), true));
foreach (array_keys($formDatas) as $field) {
// Field에 맞는 Validation Rule 재정의
$this->setValidationRule($field, $this->getFormFieldRule(__FUNCTION__, $field));
$entity = $this->convertEntityData(__FUNCTION__, $field, $formDatas, $entity);
}
//수정일추가