dbms_init...1
This commit is contained in:
parent
a459cd300d
commit
32b4fd1c7e
@ -131,6 +131,7 @@ abstract class CommonModel extends Model
|
||||
}
|
||||
break;
|
||||
case "editor": // content 등 textarea를 사용한 Field
|
||||
case "detail": //content등 textarea를 사용한 Field
|
||||
case "content": // content 등 textarea를 사용한 Field
|
||||
case "discription": // content 등 textarea를 사용한 Field
|
||||
$entity->$field = htmlentities($formDatas[$field], ENT_QUOTES);
|
||||
@ -144,24 +145,21 @@ abstract class CommonModel extends Model
|
||||
|
||||
final protected function save_process(mixed $entity): mixed
|
||||
{
|
||||
try {
|
||||
// 최종 변경사항이 없으면
|
||||
if (!$entity->hasChanged()) {
|
||||
return $entity;
|
||||
}
|
||||
// 최종 저장 시 오류 발생하면
|
||||
if (!$this->save($entity)) {
|
||||
throw new \Exception(sprintf(
|
||||
"\n------%s 오류-----\n%s\n------------------------------\n",
|
||||
__METHOD__,
|
||||
var_export($this->errors(), true)
|
||||
));
|
||||
}
|
||||
// 최종 변경사항이 없으면
|
||||
if (!$entity->hasChanged()) {
|
||||
return $entity;
|
||||
} catch (\Exception $e) {
|
||||
LogCollector::error($e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
// 최종 저장 시 오류 발생하면
|
||||
if (!$this->save($entity)) {
|
||||
$message = sprintf(
|
||||
"\n------%s 오류-----\n%s\n------------------------------\n",
|
||||
__METHOD__,
|
||||
var_export($this->errors(), true)
|
||||
);
|
||||
LogCollector::debug($message);
|
||||
throw new \Exception($message);
|
||||
}
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function create(array $formDatas, mixed $entity): mixed
|
||||
|
||||
@ -40,7 +40,7 @@ class MyLogModel extends CommonModel
|
||||
}
|
||||
return $rule;
|
||||
}
|
||||
//List 검색용
|
||||
//List 검색용
|
||||
public function setList_WordFilter(string $word): void
|
||||
{
|
||||
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
|
||||
|
||||
@ -52,18 +52,6 @@ class UserSNSModel extends CommonModel
|
||||
}
|
||||
return $rule;
|
||||
}
|
||||
protected function convertEntityData(string $action, string $field, array $formDatas, mixed $entity): mixed
|
||||
{
|
||||
switch ($field) {
|
||||
case "detail": //content등 textarea를 사용한 Field
|
||||
$entity->$field = htmlentities($formDatas[$field], ENT_QUOTES);
|
||||
break;
|
||||
default:
|
||||
$entity = parent::convertEntityData($action, $field, $formDatas, $entity);
|
||||
break;
|
||||
}
|
||||
return $entity;
|
||||
}
|
||||
//List 검색용
|
||||
public function setList_WordFilter(string $word): void
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user