dbms_init...1
This commit is contained in:
parent
9672d9d9a5
commit
73e3d56aaa
@ -91,7 +91,6 @@ class UserController extends AdminController
|
|||||||
];
|
];
|
||||||
// $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
// $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
||||||
$this->initAction(__FUNCTION__, $fields);
|
$this->initAction(__FUNCTION__, $fields);
|
||||||
$this->setFormFields($this->getService()->getFormFields());
|
|
||||||
//FieldRule정의
|
//FieldRule정의
|
||||||
foreach ($this->getFormFields() as $field) {
|
foreach ($this->getFormFields() as $field) {
|
||||||
$this->setFieldRule($field, $this->getFormFieldRule($this->getAction(), $field));
|
$this->setFieldRule($field, $this->getFormFieldRule($this->getAction(), $field));
|
||||||
|
|||||||
@ -80,13 +80,6 @@ abstract class CommonModel extends Model
|
|||||||
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // variant 10
|
$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));
|
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
|
public function getFormFieldRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
@ -181,11 +174,11 @@ abstract class CommonModel extends Model
|
|||||||
|
|
||||||
public function create(array $formDatas, mixed $entity): mixed
|
public function create(array $formDatas, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
// Field에 맞는 Validation Rule 재정의
|
|
||||||
$this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->getAllowedFields()));
|
|
||||||
LogCollector::debug("입력내용");
|
LogCollector::debug("입력내용");
|
||||||
LogCollector::debug(var_export($formDatas, true));
|
LogCollector::debug(var_export($formDatas, true));
|
||||||
foreach (array_keys($formDatas) as $field) {
|
foreach (array_keys($formDatas) as $field) {
|
||||||
|
// Field에 맞는 Validation Rule 재정의
|
||||||
|
$this->setValidationRule($field, $this->getFormFieldRule(__FUNCTION__, $field));
|
||||||
$entity = $this->convertEntityData(__FUNCTION__, $field, $formDatas, $entity);
|
$entity = $this->convertEntityData(__FUNCTION__, $field, $formDatas, $entity);
|
||||||
}
|
}
|
||||||
// primaryKey가 자동입력이 아니면
|
// primaryKey가 자동입력이 아니면
|
||||||
@ -205,13 +198,13 @@ abstract class CommonModel extends Model
|
|||||||
}
|
}
|
||||||
final public function modify(mixed $entity, array $formDatas): mixed
|
final public function modify(mixed $entity, array $formDatas): mixed
|
||||||
{
|
{
|
||||||
// Field에 맞는 Validation Rule 재정의
|
|
||||||
$this->setValidationRules($this->getFormFieldRules(__FUNCTION__, $this->getAllowedFields()));
|
|
||||||
// 저장하기 전에 데이터 값 변경이 필요한 Field
|
// 저장하기 전에 데이터 값 변경이 필요한 Field
|
||||||
LogCollector::debug("[{$entity->getPK()}/{$entity->getTitle()}] 변경 전 내용");
|
LogCollector::debug("[{$entity->getPK()}/{$entity->getTitle()}] 변경 전 내용");
|
||||||
LogCollector::debug(var_export($formDatas, true));
|
LogCollector::debug(var_export($formDatas, true));
|
||||||
LogCollector::debug(var_export($entity->toArray(), true));
|
LogCollector::debug(var_export($entity->toArray(), true));
|
||||||
foreach (array_keys($formDatas) as $field) {
|
foreach (array_keys($formDatas) as $field) {
|
||||||
|
// Field에 맞는 Validation Rule 재정의
|
||||||
|
$this->setValidationRule($field, $this->getFormFieldRule(__FUNCTION__, $field));
|
||||||
$entity = $this->convertEntityData(__FUNCTION__, $field, $formDatas, $entity);
|
$entity = $this->convertEntityData(__FUNCTION__, $field, $formDatas, $entity);
|
||||||
}
|
}
|
||||||
//수정일추가
|
//수정일추가
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user