app/Customize/Controller/TopController.php line 73

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 Customize\Entity\Master\Genre;
  14. use Customize\Entity\Master\Status;
  15. use Customize\Repository\FaqCategoryRepository;
  16. use Customize\Repository\FaqRepository;
  17. use Customize\Repository\Master\NewsCategoryRepository;
  18. use Customize\Repository\ProductRepository;
  19. use Eccube\Controller\AbstractController;
  20. use Eccube\Repository\NewsRepository;
  21. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  22. use Symfony\Component\Routing\Annotation\Route;
  23. use Knp\Component\Pager\PaginatorInterface;
  24. use Symfony\Component\HttpFoundation\Request;
  25. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  26. class TopController extends AbstractController
  27. {
  28.     /**
  29.      * @var FaqRepository
  30.      */
  31.     protected $faqRepository;
  32.     /**
  33.      * @var FaqCategoryRepository
  34.      */
  35.     protected $faqCategoryRepository;
  36.     /**
  37.      * @var NewsRepository
  38.      */
  39.     protected $newsRepository;
  40.     protected $newsCategoryRepository;
  41.     /**
  42.      * @var ProductRepository
  43.      */
  44.     protected $productRepository;
  45.     public function __construct(
  46.         FaqRepository $faqRepository,
  47.         FaqCategoryRepository $faqCategoryRepository,
  48.         NewsRepository $newsRepository,
  49.         NewsCategoryRepository $newsCategoryRepository,
  50.         ProductRepository $productRepository,
  51.     ) {
  52.         $this->faqRepository $faqRepository;
  53.         $this->newsRepository $newsRepository;
  54.         $this->faqCategoryRepository $faqCategoryRepository;
  55.         $this->newsCategoryRepository $newsCategoryRepository;
  56.         $this->productRepository $productRepository;
  57.     }
  58.     /**
  59.      * @Route("/rock/", name="rock_page", methods={"GET"})
  60.      * @Template("Page/rock.twig")
  61.      */
  62.     public function rock()
  63.     {
  64.         $newReleaseProducts $this->productRepository->getGroupProductListByCategoryIdAndStatusId(114);
  65.         $preOrderProducts $this->productRepository->getGroupProductListByCategoryIdAndStatusId(158);
  66.         
  67.         return [
  68.             'newReleaseProducts' => $newReleaseProducts,
  69.             'preOrderProducts' => $preOrderProducts,
  70.         ];
  71.     }
  72.     /**
  73.      * @Route("/rocktv/", name="rocktv_page", methods={"GET"})
  74.      * @Template("Page/rocktv.twig")
  75.      */
  76.     public function rocktv(Request $requestPaginatorInterface $paginator)
  77.     {
  78.         if ($request->get('category_id')) {
  79.             $categoryId $request->get('category_id');
  80.             $newsCategory $this->newsCategoryRepository->find($categoryId);
  81.             if (!$newsCategory) {
  82.                 throw new NotFoundHttpException();
  83.             }
  84.             $qb $this->newsRepository->getQueryBuilderAll()
  85.                 ->andWhere('n.NewsCategory = :newsCategory')
  86.                 ->setParameter('newsCategory'$newsCategory);
  87.         } else {
  88.             $qb $this->newsRepository->getQueryBuilderAll();
  89.         }
  90.         $page_no $request->get('pageno') ?? 1;
  91.         $pageCount $this->eccubeConfig['eccube_default_page_count'];
  92.         $pagination $paginator->paginate(
  93.             $qb,
  94.             $page_no,
  95.             $pageCount
  96.         );
  97.         return [
  98.             'pagination' => $pagination,
  99.             'page_no' => $page_no,
  100.             'page_count' => $pageCount,
  101.         ];
  102.     }
  103.     /**
  104.      * @Route("/goods/", name="goods_page", methods={"GET"})
  105.      * @Template("Page/goods.twig")
  106.      */
  107.     public function goods()
  108.     {
  109.         $apparelProducts $this->productRepository->getProductListByGenreId(Genre::APPAREL8);
  110.         $goodsProducts $this->productRepository->getProductListByStatusId(Status::GOODS4);
  111.         $wardrecordDirectLimitedProducts $this->productRepository->getProductListByGenreId(Genre::WARD_RECORDS_DIRECT_LIMITED8);
  112.         $booksProducts $this->productRepository->getProductListByStatusId(Status::BOOKS4);
  113.         return [
  114.             'apparelProducts' => $apparelProducts,
  115.             'goodsProducts' => $goodsProducts,
  116.             'wardrecordDirectLimitedProducts' => $wardrecordDirectLimitedProducts,
  117.             'booksProducts' => $booksProducts,
  118.         ];
  119.     }
  120.     /**
  121.      * @Route("/page/liveartist/", name="liveartist_page", methods={"GET"})
  122.      * @Template("Page/liveartist.twig")
  123.      */
  124.     public function liveartist()
  125.     {
  126.         return [];
  127.     }
  128.     /**
  129.      * よくある質問.
  130.      *
  131.      * @Route("/faq", name="faq_page", methods={"GET"})
  132.      * @Template("Page/faq.twig")
  133.      */
  134.     public function faq()
  135.     {
  136.         $faqCategories $this->faqCategoryRepository->findAll();
  137.         return [
  138.             'faqCategories' => $faqCategories,
  139.         ];
  140.     }
  141.     /**
  142.      * @Route("/guide_order/", name="guide_order", methods={"GET"})
  143.      * @Template("Page/guide_order.twig")
  144.      */
  145.     public function guideOrder()
  146.     {
  147.         return [];
  148.     }
  149.     /**
  150.      * @Route("/page/shopping_guide", name="shopping_guide", methods={"GET"})
  151.      * @Template("Page/shopping_guide.twig")
  152.      */
  153.     public function shoppingGuide()
  154.     {
  155.         return [];
  156.     }
  157.     /**
  158.      * @Route("/page/information/kinetv", name="information_kinetv", methods={"GET"})
  159.      * @Template("Page/information_kinetv.twig")
  160.      */
  161.     public function informationKinetv()
  162.     {
  163.         $data = [];
  164.         return $data;
  165.     }
  166.     /**
  167.      * @Route("/page/information", name="information", methods={"GET"})
  168.      * @Template("Page/information.twig")
  169.      */
  170.     public function information()
  171.     {
  172.         $data = [];
  173.         return $data;
  174.     }
  175.     /**
  176.      * @Route("/page/ms_rocktv", name="ms_rocktv", methods={"GET"})
  177.      * @Template("Page/ms_rocktv.twig")
  178.      */
  179.     public function msRocktv()
  180.     {
  181.         return [];
  182.     }
  183.     /**
  184.      * @Route("/page/2024-2025sale", name="sale2025_2024_page", methods={"GET"})
  185.      * @Template("Page/sale2025_2024.twig")
  186.      */
  187.     public function sale2025()
  188.     {
  189.         $data = [];
  190.         return $data;
  191.     }
  192.     /**
  193.      * @Route("/page/form/recruit", name="recruit", methods={"GET"})
  194.      * @Template("Page/recruit.twig")
  195.      */
  196.     public function recruit()
  197.     {
  198.         $data = [];
  199.         return $data;
  200.     }
  201.     /**
  202.      * @Route("/page/lacrymachristi", name="lacrymachristi", methods={"GET"})
  203.      * @Template("Page/lacrymachristi.twig")
  204.      */
  205.     public function lacrymachristi()
  206.     {
  207.         return [];
  208.     }
  209.     /**
  210.      * @Route("/whitesnake", name="whitesnake", methods={"GET"})
  211.      * @Template("whitesnake.twig")
  212.      */
  213.     public function whitesnake()
  214.     {
  215.         return [];
  216.     }
  217.     /**
  218.      * @Route("/the_dead_daisies", name="the_dead_daisies", methods={"GET"})
  219.      * @Template("the_dead_daisies.twig")
  220.      */
  221.     public function theDeadDaisies()
  222.     {
  223.         return [];
  224.     }
  225.     /**
  226.      * @Route("/destinia", name="destinia", methods={"GET"})
  227.      * @Template("destinia.twig")
  228.      */
  229.     public function destinia()
  230.     {
  231.         return [];
  232.     }
  233.     /**
  234.      * @Route("page/special/ms_my_years_with_ufo/instore", name="special_ms_my_years_with_ufo_instore", methods={"GET"})
  235.      * @Template("special.twig")
  236.      */
  237.     public function special()
  238.     {
  239.         return [];
  240.     }
  241.     /**
  242.      * @Route("/page/lacrymachristi_cat/hiro", name="lacrymachristi_cat_hiro", methods={"GET"})
  243.      * @Template("Page/lacrymachristi_cat_hiro.twig")
  244.      */
  245.     public function lacrymachristiCatHiro()
  246.     {
  247.         return [];
  248.     }
  249.     /**
  250.      * @Route("/page/lacrymachristi_cat/kojihiro", name="lacrymachristi_cat_kojihiro", methods={"GET"})
  251.      * @Template("Page/lacrymachristi_cat_kojihiro.twig")
  252.      */
  253.     public function lacrymachristiCatKojihiro()
  254.     {
  255.         return [];
  256.     }
  257.     /**
  258.      * @Route("/page/lacrymachristi_cat/lacryma_christi", name="lacrymachristi_cat_lacryma_christi", methods={"GET"})
  259.      * @Template("Page/lacrymachristi_cat_lacryma_christi.twig")
  260.      */
  261.     public function lacrymachristiCatLacrymaChristi()
  262.     {
  263.         return [];
  264.     }
  265.     /**
  266.      * @Route("/page/lacrymachristi_cat/libraian", name="lacrymachristi_cat_libraian", methods={"GET"})
  267.      * @Template("Page/lacrymachristi_cat_libraian.twig")
  268.      */
  269.     public function lacrymachristiCatLibraian()
  270.     {
  271.         return [];
  272.     }
  273.     /**
  274.      * @Route("/page/lacrymachristi_cat/alvino_koji", name="lacrymachristi_cat_alvino_koji", methods={"GET"})
  275.      * @Template("Page/lacrymachristi_cat_alvino_koji.twig")
  276.      */
  277.     public function lacrymachristiCatAlvinoKoji()
  278.     {
  279.         return [];
  280.     }
  281.     /**
  282.      * @Route("/page/lacrymachristi_cat/shuse_trick", name="lacrymachristi_cat_shuse_trick", methods={"GET"})
  283.      * @Template("Page/lacrymachristi_cat_shuse_trick.twig")
  284.      */
  285.     public function lacrymachristiCatShuseTrick()
  286.     {
  287.         return [];
  288.     }
  289.     /**
  290.      * @Route("/page/lacrymachristi_cat/goods", name="lacrymachristi_cat_goods", methods={"GET"})
  291.      * @Template("Page/lacrymachristi_cat_goods.twig")
  292.      */
  293.     public function lacrymachristiCatGoods()
  294.     {
  295.         return [];
  296.     }
  297.     /**
  298.      * @Route("/page/form/msrocktv", name="form_msrocktv", methods={"GET"})
  299.      * @Template("Page/form_msrocktv.twig")
  300.      */
  301.     public function formMsrocktv()
  302.     {
  303.         return [];
  304.     }
  305.     /**
  306.      * @Route("/page/special/ms_my_years_with_ufo", name="special_ms_my_years_with_ufo", methods={"GET"})
  307.      * @Template("Page/special_ms_my_years_with_ufo.twig")
  308.      */
  309.     public function specialMsMyYearsWithUfo()
  310.     {
  311.         return [];
  312.     }
  313. }