<?php
namespace App\Event\Product\Product;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class DeleteSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
'product_product.pre_delete' => 'onPreDelete',
'product_product.post_delete' => 'onPostDelete'
];
}
public function onPreDelete(PreDeleteEvent $event)
{
// $product = $event->getProduct();
}
public function onPostDelete(PostDeleteEvent $event)
{
// $product = $event->getProduct();
}
}