app/Plugin/Api42/GraphQL/Query/CustomersQuery.php line 41

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\Customer;
  14. use Eccube\Form\Type\Admin\SearchCustomerType;
  15. use Eccube\Repository\CustomerRepository;
  16. class CustomersQuery extends SearchFormQuery
  17. {
  18.     /**
  19.      * @var CustomerRepository
  20.      */
  21.     private $customerRepository;
  22.     /**
  23.      * CustomersQuery constructor.
  24.      * @param CustomerRepository $customerRepository
  25.      */
  26.     public function __construct(CustomerRepository $customerRepository)
  27.     {
  28.         $this->customerRepository $customerRepository;
  29.     }
  30.     public function getName()
  31.     {
  32.         return 'customers';
  33.     }
  34.     public function getQuery()
  35.     {
  36.         return $this->createQuery(Customer::class, SearchCustomerType::class, function ($searchData) {
  37.             return $this->customerRepository->getQueryBuilderBySearchData($searchData);
  38.         });
  39.     }
  40. }