app/Plugin/BootechMypageInvoiceReceipt42/Event.php line 51

Open in your IDE?
  1. <?php
  2. namespace Plugin\BootechMypageInvoiceReceipt42;
  3. use Eccube\Entity\Master\OrderStatus;
  4. use Eccube\Event\TemplateEvent;
  5. use Eccube\Repository\Master\OrderStatusRepository;
  6. use Eccube\Service\OrderStateMachine;
  7. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  8. use Symfony\Component\Form\FormFactoryInterface;
  9. class Event implements EventSubscriberInterface
  10. {
  11.     /**
  12.      * @var OrderStatusRepository
  13.      */
  14.     private $orderStatusRepository;
  15.     /**
  16.      * @var OrderStateMachine
  17.      */
  18.     protected $orderStateMachine;
  19.     /**
  20.      * @var FormFactoryInterface
  21.      */
  22.     private $formFactory;
  23.     /**
  24.      * ConfigController constructor.
  25.      *
  26.      * @param OrderStateMachine $orderStateMachine
  27.      */
  28.     public function __construct(
  29.         OrderStatusRepository $orderStatusRepository,
  30.         OrderStateMachine $orderStateMachine,
  31.         FormFactoryInterface $formFactory
  32.     ) {
  33.         $this->orderStatusRepository $orderStatusRepository;
  34.         $this->orderStateMachine $orderStateMachine;
  35.         $this->formFactory $formFactory;
  36.     }
  37.     public static function getSubscribedEvents()
  38.     {
  39.         return [
  40.             'Mypage/history.twig' => 'onTemplateFrontMypageHistory',
  41.         ];
  42.     }
  43.     public function onTemplateFrontMypageHistory(TemplateEvent $event)
  44.     {
  45.         $event->addSnippet('@BootechMypageInvoiceReceipt42/default/Mypage/invoice_receipt_btn.twig');
  46.     }
  47. }