app/Plugin/HiddenDeliveryDate42/Event/DeliveryDateEvent.php line 39

Open in your IDE?
  1. <?php
  2. /*
  3. * Plugin Name : HiddenDeliveryDate
  4. *
  5. * Copyright (C) BraTech Co., Ltd. All Rights Reserved.
  6. * http://www.bratech.co.jp/
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Plugin\HiddenDeliveryDate42\Event;
  12. use Eccube\Event\EventArgs;
  13. use Plugin\HiddenDeliveryDate42\Service\ShoppingService;
  14. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  15. class DeliveryDateEvent implements EventSubscriberInterface
  16. {
  17.     private $shoppingService;
  18.     public function __construct(
  19.             ShoppingService $shoppingService
  20.             )
  21.     {
  22.         $this->shoppingService $shoppingService;
  23.     }
  24.     /**
  25.      * @return array
  26.      */
  27.     public static function getSubscribedEvents()
  28.     {
  29.         return [
  30.             'deliverydate.getformdeliverydates' => 'hookGetDeliveryDates',
  31.         ];
  32.     }
  33.     public function hookGetDeliveryDates(EventArgs $event)
  34.     {
  35.         $deliveryDates $event->getArgument('deliveryDates');
  36.         $Shipping $event->getArgument('Shipping');
  37.         $attrs $this->shoppingService->getHiddenDeliveryAttrs($deliveryDates$Shipping);
  38.         $event->setArgument('attrs'$attrs);
  39.     }
  40. }