vendor/bluue/shipments-bundle/src/EventSubscriber/DeleteBurstSubscriber.php line 46

Open in your IDE?
  1. <?php
  2. /**
  3.  * @author Thomas HERISSON (contact@scaledev.fr)
  4.  * @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
  5.  * @license commercial
  6.  */
  7. declare(strict_types=1);
  8. namespace Bluue\ShipmentsBundle\EventSubscriber;
  9. use Bluue\ShipmentsBundle\Event\DeleteBurstEvent;
  10. use Symfony\Component\Security\Core\Security;
  11. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. class DeleteBurstSubscriber implements EventSubscriberInterface
  13. {
  14.     /**
  15.      * @var Security
  16.      */
  17.     protected Security $security;
  18.     /**
  19.      * @param Security $security
  20.      */
  21.     public function __construct(Security $security)
  22.     {
  23.         $this->security $security;
  24.     }
  25.     /**
  26.      * @return string[]
  27.      */
  28.     public static function getSubscribedEvents(): array
  29.     {
  30.         return [
  31.             DeleteBurstEvent::NAME => 'onLoad'
  32.         ];
  33.     }
  34.     /**
  35.      * @param DeleteBurstEvent $event
  36.      * @return void
  37.      */
  38.     public function onLoad(DeleteBurstEvent $event): void
  39.     {
  40.         $event->setICanDelete(true);
  41.     }
  42. }