app/Plugin/EccubePaymentLite42/EventListener/EventSubscriber/Front/Mypage/AddFlashBug.php line 17

Open in your IDE?
  1. <?php
  2. namespace Plugin\EccubePaymentLite42\EventListener\EventSubscriber\Front\Mypage;
  3. use Eccube\Event\EccubeEvents;
  4. use Eccube\Event\EventArgs;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. use Symfony\Component\HttpFoundation\RequestStack;
  7. class AddFlashBug implements EventSubscriberInterface
  8. {
  9.     /**
  10.      * @var SessionInterface
  11.      */
  12.     private $session;
  13.     public function __construct(
  14.         RequestStack $requestStack
  15.     ) {
  16.         $this->session $requestStack->getSession();
  17.     }
  18.     public static function getSubscribedEvents()
  19.     {
  20.         return [
  21.             EccubeEvents::FRONT_MYPAGE_CHANGE_INDEX_COMPLETE => 'frontMypageChangeIndexComplete',
  22.             EccubeEvents::FRONT_MYPAGE_DELIVERY_EDIT_COMPLETE => 'frontMypageDeliveryEditComplete',
  23.         ];
  24.     }
  25.     public function frontMypageDeliveryEditComplete(EventArgs $eventArgs)
  26.     {
  27.         $this->session->getFlashBag()->add('eccube.front.warning''定期商品のお届け先は変更されませんのでご注意ください。');
  28.     }
  29.     public function frontMypageChangeIndexComplete(EventArgs $eventArgs)
  30.     {
  31.         $this->session->getFlashBag()->add('eccube.front.warning''定期商品のお届け先は変更されませんのでご注意ください。');
  32.     }
  33. }