cfmgrv4 init...4
This commit is contained in:
parent
9497f2f56c
commit
97df6c0103
@ -58,8 +58,12 @@ class AuditLogService extends CloudflareService
|
||||
return $formDatas;
|
||||
}
|
||||
|
||||
private function auditlog_process(AccountEntity $account_entity, AuditLogEntity $entity): void
|
||||
private function auditlog_process(AccountEntity $account_entity, \stdClass $result): void
|
||||
{
|
||||
//Auditlog 신규등록
|
||||
$formDatas = $this->getArrayByResult($result);
|
||||
$entity = $this->getModel()->create($formDatas);
|
||||
|
||||
//auditlog의 domain에 해당하는 Zone이 존재하는지 확인
|
||||
$this->getZoneModel()->where('domain', $entity->getZoneName());
|
||||
$zone_entity = $this->getZoneModel()->getEntity();
|
||||
@ -93,12 +97,10 @@ class AuditLogService extends CloudflareService
|
||||
$body = json_decode($response->getBody());
|
||||
foreach ($body->result as $result) {
|
||||
if (isset($result->action->result) && $result->action->result && isset($result->metadata->zone_name)) {
|
||||
//이미 등록되어있는지 확인
|
||||
//Auditlog에 이미 등록되어있는지 확인
|
||||
$entity = $this->getModel()->getEntityByPK($result->id);
|
||||
if ($entity === null) {
|
||||
$formDatas = $this->getArrayByResult($result);
|
||||
$entity = $this->getModel()->create($formDatas);
|
||||
$this->auditlog_process($account_entity, $entity);
|
||||
$this->auditlog_process($account_entity, $result);
|
||||
}
|
||||
} else {
|
||||
log_message("debug", var_export($result, true));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user