app/Plugin/ProductReserve4/Form/Subscriber/ProductClassExtraSubscriber.php line 35

Open in your IDE?
  1. <?php
  2. namespace Plugin\ProductReserve4\Form\Subscriber;
  3. use Plugin\ProductReserve4\Form\Extension\ProductClassReservationExtension;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Symfony\Component\HttpKernel\KernelEvents;
  6. class ProductClassExtraSubscriber implements EventSubscriberInterface
  7. {
  8.     /**
  9.      * @var ProductClassReservationExtension
  10.      */
  11.     private $extension;
  12.     /**
  13.      * ProductClassExtraSubscriber constructor.
  14.      * @param ProductClassReservationExtension $extension
  15.      */
  16.     public function __construct(ProductClassReservationExtension $extension)
  17.     {
  18.         $this->extension $extension;
  19.     }
  20.     public static function getSubscribedEvents()
  21.     {
  22.         return [
  23.             KernelEvents::REQUEST => 'onRequest'
  24.         ];
  25.     }
  26.     public function onRequest($event){
  27.         $id $event->getRequest()->attributes->get('id');
  28.         $this->extension->setProductId((int)$id);
  29. //        dump($id);
  30. //        exit();
  31.     }
  32. }