<?php
/*
* Plugin Name : StripePaymentGateway42
*
* Copyright (C) 2018 Subspire Inc. All Rights Reserved.
* http://www.subspire.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\StripePaymentGateway42\Controller\Admin;
use Eccube\Controller\AbstractController;
use Plugin\StripePaymentGateway42\Repository\StripeLogRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Knp\Component\Pager\PaginatorInterface;
class LogController extends AbstractController
{
/**
* @var StripeLogRepository
*/
protected $stripeLogRepository;
/**
* ConfigController constructor.
*
* @param StripeLogRepository $stripeLogRepository
*/
public function __construct(StripeLogRepository $stripeLogRepository)
{
$this->stripeLogRepository = $stripeLogRepository;
}
/**
* @Route("/%eccube_admin_route%/stripe_payment_gateway/log", name="stripe_payment_gateway_admin_log")
* @Route("/%eccube_admin_route%/stripe_payment_gateway/page/{page_no}", requirements={"page_no" = "\d+"}, name="stripe_payment_gateway_admin_log_page")
* @Template("@StripePaymentGateway42/admin/stripe_log.twig")
*/
public function index(Request $request, $page_no = null, PaginatorInterface $paginator)
{
$page_count = $this->eccubeConfig->get('eccube_default_page_count');
if($page_no){
} else {
$page_no=1;
}
$qb = $this->entityManager->createQueryBuilder();
$qb->select('s')->from('Plugin\StripePaymentGateway42\Entity\StripeLog', 's')->orderBy('s.id','DESC');
$pagination = $paginator->paginate(
$qb,
$page_no,
$page_count
);
return [
'pagination' => $pagination
];
}
}