/** * Add an entry to the audit log * * @param WebhookEvent $event */ public function onWebhookSave(WebhookEvent $event) { $webhook = $event->getWebhook(); if ($details = $event->getChanges()) { $log = array("bundle" => "webhook", "object" => "webhook", "objectId" => $webhook->getId(), "action" => $event->isNew() ? "create" : "update", "details" => $details, "ipAddress" => $this->factory->getIpAddressFromRequest()); $this->factory->getModel('core.auditLog')->writeToLog($log); } }
/** * Add an entry to the audit log. * * @param WebhookEvent $event */ public function onWebhookSave(WebhookEvent $event) { $webhook = $event->getWebhook(); if ($details = $event->getChanges()) { $log = ['bundle' => 'webhook', 'object' => 'webhook', 'objectId' => $webhook->getId(), 'action' => $event->isNew() ? 'create' : 'update', 'details' => $details, 'ipAddress' => $this->ipLookupHelper->getIpAddressFromRequest()]; $this->auditLogModel->writeToLog($log); } }