app/Plugin/StripePaymentGateway42/Controller/Admin/LogController.php line 45

Open in your IDE?
  1. <?php
  2. /*
  3. * Plugin Name : StripePaymentGateway42
  4. *
  5. * Copyright (C) 2018 Subspire Inc. All Rights Reserved.
  6. * http://www.subspire.co.jp/
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Plugin\StripePaymentGateway42\Controller\Admin;
  12. use Eccube\Controller\AbstractController;
  13. use Plugin\StripePaymentGateway42\Repository\StripeLogRepository;
  14. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  15. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  16. use Symfony\Component\HttpFoundation\Request;
  17. use Symfony\Component\HttpFoundation\Response;
  18. use Knp\Component\Pager\PaginatorInterface;
  19. class LogController extends AbstractController
  20. {
  21.     /**
  22.      * @var StripeLogRepository
  23.      */
  24.     protected $stripeLogRepository;
  25.     /**
  26.      * ConfigController constructor.
  27.      *
  28.      * @param StripeLogRepository $stripeLogRepository
  29.      */
  30.     public function __construct(StripeLogRepository $stripeLogRepository)
  31.     {
  32.         $this->stripeLogRepository $stripeLogRepository;
  33.     }
  34.     /**
  35.      * @Route("/%eccube_admin_route%/stripe_payment_gateway/log", name="stripe_payment_gateway_admin_log")
  36.      * @Route("/%eccube_admin_route%/stripe_payment_gateway/page/{page_no}", requirements={"page_no" = "\d+"}, name="stripe_payment_gateway_admin_log_page")
  37.      * @Template("@StripePaymentGateway42/admin/stripe_log.twig")
  38.      */
  39.     public function index(Request $request$page_no nullPaginatorInterface $paginator)
  40.     {
  41.         $page_count $this->eccubeConfig->get('eccube_default_page_count');
  42.         if($page_no){
  43.         } else {
  44.             $page_no=1;
  45.         }
  46.         $qb $this->entityManager->createQueryBuilder();
  47.         $qb->select('s')->from('Plugin\StripePaymentGateway42\Entity\StripeLog''s')->orderBy('s.id','DESC');
  48.         $pagination $paginator->paginate(
  49.             $qb,
  50.             $page_no,
  51.             $page_count
  52.         );
  53.         return [
  54.             'pagination' => $pagination
  55.         ];
  56.     }
  57. }