app/Plugin/RestockMail/RestockMailEvent.php line 66

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.lockon.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\RestockMail;
  13. use Eccube\Entity\Product;
  14. use Eccube\Event\TemplateEvent;
  15. use Eccube\Repository\Master\ProductStatusRepository;
  16. use Plugin\RestockMail\Entity\RestockMailStatus;
  17. use Plugin\RestockMail\Repository\RestockMailConfigRepository;
  18. use Plugin\RestockMail\Repository\RestockMailRepository;
  19. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  20. class RestockMailEvent implements EventSubscriberInterface
  21. {
  22.     /**
  23.      * @var RestockMailConfigRepository
  24.      */
  25.     protected $productReviewConfigRepository;
  26.     /**
  27.      * @var RestockMailRepository
  28.      */
  29.     protected $productReviewRepository;
  30.     /**
  31.      * RestockMail constructor.
  32.      *
  33.      * @param RestockMailConfigRepository $productReviewConfigRepository
  34.      * @param ProductStatusRepository $productStatusRepository
  35.      * @param RestockMailRepository $productReviewRepository
  36.      */
  37.     public function __construct(
  38.         RestockMailConfigRepository $productReviewConfigRepository,
  39.         ProductStatusRepository $productStatusRepository,
  40.         RestockMailRepository $productReviewRepository
  41.     ) {
  42.         $this->productReviewConfigRepository $productReviewConfigRepository;
  43.         $this->productStatusRepository $productStatusRepository;
  44.         $this->productReviewRepository $productReviewRepository;
  45.     }
  46.     /**
  47.      * @return array
  48.      */
  49.     public static function getSubscribedEvents()
  50.     {
  51.         return [
  52.             'Product/detail.twig' => 'detail',
  53.         ];
  54.     }
  55.     /**
  56.      * @param TemplateEvent $event
  57.      */
  58.     public function detail(TemplateEvent $event)
  59.     {
  60.         $event->addSnippet('@RestockMail/default/index.twig');
  61.         $parameters $event->getParameters();
  62.         $event->setParameters($parameters);
  63.     }
  64. }