/** * Add an entry to the audit log * * @param Events\StageEvent $event */ public function onStagePostSave(Events\StageEvent $event) { $stage = $event->getStage(); if ($details = $event->getChanges()) { $log = array("bundle" => "stage", "object" => "stage", "objectId" => $stage->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 Events\StageEvent $event */ public function onStagePostSave(Events\StageEvent $event) { $stage = $event->getStage(); if ($details = $event->getChanges()) { $log = ['bundle' => 'stage', 'object' => 'stage', 'objectId' => $stage->getId(), 'action' => $event->isNew() ? 'create' : 'update', 'details' => $details, 'ipAddress' => $this->ipLookupHelper->getIpAddressFromRequest()]; $this->auditLogModel->writeToLog($log); } }