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();
}
}