app/Customize/Controller/CustomHelpController.php line 36

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.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 Customize\Controller;
  13. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  14. use Symfony\Component\Routing\Annotation\Route;
  15. use Eccube\Controller\HelpController;
  16. use Eccube\Repository\ProductRepository;
  17. class CustomHelpController extends HelpController
  18. {
  19.     protected $productRepository;
  20.     public function __construct(ProductRepository $productRepository)
  21.     {
  22.         $this->productRepository $productRepository;
  23.     }
  24.     /**
  25.      * 当サイトについて.
  26.      *
  27.      * @Route("/help/about", name="help_about", methods={"GET"})
  28.      * @Template("Help/about.twig")
  29.      */
  30.     public function about()
  31.     {
  32.         $qb $this->productRepository->getQueryBuilderBySearchData([]);
  33.         // is_hiddenフラグで非表示商品を除外
  34.         $qb->andWhere('p.is_hidden = :is_hidden OR p.is_hidden IS NULL')
  35.            ->setParameter('is_hidden'false);
  36.         $qb->orderBy('p.id''ASC');
  37.         $products $qb->getQuery()->getResult();
  38.         $subMapRaw getenv('SUBSCRIPTION_MAP');
  39.         $subMap = [];
  40.         if (!empty($subMapRaw)) {
  41.             $subMapRaw explode(','$subMapRaw);
  42.             foreach ($subMapRaw as $map) {
  43.                 $map explode(':'$map);
  44.                 $subMap[$map[0]] = $map[1];
  45.             }
  46.         }
  47.         return [
  48.             'products' => $products,
  49.             'subMap' => $subMap,
  50.         ];
  51.     }
  52. }