app/Plugin/TwoFactorAuthCustomerSms42/Event.php line 52

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Plugin\TwoFactorAuthCustomerSms42;
  13. use Doctrine\ORM\EntityManagerInterface;
  14. use Eccube\Entity\BaseInfo;
  15. use Eccube\Event\TemplateEvent;
  16. use Eccube\Repository\BaseInfoRepository;
  17. use Plugin\TwoFactorAuthCustomer42\Service\CustomerTwoFactorAuthService;
  18. use Symfony\Component\DependencyInjection\ContainerInterface;
  19. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  20. use Twig\Environment;
  21. /**
  22.  * Class Event.
  23.  */
  24. class Event implements EventSubscriberInterface
  25. {
  26.     /**
  27.      * Event constructor.
  28.      *
  29.      */
  30.     public function __construct()
  31.     {
  32.     }
  33.     public static function getSubscribedEvents(): array
  34.     {
  35.         return [
  36.             '@admin/Customer/edit.twig' => 'onRenderAdminCustomerEdit',
  37.         ];
  38.     }
  39.     /**
  40.      * [/admin/customer/edit]表示の時のEvent Hook.
  41.      * 二段階認証関連項目を追加する.
  42.      *
  43.      * @param TemplateEvent $event
  44.      */
  45.     public function onRenderAdminCustomerEdit(TemplateEvent $event)
  46.     {
  47.         // add twig
  48.         $twig 'TwoFactorAuthCustomerSms42/Resource/template/admin/customer_edit.twig';
  49.         $event->addSnippet($twig);
  50.     }
  51. }