<?php
/**
* Created by PhpStorm.
* User: frup64362
* Date: 11/04/2017
* Time: 13:47
*/
namespace App\Listener;
use App\Event\PdfodmEvents;
use App\Services\GeneratePdfOdm;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class GeneratePdfOdmListener implements EventSubscriberInterface
{
public function __construct(private readonly GeneratePdfOdm $generatePdf)
{
}
public static function getSubscribedEvents()
{
return [
PdfodmEvents::class => 'processPdf',
];
}
public function processPdf(PdfodmEvents $events)
{
$this->generatePdf->pdfGenerate($events->getOdm(),$events->getIdAffectation(),false,$events->getSignataire());
}
}