app/Plugin/VeriTrans4G2/EventListener/Vt4gEvent.php line 292

Open in your IDE?
  1. <?php
  2. /*
  3.  * Copyright (c) 2018 VeriTrans Inc., a Digital Garage company. All rights reserved.
  4.  * http://www.veritrans.co.jp/
  5.  */
  6. namespace Plugin\VeriTrans4G2\EventListener;
  7. use Eccube\Event\EccubeEvents;
  8. use Eccube\Event\EventArgs;
  9. use Eccube\Event\TemplateEvent;
  10. use Symfony\Component\DependencyInjection\ContainerInterface;
  11. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. /**
  13.  * ベリトランス4Gプラグインのイベントクラス
  14.  * @author develop
  15.  *
  16.  */
  17. class Vt4gEvent implements EventSubscriberInterface
  18. {
  19.     /**
  20.      * コンテナ
  21.      */
  22.     private $container;
  23.     /**
  24.      * コンストラクタ
  25.      * @param ContainerInterface $container
  26.      */
  27.     public function __construct(ContainerInterface $container)
  28.     {
  29.         $this->container $container;
  30.     }
  31.     /**
  32.      * イベントを登録します。
  33.      * @return array
  34.      */
  35.     public static function getSubscribedEvents()
  36.     {
  37.         return [
  38.             '@admin/Setting/Shop/payment_edit.twig' => 'settingShopPaymentRenderBefore',
  39.             '@admin/Setting/Shop/payment.twig' => 'settingShopPaymentAddRegistBtnRenderBefore',
  40.             '@admin/Order/index.twig' => 'orderIndexRenderBefore',
  41.             '@admin/Order/edit.twig' => 'orderEditRenderBefore',
  42.             'Mypage/index.twig' => 'myPageNaviRenderBefore',
  43.             'Mypage/history.twig' => 'myPageNaviRenderBefore',
  44.             'Mypage/favorite.twig' => 'myPageNaviRenderBefore',
  45.             'Mypage/change.twig' => 'myPageNaviRenderBefore',
  46.             'Mypage/change_complete.twig' => 'myPageNaviRenderBefore',
  47.             'Mypage/delivery.twig' => 'myPageNaviRenderBefore',
  48.             'Mypage/delivery_edit.twig' => 'myPageNaviRenderBefore',
  49.             'Mypage/withdraw.twig' => 'myPageNaviRenderBefore',
  50.             'VeriTrans4G2/Resource/template/default/Mypage/vt4g_account_id.twig' => 'myPageNaviRenderBefore',
  51.             'VeriTrans4G2/Resource/template/default/Mypage/vt4g_retrade.twig' => 'myPageNaviRenderBefore',
  52.             'VeriTrans4G2/Resource/template/default/Mypage/vt4g_subsc_payment.twig' => 'myPageNaviRenderBefore',
  53.             'VeriTrans4G2/Resource/template/default/Mypage/vt4g_subsc_payment_history.twig' => 'myPageNaviRenderBefore',
  54.             EccubeEvents::ADMIN_SETTING_SHOP_PAYMENT_EDIT_COMPLETE => 'settingShopPaymentEditComplete',
  55.             EccubeEvents::MAIL_ORDER => 'sendOrderMailBefore',
  56.             EccubeEvents::ADMIN_ORDER_MAIL_INDEX_INITIALIZE => 'adminOrderMailInitAfter',
  57.             EccubeEvents::ADMIN_ORDER_EDIT_INDEX_COMPLETE => 'adminOrderEditIndexComplete',
  58.             'Shopping/index.twig' => 'shoppingIndexRenderBefore',
  59.             'Shopping/confirm.twig' => 'shoppingConfirmRenderBefore',
  60.             EccubeEvents::FRONT_MYPAGE_WITHDRAW_INDEX_COMPLETE => 'frontMypageWithdrawComplete',
  61.             EccubeEvents::ADMIN_CUSTOMER_DELETE_COMPLETE => 'adminCustomerDeleteComplete',
  62.             EccubeEvents::ADMIN_CUSTOMER_EDIT_INDEX_COMPLETE => 'adminCustomerEditIndexComplete',
  63.             '@admin/Customer/edit.twig' => 'adminCustomerEditRenderBefore',
  64.             EccubeEvents::ADMIN_CUSTOMER_CSV_EXPORT => 'adminCustomerCsvExport',
  65.             EccubeEvents::FRONT_MYPAGE_MYPAGE_INDEX_SEARCH => 'frontMypageIndexSearch',
  66.             EccubeEvents::ADMIN_PRODUCT_EDIT_COMPLETE => 'adminProductEditComplete',
  67.             EccubeEvents::ADMIN_PRODUCT_DELETE_COMPLETE => 'adminProductDeleteComplete',
  68.             EccubeEvents::ADMIN_PRODUCT_COPY_COMPLETE => 'adminProductCopyComplete',
  69.             '@admin/Product/product_class.twig' => 'adminProductClassRenderBefore',
  70.             '@admin/Product/product.twig' => 'adminProductRenderBefore',
  71.             'Cart/index.twig' => 'cartRenderBefore',
  72.             EccubeEvents::ADMIN_ORDER_CSV_EXPORT_ORDER => 'adminOrderCsvExport',
  73.             EccubeEvents::ADMIN_ORDER_CSV_EXPORT_SHIPPING => 'adminOrderCsvExport',
  74.             '@admin/Setting/Shop/mail.twig' => 'mailRenderBefore',
  75.         ];
  76.     }
  77.     /**
  78.      * 支払方法設定編集画面表示前のイベント
  79.      * @param  TemplateEvent $event
  80.      * @return void
  81.      */
  82.     public function settingShopPaymentRenderBefore(TemplateEvent $event)
  83.     {
  84.         $this->container->get('vt4g_plugin.service.admin.setting_shop_payment')->onRenderBefore($event);
  85.     }
  86.     /**
  87.      * 支払方法一覧画面表示前のイベント(新規登録ボタン追加)
  88.      * @param  TemplateEvent $event
  89.      * @return void
  90.      */
  91.     public function settingShopPaymentAddRegistBtnRenderBefore(TemplateEvent $event)
  92.     {
  93.         $this->container->get('vt4g_plugin.service.admin.setting_shop_payment_add_regist_btn')->onRenderBefore($event);
  94.     }
  95.     /**
  96.      * 支払方法設定(dtb_payment)登録後のイベント
  97.      * @param  EventArgs $event
  98.      * @return void
  99.      */
  100.     public function settingShopPaymentEditComplete(EventArgs $event)
  101.     {
  102.         $this->container->get('vt4g_plugin.service.admin.setting_shop_payment')->onEditCompleteAfter($event);
  103.     }
  104.     /**
  105.      * 注文完了メール送信前のイベント
  106.      * @param  EventArgs $event
  107.      * @return void
  108.      */
  109.     public function sendOrderMailBefore(EventArgs $event)
  110.     {
  111.         $this->container->get('vt4g_plugin.service.mail_message')->onSendOrderMailBefore($event);
  112.     }
  113.     /**
  114.      * 管理画面メール通知(注文完了メール)初期処理後のイベント
  115.      * @param  EventArgs $event
  116.      * @return void
  117.      */
  118.     public function adminOrderMailInitAfter(EventArgs $event)
  119.     {
  120.         $this->container->get('vt4g_plugin.service.mail_message')->onAdminOrderMailInitAfter($event);
  121.     }
  122.     /**
  123.      * 受注管理一覧画面表示前のイベント
  124.      *
  125.      * @param  TemplateEvent $event
  126.      * @return void
  127.      */
  128.     public function orderIndexRenderBefore(TemplateEvent $event)
  129.     {
  130.         $this->container->get('vt4g_plugin.service.admin.order_index_extension')->onRenderBefore($event);
  131.     }
  132.     /**
  133.      * 受注管理詳細画面表示前のイベント
  134.      *
  135.      * @param  TemplateEvent $event
  136.      * @return void
  137.      */
  138.     public function orderEditRenderBefore(TemplateEvent $event)
  139.     {
  140.         $this->container->get('vt4g_plugin.service.admin.order_edit_extension')->onRenderBefore($event);
  141.     }
  142.     /**
  143.      * 受注管理詳細画面更新時のイベント
  144.      *
  145.      * @param  EventArgs $event
  146.      * @return void
  147.      */
  148.     public function adminOrderEditIndexComplete(EventArgs $event)
  149.     {
  150.         $this->container->get('vt4g_plugin.service.admin.order_edit_extension')->onEditComplete($event);
  151.     }
  152.     /**
  153.      * マイページ画面表示前のイベント
  154.      * @param  TemplateEvent $event
  155.      * @return void
  156.      */
  157.     public function myPageNaviRenderBefore(TemplateEvent $event)
  158.     {
  159.         $this->container->get('vt4g_plugin.service.front.mypage_extension')->onRenderBefore($event);
  160.     }
  161.     /**
  162.      * ご注文手続き画面表示前のイベント
  163.      * @param  TemplateEvent $event
  164.      * @return void
  165.      */
  166.     public function shoppingIndexRenderBefore(TemplateEvent $event)
  167.     {
  168.         $this->container->get('vt4g_plugin.service.shopping_index_extension')->onRenderBefore($event);
  169.     }
  170.     /**
  171.      * 注文確認画面表示前のイベント
  172.      * @param  TemplateEvent $event
  173.      * @return void
  174.      */
  175.     public function shoppingConfirmRenderBefore(TemplateEvent $event)
  176.     {
  177.         $this->container->get('vt4g_plugin.service.shopping.confirm')->onRenderBefore($event);
  178.     }
  179.     /**
  180.      * マイページ→退会手続き完了後のイベント
  181.      * @param  TemplateEvent $event
  182.      * @return void
  183.      */
  184.     public function frontMypageWithdrawComplete(EventArgs $event)
  185.     {
  186.         $this->container->get('vt4g_plugin.service.front.mypage.withdraw_extension')->onWithdrawComplete($event);
  187.     }
  188.     /**
  189.      * 管理画面→会員一覧→削除完了後のイベント
  190.      * @param  TemplateEvent $event
  191.      * @return void
  192.      */
  193.     public function adminCustomerDeleteComplete(EventArgs $event)
  194.     {
  195.         $this->container->get('vt4g_plugin.service.admin.customer_index_extension')->onDeleteComplete($event);
  196.     }
  197.     /**
  198.      * 管理画面→会員登録→登録完了後のイベント
  199.      * @param  TemplateEvent $event
  200.      * @return void
  201.      */
  202.     public function adminCustomerEditIndexComplete(EventArgs $event)
  203.     {
  204.         $this->container->get('vt4g_plugin.service.admin.customer_edit_extension')->onEditIndexComplete($event);
  205.     }
  206.     /**
  207.      * 管理画面→会員登録画面表示前のイベント
  208.      * @param  TemplateEvent $event
  209.      * @return void
  210.      */
  211.     public function adminCustomerEditRenderBefore(TemplateEvent $event)
  212.     {
  213.         $this->container->get('vt4g_plugin.service.admin.customer_edit_extension')->onRenderBefore($event);
  214.     }
  215.     /**
  216.      * 会員一覧CSVダウンロードのイベント
  217.      * @param  EventArgs $event
  218.      * @return void
  219.      */
  220.     public function adminCustomerCsvExport(EventArgs $event)
  221.     {
  222.         $this->container->get('vt4g_plugin.service.admin.customer_csv_export_extension')->onCustomerCsvExport($event);
  223.     }
  224.     /**
  225.      * マイページ注文履歴一覧情報取得時のイベント
  226.      * @param  EventArgs $event
  227.      * @return void
  228.      */
  229.     public function frontMypageIndexSearch(EventArgs $event)
  230.     {
  231.         $this->container->get('vt4g_plugin.service.front.mypage_extension')->onMypageIndexSearch($event);
  232.     }
  233.     /**
  234.      * 商品登録 登録完了後のイベント
  235.      * @param  EventArgs $event
  236.      * @return void
  237.      */
  238.     public function adminProductEditComplete(EventArgs $event)
  239.     {
  240.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductEditComplete($event);
  241.     }
  242.     /**
  243.      * 商品登録 削除完了後のイベント
  244.      * @param  EventArgs $event
  245.      * @return void
  246.      */
  247.     public function adminProductDeleteComplete(EventArgs $event)
  248.     {
  249.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductDeleteComplete($event);
  250.     }
  251.     /**
  252.      * 商品一覧 商品情報コピー完了後のイベント
  253.      * @param  EventArgs $event
  254.      * @return void
  255.      */
  256.     public function adminProductCopyComplete(EventArgs $event)
  257.     {
  258.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductCopyComplete($event);
  259.     }
  260.     /**
  261.      * 商品規格登録 商品規格登録完了後のイベント
  262.      * @param  TemplateEvent $event
  263.      * @return void
  264.      */
  265.     public function adminProductClassRenderBefore(TemplateEvent $event)
  266.     {
  267.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductClassSaveComplete($event);
  268.     }
  269.     /**
  270.      * 商品登録 商品登録画面表示前のイベント
  271.      * @param  TemplateEvent $event
  272.      * @return void
  273.      */
  274.     public function adminProductRenderBefore(TemplateEvent $event)
  275.     {
  276.         $event->addSnippet('@VeriTrans4G2/admin/Product/product_order_comp_mail_info.twig');
  277.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductRenderBefore($event);
  278.     }
  279.     /**
  280.      * カート 表示前のイベント
  281.      * @param  TemplateEvent $event
  282.      * @return void
  283.      */
  284.     public function cartRenderBefore(TemplateEvent $event)
  285.     {
  286.         $event->addSnippet('@VeriTrans4G2/default/Cart/subsc_product_duplicate_warn.twig');
  287.         $this->container->get('vt4g_plugin.service.cart.index_extension')->onCartRenderBefore($event);
  288.     }
  289.     /**
  290.      * 受注CSVまたは出荷CSVダウンロードのイベント
  291.      * @param  EventArgs $event
  292.      * @return void
  293.      */
  294.     public function adminOrderCsvExport(EventArgs $event)
  295.     {
  296.         $this->container->get('vt4g_plugin.service.admin.customer_csv_export_extension')->onOrderOrShippingCsvExport($event);
  297.     }
  298.     /**
  299.      * メール設定 画面表示前のイベント
  300.      */
  301.     public function mailRenderBefore(TemplateEvent $event)
  302.     {
  303.         $this->container->get('vt4g_plugin.service.admin.setting.shop.mail')->onRenderBefore($event);
  304.     }
  305. }