app/Plugin/CheckProduct42/Controller/Block/CheckProductController.php line 55

Open in your IDE?
  1. <?php
  2. /*
  3.  * Copyright(c) 2019 SYSTEM FRIEND INC.
  4.  */
  5. namespace Plugin\CheckProduct42\Controller\Block;
  6. use Eccube\Controller\AbstractController;
  7. use Plugin\CheckProduct42\Service\CheckProductService;
  8. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  9. use Symfony\Component\HttpFoundation\Request;
  10. use Symfony\Component\Routing\Annotation\Route;
  11. use Plugin\CustomerRank42\Repository\CustomerPriceRepository;
  12. use Plugin\ProductPlus42\Repository\ProductDataDetailRepository;
  13. class CheckProductController extends AbstractController
  14. {
  15.   protected CheckProductService $checkProductService;
  16.   /**
  17.    * @var CustomerPriceRepository
  18.    */
  19.   protected $customerPriceRepository;
  20.   /**
  21.    * @var ProductDataDetailRepository
  22.    */
  23.   protected $productDataDetailRepository;
  24.   /**
  25.    * CheckProductController constructor.
  26.    *
  27.    * @param CheckProductService $checkProductService
  28.    * @param CustomerPriceRepository $customerPriceRepository
  29.    * @param ProductDataDetailRepository $productDataDetailRepository
  30.    */
  31.   public function __construct(
  32.     CheckProductService $checkProductService,
  33.     CustomerPriceRepository $customerPriceRepository,
  34.     ProductDataDetailRepository $productDataDetailRepository
  35.   ){
  36.     $this->checkProductService $checkProductService;
  37.     $this->customerPriceRepository $customerPriceRepository;
  38.     $this->productDataDetailRepository $productDataDetailRepository;
  39.   }
  40.   /**
  41.    * @Route("/block/check_product42", name="block_check_product42")
  42.    * @Template("Block/check_product42.twig")
  43.    *
  44.    * @param Request $request
  45.    * @return array
  46.    */
  47.   public function index(Request $request){
  48.     return [
  49.       'CheckProducts' => $this->checkProductService->getCheckProducts(),
  50.       'htPrice' => $this->customerPriceRepository->getHashPrice(2),
  51.       'htMeyasu' => $this->productDataDetailRepository->getHash("55"),
  52.     ];
  53.   }
  54. }