Completed
Branch add-event-dom-data (6e412b)
by
unknown
32:54 queued 23:24
created

Events   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 60
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 0 53 1
1
<?php
2
3
namespace EventEspresso\core\domain\entities\admin\GraphQLData;
4
5
class Events extends GraphQLData
6
{
7
8
    /**
9
     * @inheritDoc
10
     */
11
    public function getData(array $where_params = [])
12
    {
13
        $field_key = lcfirst($this->namespace) . 'Events';
14
        $query     = <<<QUERY
15
        query GET_EVENTS(\$where: {$this->namespace}RootQueryEventsConnectionWhereArgs, \$first: Int, \$last: Int ) {
16
            {$field_key}(where: \$where, first: \$first, last: \$last) {
17
                nodes {
18
                    id
19
                    dbId
20
                    cacheId
21
                    additionalLimit
22
                    allowOverflow
23
                    created
24
                    description
25
                    displayDescription
26
                    displayTicketSelector
27
                    externalUrl
28
                    isActive
29
                    isCancelled
30
                    isExpired
31
                    isInactive
32
                    isPostponed
33
                    isSoldOut
34
                    isTrashed
35
                    isUpcoming
36
                    memberOnly
37
                    name
38
                    order
39
                    phone
40
                    shortDescription
41
                    status
42
                    timezoneString
43
                    visibleOn
44
                    wpUser
45
                    __typename
46
                }
47
                __typename
48
            }
49
        }
50
QUERY;
51
        $this->setParams(
52
            [
53
                'operation_name' => 'GET_EVENTS',
54
                'variables'      => [
55
                    'first' => 500,
56
                ],
57
                'query'          => $query,
58
            ]
59
        );
60
        \EEH_Debug_Tools::printr($query, '$query', __FILE__, __LINE__);
61
62
        return $this->getQueryResponse($field_key, $where_params);
63
    }
64
}
65