vendor/bluue/gocardless-bundle/src/EventSubscriber/EditPublicDocumentPathsSubscriber.php line 32

Open in your IDE?
  1. <?php
  2. /**
  3.  * @author Thomas HERISSON (contact@scaledev.fr)
  4.  * @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
  5.  * @license commercial
  6.  */
  7. declare(strict_types=1);
  8. namespace Bluue\GocardlessBundle\EventSubscriber;
  9. use App\Event\PublicDocumentPathsEvent;
  10. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  11. class EditPublicDocumentPathsSubscriber implements EventSubscriberInterface
  12. {
  13.     /**
  14.      * @return string[]
  15.      */
  16.     public static function getSubscribedEvents(): array
  17.     {
  18.         return [
  19.             PublicDocumentPathsEvent::NAME => 'onLoad'
  20.         ];
  21.     }
  22.     /**
  23.      * @param PublicDocumentPathsEvent $event
  24.      * @return void
  25.      */
  26.     public function onLoad(PublicDocumentPathsEvent $event): void
  27.     {
  28.         if (in_array($event->getEntityName(), ['invoice''quotation'])) {
  29.             $event->addPath([
  30.                 'url' => 'gocardless_bundle__public_document_infos',
  31.                 'id' => $event->getEntityId()
  32.             ]);
  33.         }
  34.     }
  35. }