src/EventListener/DebugListener.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\EventListener;
  3. use App\mvk\Debugger\ApplicationLogger;
  4. use Pimcore\Event\Model\DataObjectEvent;
  5. class DebugListener
  6. {
  7.     protected ApplicationLogger $applicationLogger;
  8.     public function __construct(applicationLogger $applicationLogger)
  9.     {
  10.         $this->applicationLogger $applicationLogger;
  11.     }
  12.     public function onPostUpdate(DataObjectEvent $event)
  13.     {
  14.         $object $event->getObject();
  15.         if (method_exists($object,'getPublished')) {
  16.             if ($object && !$object->getPublished()) {
  17.                 $this->applicationLogger->saveLog('debug''Object with Class: "'.$object->getClass()->getName().'" and ID:"'.$object->getId().'" Stacktrace: "'.json_encode(debug_backtrace()).'"''700');
  18.             }
  19.         }
  20.        
  21.     }
  22. }