Eccube\Controller\Mypage\MypageController::favorite PHP Method

favorite() public method

お気に入り商品を表示する.
public favorite ( Application $app, Request $request ) : Response
$app Eccube\Application
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response
    public function favorite(Application $app, Request $request)
    {
        $BaseInfo = $app['eccube.repository.base_info']->get();
        if ($BaseInfo->getOptionFavoriteProduct() == Constant::ENABLED) {
            $Customer = $app->user();
            // paginator
            $qb = $app['eccube.repository.customer_favorite_product']->getQueryBuilderByCustomer($Customer);
            $event = new EventArgs(array('qb' => $qb, 'Customer' => $Customer), $request);
            $app['eccube.event.dispatcher']->dispatch(EccubeEvents::FRONT_MYPAGE_MYPAGE_FAVORITE_SEARCH, $event);
            $pagination = $app['paginator']()->paginate($qb, $request->get('pageno', 1), $app['config']['search_pmax'], array('wrap-queries' => true));
            return $app->render('Mypage/favorite.twig', array('pagination' => $pagination));
        } else {
            throw new NotFoundHttpException();
        }
    }