Completed
Branch EDTR/master (5c103b)
by
unknown
10:13 queued 38s
created

Tickets::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 49

Duplication

Lines 49
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 49
loc 49
rs 9.1127
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\domain\entities\admin\GraphQLData;
4
5
/**
6
 * Class Tickets
7
 * Description
8
 *
9
 * @package EventEspresso\core\domain\entities\admin\GraphQLData
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13 View Code Duplication
class Tickets extends GraphQLData
14
{
15
16
    /**
17
     * @param array $where_params
18
     * @return array|null
19
     * @since $VID:$
20
     */
21
    public function getData(array $where_params = [])
22
    {
23
        $field_key = lcfirst($this->namespace) . 'Tickets';
24
        $query = <<<QUERY
25
        query GET_TICKETS(\$where: {$this->namespace}RootQueryTicketsConnectionWhereArgs, \$first: Int, \$last: Int ) {
26
            {$field_key}(where: \$where, first: \$first, last: \$last) {
27
                nodes {
28
                    id
29
                    cacheId
30
                    dbId
31
                    description
32
                    endDate
33
                    isDefault
34
                    isExpired
35
                    isFree
36
                    isOnSale
37
                    isPending
38
                    isRequired
39
                    isSoldOut
40
                    isTaxable
41
                    isTrashed
42
                    max
43
                    min
44
                    name
45
                    order
46
                    price
47
                    quantity
48
                    registrationCount
49
                    reserved
50
                    reverseCalculate
51
                    sold
52
                    startDate
53
                    uses
54
                    __typename
55
                }
56
                __typename
57
            }
58
        }
59
QUERY;
60
        $this->setParams([
61
            'operation_name' => 'GET_TICKETS',
62
            'variables'      => [
63
                'first' => 100,
64
            ],
65
            'query'          => $query,
66
        ]);
67
68
        return $this->getQueryResponse($field_key, $where_params);
69
    }
70
}
71