<?php
/**
* @author Thomas HERISSON (contact@scaledev.fr)
* @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
* @license commercial
*/
declare(strict_types=1);
namespace Bluue\ShipmentsBundle\EventSubscriber;
use Bluue\ShipmentsBundle\Event\DeleteBurstEvent;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class DeleteBurstSubscriber implements EventSubscriberInterface
{
/**
* @var Security
*/
protected Security $security;
/**
* @param Security $security
*/
public function __construct(Security $security)
{
$this->security = $security;
}
/**
* @return string[]
*/
public static function getSubscribedEvents(): array
{
return [
DeleteBurstEvent::NAME => 'onLoad'
];
}
/**
* @param DeleteBurstEvent $event
* @return void
*/
public function onLoad(DeleteBurstEvent $event): void
{
$event->setICanDelete(true);
}
}