/**
  * Add an entry to the audit log.
  *
  * @param Events\DynamicContentEvent $event
  */
 public function onPostSave(Events\DynamicContentEvent $event)
 {
     $entity = $event->getDynamicContent();
     if ($details = $event->getChanges()) {
         $log = ['bundle' => 'dynamicContent', 'object' => 'dynamicContent', 'objectId' => $entity->getId(), 'action' => $event->isNew() ? 'create' : 'update', 'details' => $details];
         $this->auditLogModel->writeToLog($log);
     }
 }
Exemplo n.º 2
0
 /**
  * Add an entry to the audit log
  *
  * @param Events\DynamicContentEvent $event
  */
 public function onPostSave(Events\DynamicContentEvent $event)
 {
     $entity = $event->getDynamicContent();
     if ($details = $event->getChanges()) {
         $log = ["bundle" => "dynamicContent", "object" => "dynamicContent", "objectId" => $entity->getId(), "action" => $event->isNew() ? "create" : "update", "details" => $details];
         $this->factory->getModel('core.auditLog')->writeToLog($log);
     }
 }