cfmgrv4 init...4

This commit is contained in:
최준흠 2024-10-30 13:07:59 +09:00
parent 06b3d86372
commit 68d07ce53b

View File

@ -58,16 +58,12 @@ class AuditLogService extends CloudflareService
return $formDatas;
}
private function auditlog_process(AuditLogEntity $entity): void
private function auditlog_process(AccountEntity $account_entity, AuditLogEntity $entity): void
{
//해당 Zone을 Sync작업한다
//auditlog의 domain에 해당하는 Zone이 존재하는지 확인
$this->getZoneModel()->where('domain', $entity->getZoneName());
$zone_entity = $this->getZoneModel()->getEntity();
if ($zone_entity !== null) {
$account_entity = $this->getAccountModel()->getEntityBYPK($zone_entity->getParent());
if ($account_entity === null) {
throw new \Exception("Account: [{$zone_entity->getParent()}] 정보를 찾을수 없습니다.");
}
//해당 Zone만 Sync작업을 한다.
$zone_service = new ZoneService();
$zone_entity = $zone_service->sync($account_entity, $zone_entity);
@ -102,7 +98,7 @@ class AuditLogService extends CloudflareService
if ($entity === null) {
$formDatas = $this->getArrayByResult($result);
$entity = $this->getModel()->create($formDatas);
$this->auditlog_process($entity);
$this->auditlog_process(entity: $account_entity, $entity);
}
} else {
log_message("debug", var_export($result, true));