app/Plugin/VeriTrans4G/EventListener/Vt4gEvent.php line 117

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\VeriTrans4G\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.             'VeriTrans4G/Resource/template/default/Mypage/vt4g_account_id.twig' => 'myPageNaviRenderBefore',
  51.             'VeriTrans4G/Resource/template/default/Mypage/vt4g_subsc_payment.twig' => 'myPageNaviRenderBefore',
  52.             'VeriTrans4G/Resource/template/default/Mypage/vt4g_subsc_payment_history.twig' => 'myPageNaviRenderBefore',
  53.             EccubeEvents::ADMIN_SETTING_SHOP_PAYMENT_EDIT_COMPLETE => 'settingShopPaymentEditComplete',
  54.             EccubeEvents::MAIL_ORDER => 'sendOrderMailBefore',
  55.             EccubeEvents::ADMIN_ORDER_MAIL_INDEX_INITIALIZE => 'adminOrderMailInitAfter',
  56.             EccubeEvents::ADMIN_ORDER_EDIT_INDEX_COMPLETE => 'adminOrderEditIndexComplete',
  57.             'Shopping/index.twig' => 'shoppingIndexRenderBefore',
  58.             'Shopping/confirm.twig' => 'shoppingConfirmRenderBefore',
  59.             EccubeEvents::FRONT_MYPAGE_WITHDRAW_INDEX_COMPLETE => 'frontMypageWithdrawComplete',
  60.             EccubeEvents::ADMIN_CUSTOMER_DELETE_COMPLETE => 'adminCustomerDeleteComplete',
  61.             EccubeEvents::ADMIN_CUSTOMER_EDIT_INDEX_COMPLETE => 'adminCustomerEditIndexComplete',
  62.             '@admin/Customer/edit.twig' => 'adminCustomerEditRenderBefore',
  63.             EccubeEvents::ADMIN_CUSTOMER_CSV_EXPORT => 'adminCustomerCsvExport',
  64.             EccubeEvents::FRONT_MYPAGE_MYPAGE_INDEX_SEARCH => 'frontMypageIndexSearch',
  65.             EccubeEvents::ADMIN_PRODUCT_EDIT_COMPLETE => 'adminProductEditComplete',
  66.             EccubeEvents::ADMIN_PRODUCT_DELETE_COMPLETE => 'adminProductDeleteComplete',
  67.             EccubeEvents::ADMIN_PRODUCT_COPY_COMPLETE => 'adminProductCopyComplete',
  68.             '@admin/Product/product_class.twig' => 'adminProductClassRenderBefore',
  69.             '@admin/Product/product.twig' => 'adminProductRenderBefore',
  70.             'Cart/index.twig' => 'cartRenderBefore',
  71.             EccubeEvents::ADMIN_ORDER_CSV_EXPORT_ORDER => 'adminOrderCsvExport',
  72.             EccubeEvents::ADMIN_ORDER_CSV_EXPORT_SHIPPING => 'adminOrderCsvExport',
  73.         ];
  74.     }
  75.     /**
  76.      * 支払方法設定編集画面表示前のイベント
  77.      * @param  TemplateEvent $event
  78.      * @return void
  79.      */
  80.     public function settingShopPaymentRenderBefore(TemplateEvent $event)
  81.     {
  82.         $this->container->get('vt4g_plugin.service.admin.setting_shop_payment')->onRenderBefore($event);
  83.     }
  84.     /**
  85.      * 支払方法一覧画面表示前のイベント(新規登録ボタン追加)
  86.      * @param  TemplateEvent $event
  87.      * @return void
  88.      */
  89.     public function settingShopPaymentAddRegistBtnRenderBefore(TemplateEvent $event)
  90.     {
  91.         $this->container->get('vt4g_plugin.service.admin.setting_shop_payment_add_regist_btn')->onRenderBefore($event);
  92.     }
  93.     /**
  94.      * 支払方法設定(dtb_payment)登録後のイベント
  95.      * @param  EventArgs $event
  96.      * @return void
  97.      */
  98.     public function settingShopPaymentEditComplete(EventArgs $event)
  99.     {
  100.         $this->container->get('vt4g_plugin.service.admin.setting_shop_payment')->onEditCompleteAfter($event);
  101.     }
  102.     /**
  103.      * 注文完了メール送信前のイベント
  104.      * @param  EventArgs $event
  105.      * @return void
  106.      */
  107.     public function sendOrderMailBefore(EventArgs $event)
  108.     {
  109.         $this->container->get('vt4g_plugin.service.mail_message')->onSendOrderMailBefore($event);
  110.     }
  111.     /**
  112.      * 管理画面メール通知(注文完了メール)初期処理後のイベント
  113.      * @param  EventArgs $event
  114.      * @return void
  115.      */
  116.     public function adminOrderMailInitAfter(EventArgs $event)
  117.     {
  118.         $this->container->get('vt4g_plugin.service.mail_message')->onAdminOrderMailInitAfter($event);
  119.     }
  120.     /**
  121.      * 受注管理一覧画面表示前のイベント
  122.      *
  123.      * @param  TemplateEvent $event
  124.      * @return void
  125.      */
  126.     public function orderIndexRenderBefore(TemplateEvent $event)
  127.     {
  128.         $this->container->get('vt4g_plugin.service.admin.order_index_extension')->onRenderBefore($event);
  129.     }
  130.     /**
  131.      * 受注管理詳細画面表示前のイベント
  132.      *
  133.      * @param  TemplateEvent $event
  134.      * @return void
  135.      */
  136.     public function orderEditRenderBefore(TemplateEvent $event)
  137.     {
  138.         $this->container->get('vt4g_plugin.service.admin.order_edit_extension')->onRenderBefore($event);
  139.     }
  140.     /**
  141.      * 受注管理詳細画面更新時のイベント
  142.      *
  143.      * @param  EventArgs $event
  144.      * @return void
  145.      */
  146.     public function adminOrderEditIndexComplete(EventArgs $event)
  147.     {
  148.         $this->container->get('vt4g_plugin.service.admin.order_edit_extension')->onEditComplete($event);
  149.     }
  150.     /**
  151.      * マイページ画面表示前のイベント
  152.      * @param  TemplateEvent $event
  153.      * @return void
  154.      */
  155.     public function myPageNaviRenderBefore(TemplateEvent $event)
  156.     {
  157.         $this->container->get('vt4g_plugin.service.front.mypage_extension')->onRenderBefore($event);
  158.     }
  159.     /**
  160.      * ご注文手続き画面表示前のイベント
  161.      * @param  TemplateEvent $event
  162.      * @return void
  163.      */
  164.     public function shoppingIndexRenderBefore(TemplateEvent $event)
  165.     {
  166.         $this->container->get('vt4g_plugin.service.shopping_index_extension')->onRenderBefore($event);
  167.     }
  168.     /**
  169.      * 注文確認画面表示前のイベント
  170.      * @param  TemplateEvent $event
  171.      * @return void
  172.      */
  173.     public function shoppingConfirmRenderBefore(TemplateEvent $event)
  174.     {
  175.         $this->container->get('vt4g_plugin.service.shopping.confirm')->onRenderBefore($event);
  176.     }
  177.     /**
  178.      * マイページ→退会手続き完了後のイベント
  179.      * @param  TemplateEvent $event
  180.      * @return void
  181.      */
  182.     public function frontMypageWithdrawComplete(EventArgs $event)
  183.     {
  184.         $this->container->get('vt4g_plugin.service.front.mypage.withdraw_extension')->onWithdrawComplete($event);
  185.     }
  186.     /**
  187.      * 管理画面→会員一覧→削除完了後のイベント
  188.      * @param  TemplateEvent $event
  189.      * @return void
  190.      */
  191.     public function adminCustomerDeleteComplete(EventArgs $event)
  192.     {
  193.         $this->container->get('vt4g_plugin.service.admin.customer_index_extension')->onDeleteComplete($event);
  194.     }
  195.     /**
  196.      * 管理画面→会員登録→登録完了後のイベント
  197.      * @param  TemplateEvent $event
  198.      * @return void
  199.      */
  200.     public function adminCustomerEditIndexComplete(EventArgs $event)
  201.     {
  202.         $this->container->get('vt4g_plugin.service.admin.customer_edit_extension')->onEditIndexComplete($event);
  203.     }
  204.     /**
  205.      * 管理画面→会員登録画面表示前のイベント
  206.      * @param  TemplateEvent $event
  207.      * @return void
  208.      */
  209.     public function adminCustomerEditRenderBefore(TemplateEvent $event)
  210.     {
  211.         $this->container->get('vt4g_plugin.service.admin.customer_edit_extension')->onRenderBefore($event);
  212.     }
  213.     /**
  214.      * 会員一覧CSVダウンロードのイベント
  215.      * @param  EventArgs $event
  216.      * @return void
  217.      */
  218.     public function adminCustomerCsvExport(EventArgs $event)
  219.     {
  220.         $this->container->get('vt4g_plugin.service.admin.customer_csv_export_extension')->onCustomerCsvExport($event);
  221.     }
  222.     /**
  223.      * マイページ注文履歴一覧情報取得時のイベント
  224.      * @param  EventArgs $event
  225.      * @return void
  226.      */
  227.     public function frontMypageIndexSearch(EventArgs $event)
  228.     {
  229.         $this->container->get('vt4g_plugin.service.front.mypage_extension')->onMypageIndexSearch($event);
  230.     }
  231.     /**
  232.      * 商品登録 登録完了後のイベント
  233.      * @param  EventArgs $event
  234.      * @return void
  235.      */
  236.     public function adminProductEditComplete(EventArgs $event)
  237.     {
  238.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductEditComplete($event);
  239.     }
  240.     /**
  241.      * 商品登録 削除完了後のイベント
  242.      * @param  EventArgs $event
  243.      * @return void
  244.      */
  245.     public function adminProductDeleteComplete(EventArgs $event)
  246.     {
  247.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductDeleteComplete($event);
  248.     }
  249.     /**
  250.      * 商品一覧 商品情報コピー完了後のイベント
  251.      * @param  EventArgs $event
  252.      * @return void
  253.      */
  254.     public function adminProductCopyComplete(EventArgs $event)
  255.     {
  256.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductCopyComplete($event);
  257.     }
  258.     /**
  259.      * 商品規格登録 商品規格登録完了後のイベント
  260.      * @param  TemplateEvent $event
  261.      * @return void
  262.      */
  263.     public function adminProductClassRenderBefore(TemplateEvent $event)
  264.     {
  265.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductClassSaveComplete($event);
  266.     }
  267.     /**
  268.      * 商品登録 商品登録画面表示前のイベント
  269.      * @param  TemplateEvent $event
  270.      * @return void
  271.      */
  272.     public function adminProductRenderBefore(TemplateEvent $event)
  273.     {
  274.         $event->addSnippet('@VeriTrans4G/admin/Product/product_order_comp_mail_info.twig');
  275.         $this->container->get('vt4g_plugin.service.admin.product.subsc_extension')->onAdminProductRenderBefore($event);
  276.     }
  277.     /**
  278.      * カート 表示前のイベント
  279.      * @param  TemplateEvent $event
  280.      * @return void
  281.      */
  282.     public function cartRenderBefore(TemplateEvent $event)
  283.     {
  284.         $event->addSnippet('@VeriTrans4G/default/Cart/subsc_product_duplicate_warn.twig');
  285.         $this->container->get('vt4g_plugin.service.cart.index_extension')->onCartRenderBefore($event);
  286.     }
  287.     /**
  288.      * 受注CSVまたは出荷CSVダウンロードのイベント
  289.      * @param  EventArgs $event
  290.      * @return void
  291.      */
  292.     public function adminOrderCsvExport(EventArgs $event)
  293.     {
  294.         $this->container->get('vt4g_plugin.service.admin.customer_csv_export_extension')->onOrderOrShippingCsvExport($event);
  295.     }
  296. }