src/Eccube/Controller/ProductController.php line 530

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 Eccube\Controller;
  13. use Eccube\Entity\BaseInfo;
  14. use Eccube\Entity\MailHistory;
  15. use Eccube\Entity\Master\ProductStatus;
  16. use Eccube\Entity\Product;
  17. use Eccube\Event\EccubeEvents;
  18. use Eccube\Event\EventArgs;
  19. use Eccube\Form\Type\AddCartType;
  20. use Eccube\Form\Type\SearchProductType;
  21. use Eccube\Repository\BaseInfoRepository;
  22. use Eccube\Repository\CategoryRepository;
  23. use Eccube\Repository\CustomerFavoriteProductRepository;
  24. use Eccube\Repository\Master\ProductListMaxRepository;
  25. use Eccube\Repository\ProductRepository;
  26. use Eccube\Service\CartService;
  27. use Eccube\Repository\MailHistoryRepository;
  28. use Eccube\Form\Type\Front\MailHistoryType;
  29. use Eccube\Form\Type\Front\ContactType;
  30. use Eccube\Form\Type\Front\ContactMailType;
  31. use Eccube\Service\MailService;
  32. use Eccube\Service\PurchaseFlow\PurchaseContext;
  33. use Eccube\Service\PurchaseFlow\PurchaseFlow;
  34. use Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination;
  35. use Knp\Component\Pager\PaginatorInterface;
  36. use Plugin\ProductReview42\Entity\ProductReview;
  37. use Plugin\ProductReview42\Repository\ProductReviewRepository;
  38. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  39. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  40. use Symfony\Component\HttpFoundation\Request;
  41. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  42. use Symfony\Component\Routing\Annotation\Route;
  43. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  44. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  45. class ProductController extends AbstractController
  46. {
  47.     /**
  48.      * @var PurchaseFlow
  49.      */
  50.     protected $purchaseFlow;
  51.     /**
  52.      * @var CustomerFavoriteProductRepository
  53.      */
  54.     protected $customerFavoriteProductRepository;
  55.     /**
  56.      * @var CartService
  57.      */
  58.     protected $cartService;
  59.     /**
  60.      * @var MailService
  61.      */
  62.     protected $mailService;
  63.     /**
  64.      * @var ProductRepository
  65.      */
  66.     protected $productRepository;
  67.     /**
  68.      * @var BaseInfo
  69.      */
  70.     protected $BaseInfo;
  71.     /**
  72.      * @var AuthenticationUtils
  73.      */
  74.     protected $helper;
  75.     /**
  76.      * @var ProductListMaxRepository
  77.      */
  78.     protected $productListMaxRepository;
  79.     /**
  80.      * @var MailHistoryRepository
  81.      */
  82.     protected $mailHistoryRepository;
  83.     private $title '';
  84.     private CategoryRepository $categoryRepository;
  85.     /**
  86.      * ProductController constructor.
  87.      *
  88.      * @param PurchaseFlow $cartPurchaseFlow
  89.      * @param CustomerFavoriteProductRepository $customerFavoriteProductRepository
  90.      * @param CartService $cartService
  91.      * @param MailService $mailService
  92.      * @param ProductRepository $productRepository
  93.      * @param BaseInfoRepository $baseInfoRepository
  94.      * @param AuthenticationUtils $helper
  95.      * @param ProductListMaxRepository $productListMaxRepository
  96.      * @param ProductReviewRepository $productReviewRepository
  97.      * @param MailHistoryRepository $mailHistoryRepository
  98.      * @param CategoryRepository $categoryRepository
  99.      */
  100.     public function __construct(
  101.         PurchaseFlow                      $cartPurchaseFlow,
  102.         CustomerFavoriteProductRepository $customerFavoriteProductRepository,
  103.         CartService                       $cartService,
  104.         MailService                       $mailService,
  105.         ProductRepository                 $productRepository,
  106.         BaseInfoRepository                $baseInfoRepository,
  107.         AuthenticationUtils               $helper,
  108.         ProductListMaxRepository          $productListMaxRepository,
  109.         ProductReviewRepository           $productReviewRepository,
  110.         MailHistoryRepository             $mailHistoryRepositoryCategoryRepository $categoryRepository,
  111.     )
  112.     {
  113.         $this->purchaseFlow $cartPurchaseFlow;
  114.         $this->customerFavoriteProductRepository $customerFavoriteProductRepository;
  115.         $this->cartService $cartService;
  116.         $this->mailService $mailService;
  117.         $this->productRepository $productRepository;
  118.         $this->BaseInfo $baseInfoRepository->get();
  119.         $this->helper $helper;
  120.         $this->productListMaxRepository $productListMaxRepository;
  121.         $this->productReviewRepository $productReviewRepository;
  122.         $this->mailHistoryRepository $mailHistoryRepository;
  123.         $this->categoryRepository $categoryRepository;
  124.     }
  125.     /**
  126.      * 商品一覧画面.
  127.      *
  128.      * @Route("/products/list", name="product_list", methods={"GET"})
  129.      * @Template("Product/list.twig")
  130.      */
  131.     public function index(Request $requestPaginatorInterface $paginator)
  132.     {
  133.         // Doctrine SQLFilter
  134.         if ($this->BaseInfo->isOptionNostockHidden()) {
  135.             $this->entityManager->getFilters()->enable('option_nostock_hidden');
  136.         }
  137.         // handleRequestは空のqueryの場合は無視するため
  138.         if ($request->getMethod() === 'GET') {
  139.             $request->query->set('pageno'$request->query->get('pageno'''));
  140.         }
  141.         // searchForm
  142.         /* @var $builder \Symfony\Component\Form\FormBuilderInterface */
  143.         $builder $this->formFactory->createNamedBuilder(''SearchProductType::class);
  144.         if ($request->getMethod() === 'GET') {
  145.             $builder->setMethod('GET');
  146.         }
  147.         $event = new EventArgs(
  148.             [
  149.                 'builder' => $builder,
  150.             ],
  151.             $request
  152.         );
  153.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_INDEX_INITIALIZE);
  154.         /* @var $searchForm \Symfony\Component\Form\FormInterface */
  155.         $searchForm $builder->getForm();
  156.         $searchForm->handleRequest($request);
  157.         // paginator
  158.         $searchData $searchForm->getData();
  159.         $qb $this->productRepository->getQueryBuilderBySearchData($searchData);
  160.         $event = new EventArgs(
  161.             [
  162.                 'searchData' => $searchData,
  163.                 'qb' => $qb,
  164.             ],
  165.             $request
  166.         );
  167.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_INDEX_SEARCH);
  168.         $searchData $event->getArgument('searchData');
  169.         $query $qb->getQuery()
  170.             ->useResultCache(true$this->eccubeConfig['eccube_result_cache_lifetime_short']);
  171.         /** @var SlidingPagination $pagination */
  172.         $pagination $paginator->paginate(
  173.             $query,
  174.             !empty($searchData['pageno']) ? $searchData['pageno'] : 1,
  175.             !empty($searchData['disp_number']) ? $searchData['disp_number']->getId() : $this->productListMaxRepository->findOneBy([], ['sort_no' => 'ASC'])->getId()
  176.         );
  177.         $ids = [];
  178.         foreach ($pagination as $key => $Product) {
  179.             $ids[] = $Product->getId();
  180.             $pagination->getItems()[$key]->review $Product->getProductReviewStar();
  181.             $pagination->getItems()[$key]->count $Product->getProductReviewCount();
  182.         }
  183.         $ProductsAndClassCategories $this->productRepository->findProductsWithSortedClassCategories($ids'p.id');
  184.         // addCart form
  185.         $forms = [];
  186.         foreach ($pagination as $Product) {
  187.             /* @var $builder \Symfony\Component\Form\FormBuilderInterface */
  188.             $builder $this->formFactory->createNamedBuilder(
  189.                 '',
  190.                 AddCartType::class,
  191.                 null,
  192.                 [
  193.                     'product' => $ProductsAndClassCategories[$Product->getId()],
  194.                     'allow_extra_fields' => true,
  195.                 ]
  196.             );
  197.             $addCartForm $builder->getForm();
  198.             $forms[$Product->getId()] = $addCartForm->createView();
  199.         }
  200.         $Category $searchForm->get('category_id')->getData();
  201.         $CategoryId $searchForm->get('category_id')->getViewData();
  202.         return [
  203.             'subtitle' => $this->getPageTitle($searchData),
  204.             'pagination' => $pagination,
  205.             'search_form' => $searchForm->createView(),
  206.             'forms' => $forms,
  207.             'Category' => $Category,
  208.             'CategoryId' => $CategoryId
  209.         ];
  210.     }
  211.     /**
  212.      * 閲覧可能な商品かどうかを判定
  213.      *
  214.      * @param Product $Product
  215.      *
  216.      * @return boolean 閲覧可能な場合はtrue
  217.      */
  218.     protected function checkStatus(Product $Product)
  219.     {
  220.         if ($Product->getStatus()->getId() !== ProductStatus::DISPLAY_SHOW) {
  221.             return false;
  222.         }
  223.         return true;
  224.     }
  225.     /**
  226.      * 商品詳細画面.
  227.      *
  228.      * @Route("/products/detail/{id}/{category}", name="product_detail", methods={"GET"}, requirements={"id" = "\d+"})
  229.      * @Template("Product/detail.twig")
  230.      * @ParamConverter("Product", options={"repository_method" = "findWithSortedClassCategories"})
  231.      *
  232.      * @param Request $request
  233.      * @param Product $Product
  234.      * @param integer $category
  235.      *
  236.      * @return array
  237.      */
  238.     public function detail(Request $requestProduct $Product$category null)
  239.     {
  240.         if (!$this->checkStatus($Product)) {
  241.             throw new NotFoundHttpException();
  242.         }
  243.         $Product->setUpdateAccess();
  244.         $this->entityManager->flush();
  245.         if (!$this->checkVisibility($Product)) {
  246.             throw new NotFoundHttpException();
  247.         }
  248.         $builder $this->formFactory->createNamedBuilder(
  249.             '',
  250.             AddCartType::class,
  251.             null,
  252.             [
  253.                 'product' => $Product,
  254.                 'id_add_product_id' => false,
  255.             ]
  256.         );
  257.         $event = new EventArgs(
  258.             [
  259.                 'builder' => $builder,
  260.                 'Product' => $Product,
  261.             ],
  262.             $request
  263.         );
  264.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_DETAIL_INITIALIZE);
  265.         $is_favorite false;
  266.         if ($this->isGranted('ROLE_USER')) {
  267.             $Customer $this->getUser();
  268.             $is_favorite $this->customerFavoriteProductRepository->isFavorite($Customer$Product);
  269.         }
  270.         $productReview $this->productReviewRepository->findBy(['Product' => $Product->getId()]);
  271.         $productReviewAverage $Product->getProductReviewStar();
  272.         if (is_null($category)) {
  273.             $category $Product->getProductCategories()->get(0)['category_id'];
  274.         }
  275.         $categoryData $this->categoryRepository->findBy(['id' => $category]);
  276.         $categoryDataSelect current($categoryData);
  277.         $categoryName $categoryDataSelect->getName();
  278.         return [
  279.             'title' => $this->title,
  280.             'subtitle' => $Product->getName(),
  281.             'form' => $builder->getForm()->createView(),
  282.             'Product' => $Product,
  283.             'is_favorite' => $is_favorite,
  284.             'productReview' => $productReview,
  285.             'productReviewAverage' => $productReviewAverage,
  286.             'category' => $category,
  287.             'categoryName' => $categoryName
  288.         ];
  289.     }
  290.     /**
  291.      * お気に入り追加.
  292.      *
  293.      * @Route("/products/add_favorite/{id}", name="product_add_favorite", requirements={"id" = "\d+"}, methods={"GET", "POST"})
  294.      */
  295.     public function addFavorite(Request $requestProduct $Product)
  296.     {
  297.         $this->checkVisibility($Product);
  298.         $event = new EventArgs(
  299.             [
  300.                 'Product' => $Product,
  301.             ],
  302.             $request
  303.         );
  304.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_FAVORITE_ADD_INITIALIZE);
  305.         if ($this->isGranted('ROLE_USER')) {
  306.             $Customer $this->getUser();
  307.             $this->customerFavoriteProductRepository->addFavorite($Customer$Product);
  308.             $this->session->getFlashBag()->set('product_detail.just_added_favorite'$Product->getId());
  309.             $event = new EventArgs(
  310.                 [
  311.                     'Product' => $Product,
  312.                 ],
  313.                 $request
  314.             );
  315.             $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_FAVORITE_ADD_COMPLETE);
  316.             return $this->redirectToRoute('product_detail', ['id' => $Product->getId()]);
  317.         } else {
  318.             // 非会員の場合、ログイン画面を表示
  319.             //  ログイン後の画面遷移先を設定
  320.             $this->setLoginTargetPath($this->generateUrl('product_add_favorite', ['id' => $Product->getId()], UrlGeneratorInterface::ABSOLUTE_URL));
  321.             $this->session->getFlashBag()->set('eccube.add.favorite'true);
  322.             $event = new EventArgs(
  323.                 [
  324.                     'Product' => $Product,
  325.                 ],
  326.                 $request
  327.             );
  328.             $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_FAVORITE_ADD_COMPLETE);
  329.             return $this->redirectToRoute('mypage_login');
  330.         }
  331.     }
  332.     /**
  333.      * カートに追加.
  334.      *
  335.      * @Route("/products/add_cart/{id}", name="product_add_cart", methods={"POST"}, requirements={"id" = "\d+"})
  336.      */
  337.     public function addCart(Request $requestProduct $Product)
  338.     {
  339.         // エラーメッセージの配列
  340.         $errorMessages = [];
  341.         if (!$this->checkVisibility($Product)) {
  342.             throw new NotFoundHttpException();
  343.         }
  344.         $builder $this->formFactory->createNamedBuilder(
  345.             '',
  346.             AddCartType::class,
  347.             null,
  348.             [
  349.                 'product' => $Product,
  350.                 'id_add_product_id' => false,
  351.             ]
  352.         );
  353.         $event = new EventArgs(
  354.             [
  355.                 'builder' => $builder,
  356.                 'Product' => $Product,
  357.             ],
  358.             $request
  359.         );
  360.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_CART_ADD_INITIALIZE);
  361.         /* @var $form \Symfony\Component\Form\FormInterface */
  362.         $form $builder->getForm();
  363.         $form->handleRequest($request);
  364.         if (!$form->isValid()) {
  365.             throw new NotFoundHttpException();
  366.         }
  367.         $addCartData $form->getData();
  368.         log_info(
  369.             'カート追加処理開始',
  370.             [
  371.                 'product_id' => $Product->getId(),
  372.                 'product_class_id' => $addCartData['product_class_id'],
  373.                 'quantity' => $addCartData['quantity'],
  374.             ]
  375.         );
  376.         // カートへ追加
  377.         $this->cartService->addProduct($addCartData['product_class_id'], $addCartData['quantity']);
  378.         // 明細の正規化
  379.         $Carts $this->cartService->getCarts();
  380.         foreach ($Carts as $Cart) {
  381.             $result $this->purchaseFlow->validate($Cart, new PurchaseContext($Cart$this->getUser()));
  382.             // 復旧不可のエラーが発生した場合は追加した明細を削除.
  383.             if ($result->hasError()) {
  384.                 $this->cartService->removeProduct($addCartData['product_class_id']);
  385.                 foreach ($result->getErrors() as $error) {
  386.                     $errorMessages[] = $error->getMessage();
  387.                 }
  388.             }
  389.             foreach ($result->getWarning() as $warning) {
  390.                 $errorMessages[] = $warning->getMessage();
  391.             }
  392.         }
  393.         $this->cartService->save();
  394.         log_info(
  395.             'カート追加処理完了',
  396.             [
  397.                 'product_id' => $Product->getId(),
  398.                 'product_class_id' => $addCartData['product_class_id'],
  399.                 'quantity' => $addCartData['quantity'],
  400.             ]
  401.         );
  402.         $event = new EventArgs(
  403.             [
  404.                 'form' => $form,
  405.                 'Product' => $Product,
  406.             ],
  407.             $request
  408.         );
  409.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_PRODUCT_CART_ADD_COMPLETE);
  410.         if ($event->getResponse() !== null) {
  411.             return $event->getResponse();
  412.         }
  413.         if ($request->isXmlHttpRequest()) {
  414.             // ajaxでのリクエストの場合は結果をjson形式で返す。
  415.             // 初期化
  416.             $messages = [];
  417.             if (empty($errorMessages)) {
  418.                 // エラーが発生していない場合
  419.                 $done true;
  420.                 array_push($messagestrans('front.product.add_cart_complete'));
  421.             } else {
  422.                 // エラーが発生している場合
  423.                 $done false;
  424.                 $messages $errorMessages;
  425.             }
  426.             return $this->json(['done' => $done'messages' => $messages]);
  427.         } else {
  428.             // ajax以外でのリクエストの場合はカート画面へリダイレクト
  429.             foreach ($errorMessages as $errorMessage) {
  430.                 $this->addRequestError($errorMessage);
  431.             }
  432.             return $this->redirectToRoute('cart');
  433.         }
  434.     }
  435.     /**
  436.      * ページタイトルの設定
  437.      *
  438.      * @param array|null $searchData
  439.      *
  440.      * @return str
  441.      */
  442.     protected function getPageTitle($searchData)
  443.     {
  444.         if (isset($searchData['name']) && !empty($searchData['name'])) {
  445.             return trans('front.product.search_result');
  446.         } elseif (isset($searchData['category_id']) && $searchData['category_id']) {
  447.             return $searchData['category_id']->getName();
  448.         } else {
  449.             return trans('front.product.all_products');
  450.         }
  451.     }
  452.     /**
  453.      * 閲覧可能な商品かどうかを判定
  454.      *
  455.      * @param Product $Product
  456.      *
  457.      * @return boolean 閲覧可能な場合はtrue
  458.      */
  459.     protected function checkVisibility(Product $Product)
  460.     {
  461.         $is_admin $this->session->has('_security_admin');
  462.         // 管理ユーザの場合はステータスやオプションにかかわらず閲覧可能.
  463.         if (!$is_admin) {
  464.             // 在庫なし商品の非表示オプションが有効な場合.
  465.             // if ($this->BaseInfo->isOptionNostockHidden()) {
  466.             //     if (!$Product->getStockFind()) {
  467.             //         return false;
  468.             //     }
  469.             // }
  470.             // 公開ステータスでない商品は表示しない.
  471.             if ($Product->getStatus()->getId() !== ProductStatus::DISPLAY_SHOW) {
  472.                 return false;
  473.             }
  474.         }
  475.         return true;
  476.     }
  477.     /**
  478.      * 商品詳細画面.
  479.      *
  480.      * @Route("/user_data/contact_form/{id}", name="contact_form", methods={"GET", "POST"})
  481.      * @Template("@user_data/contact_form.twig")
  482.      *
  483.      * @param Request $request
  484.      * @param Product $Product
  485.      *
  486.      * @return array
  487.      */
  488.     public function contactForm(Request $requestProduct $Product)
  489.     {
  490.         $MailHistory = new MailHistory();
  491.         $builder $this->formFactory->createBuilder(MailHistoryType::class, $MailHistory);
  492.         $form $builder->getForm();
  493.         $form->handleRequest($request);
  494.         if ($form->isSubmitted() && $form->isValid()) {
  495.             switch ($request->get('mode')) {
  496.                 case 'complete':
  497.                     log_info('お問い合わせ・お申し込み登録開始');
  498.                     $MailHistory $form->getData();
  499.                     $discuss = [];
  500.                     if (isset($request->get('mail_history')['purchase']) && !empty($request->get('mail_history')['purchase'])) {
  501.                         $purchase $request->get('mail_history')['purchase'];
  502.                         array_push($discuss'買取');
  503.                     }
  504.                     if (isset($request->get('mail_history')['inheritance']) && !empty($request->get('mail_history')['inheritance'])) {
  505.                         $inheritance $request->get('mail_history')['inheritance'];
  506.                         array_push($discuss'相続');
  507.                     }
  508.                     if (isset($request->get('mail_history')['reviewing_insurance']) && !empty($request->get('mail_history')['reviewing_insurance'])) {
  509.                         $reviewing_insurance $request->get('mail_history')['reviewing_insurance'];
  510.                         array_push($discuss'保険の見直し');
  511.                     }
  512.                     if (isset($request->get('mail_history')['fire_insurance_application']) && !empty($request->get('mail_history')['fire_insurance_application'])) {
  513.                         $fire_insurance_application $request->get('mail_history')['fire_insurance_application'];
  514.                         array_push($discuss'火災保険の申請');
  515.                     }
  516.                     if (isset($request->get('mail_history')['funeral']) && !empty($request->get('mail_history')['funeral'])) {
  517.                         $funeral $request->get('mail_history')['funeral'];
  518.                         array_push($discuss'お葬式');
  519.                     }
  520.                     if (isset($request->get('mail_history')['cleaning']) && !empty($request->get('mail_history')['cleaning'])) {
  521.                         $cleaning $request->get('mail_history')['cleaning'];
  522.                         array_push($discuss'片づけ');
  523.                     }
  524.                     if (isset($request->get('mail_history')['tree_cutting_pruning']) && !empty($request->get('mail_history')['tree_cutting_pruning'])) {
  525.                         $tree_cutting_pruning $request->get('mail_history')['tree_cutting_pruning'];
  526.                         array_push($discuss'伐採・剪定');
  527.                     }
  528.                     if (isset($request->get('mail_history')['pest_and_vermin_control']) && !empty($request->get('mail_history')['pest_and_vermin_control'])) {
  529.                         $pest_and_vermin_control $request->get('mail_history')['pest_and_vermin_control'];
  530.                         array_push($discuss'害虫・害獣駆除');
  531.                     }
  532.                     if (isset($request->get('mail_history')['wallpaper_floor_renovation']) && !empty($request->get('mail_history')['wallpaper_floor_renovation'])) {
  533.                         $wallpaper_floor_renovation $request->get('mail_history')['wallpaper_floor_renovation'];
  534.                         array_push($discuss'クロスの床リフォーム');
  535.                     }
  536.                     if (isset($request->get('mail_history')['house_cleaning']) && !empty($request->get('mail_history')['house_cleaning'])) {
  537.                         $house_cleaning $request->get('mail_history')['house_cleaning'];
  538.                         array_push($discuss'ハウスクリーニング');
  539.                     }
  540.                     $MailHistory->setUpdateDiscuss($discuss);
  541.                     $this->entityManager->persist($MailHistory);
  542.                     $this->entityManager->flush();
  543.                     log_info('お問い合わせ・お申し込み登録完了');
  544.                     $event = new EventArgs(
  545.                         [
  546.                             'form' => $form,
  547.                             'MailHistory' => $MailHistory,
  548.                         ],
  549.                         $request
  550.                     );
  551.                     $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_ENTRY_INDEX_COMPLETE);
  552.                     // メール送信
  553.                     if (!empty($MailHistory['mail'])) {
  554.                         $this->mailService->sendMailHistoryConfirmMail($MailHistory);
  555.                     }
  556.                     if ($event->hasResponse()) {
  557.                         return $event->getResponse();
  558.                     }
  559.                     log_info('お問い合わせ・お申し込み登録完了画面へリダイレクト');
  560.                     return $this->redirectToRoute('contact_apply');
  561.             }
  562.         }
  563.         return [
  564.             'title' => $this->title,
  565.             'Product' => $Product,
  566.             'form' => $form->createView()
  567.         ];
  568.     }
  569.     /**
  570.      * 会員登録完了画面.
  571.      *
  572.      * @Route("/user_data/contact_apply", name="contact_apply", methods={"GET"})
  573.      * @Template("@user_data/contact_apply.twig")
  574.      */
  575.     public function contactApply()
  576.     {
  577.         return [];
  578.     }
  579. }