vendor/xiidea/easy-audit/Subscriber/DoctrineDeleteEventLogger.php line 36

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the XiideaEasyAuditBundle package.
  4.  *
  5.  * (c) Xiidea <http://www.xiidea.net>
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Xiidea\EasyAuditBundle\Subscriber;
  11. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. use Symfony\Component\HttpKernel\KernelEvents;
  13. use Xiidea\EasyAuditBundle\Logger\Logger;
  14. use Symfony\Component\Console\ConsoleEvents;
  15. class DoctrineDeleteEventLogger implements EventSubscriberInterface
  16. {
  17.     /**
  18.      * @var Logger
  19.      */
  20.     private $logger;
  21.     /**
  22.      * DoctrineDeleteEventLogger constructor.
  23.      *
  24.      * @param Logger $logger
  25.      */
  26.     public function __construct(Logger $logger)
  27.     {
  28.         $this->logger $logger;
  29.     }
  30.     public function savePendingLogs()
  31.     {
  32.         $this->logger->savePendingLogs();
  33.     }
  34.     /**
  35.      * @return array
  36.      */
  37.     public static function getSubscribedEvents()
  38.     {
  39.         return [
  40.             ConsoleEvents::TERMINATE => 'savePendingLogs',
  41.             KernelEvents::TERMINATE => 'savePendingLogs',
  42.         ];
  43.     }
  44. }