src/Listener/GeneratePdfOdmListener.php line 26

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: frup64362
  5.  * Date: 11/04/2017
  6.  * Time: 13:47
  7.  */
  8. namespace App\Listener;
  9. use App\Event\PdfodmEvents;
  10. use App\Services\GeneratePdfOdm;
  11. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. class GeneratePdfOdmListener implements EventSubscriberInterface
  13. {
  14.     public function __construct(private readonly GeneratePdfOdm $generatePdf)
  15.     {
  16.     }
  17.     public static function getSubscribedEvents()
  18.     {
  19.         return [
  20.             PdfodmEvents::class => 'processPdf',
  21.         ];
  22.     }
  23.     public function processPdf(PdfodmEvents $events)
  24.     {
  25.         $this->generatePdf->pdfGenerate($events->getOdm(),$events->getIdAffectation(),false,$events->getSignataire());
  26.     }
  27. }