app/Plugin/Api42/GraphQL/Query/OrdersQuery.php line 42

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 Plugin\Api42\GraphQL\Query;
  13. use Eccube\Entity\Order;
  14. use Eccube\Form\Type\Admin\SearchOrderType;
  15. use Eccube\Repository\OrderRepository;
  16. class OrdersQuery extends SearchFormQuery
  17. {
  18.     /**
  19.      * @var OrderRepository
  20.      */
  21.     private $orderRepository;
  22.     /**
  23.      * OrdersQuery constructor.
  24.      *
  25.      * @param $orderRepository
  26.      */
  27.     public function __construct(OrderRepository $orderRepository)
  28.     {
  29.         $this->orderRepository $orderRepository;
  30.     }
  31.     public function getName()
  32.     {
  33.         return 'orders';
  34.     }
  35.     public function getQuery()
  36.     {
  37.         return $this->createQuery(Order::class, SearchOrderType::class, function ($searchData) {
  38.             return $this->orderRepository->getQueryBuilderBySearchDataForAdmin($searchData);
  39.         });
  40.     }
  41. }