dbms_init...1
This commit is contained in:
parent
73e3d56aaa
commit
a1ab8c65da
@ -62,11 +62,6 @@ abstract class CommonModel extends Model
|
|||||||
{
|
{
|
||||||
return constant("static::TITLE");
|
return constant("static::TITLE");
|
||||||
}
|
}
|
||||||
final public function getAllowedFields(): array
|
|
||||||
{
|
|
||||||
return $this->allowedFields;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Primary Key로 uuid를 사용시 해당 모델에 아래 변수 반드시 추가 필요
|
//Primary Key로 uuid를 사용시 해당 모델에 아래 변수 반드시 추가 필요
|
||||||
// protected $useAutoIncrement = false;
|
// protected $useAutoIncrement = false;
|
||||||
// protected $beforeInsert = ['generateUUID'];
|
// protected $beforeInsert = ['generateUUID'];
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Traits;
|
|
||||||
|
|
||||||
use App\Entities\CommonEntity;
|
|
||||||
use App\Services\MyLogService;
|
|
||||||
|
|
||||||
|
|
||||||
trait MylogTrait
|
|
||||||
{
|
|
||||||
final public function add_MylogTrait(string $action, array $formDatas, CommonEntity $entity): void
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
foreach ($formDatas as $field => $value) {
|
|
||||||
MyLogService::info("{$field}:{$entity->$field}");
|
|
||||||
}
|
|
||||||
MyLogService::log("{$entity->getTitle()}를 생성하였습니다.");
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
foreach ($formDatas as $field => $value) {
|
|
||||||
MyLogService::log("{$field}:{$entity->$field}=>{$value}");
|
|
||||||
}
|
|
||||||
MyLogService::log("{$entity->getTitle()}를 수정하였습니다.");
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
foreach ($this->getModel()->getAllowedFields() as $field) {
|
|
||||||
MyLogService::log("{$field}:{$entity->$field}");
|
|
||||||
}
|
|
||||||
MyLogService::log("{$entity->getTitle()}를 삭제하였습니다.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user