Completed
Branch barista (8c74ff)
by
unknown
42:46 queued 33:44
created

Event::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 50

Duplication

Lines 50
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 50
loc 50
rs 9.0909
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\domain\entities\admin\GraphQLData;
4
5 View Code Duplication
class Event extends GraphQLData
6
{
7
8
    /**
9
     * @inheritDoc
10
     */
11
    public function getData(array $params = [])
12
    {
13
        $field_key = lcfirst($this->namespace) . 'Event';
14
        $query     = <<<QUERY
15
        query GET_EVENT(\$id: ID!) {
16
            {$field_key}(id: \$id, idType: DATABASE_ID) {
17
                id
18
                dbId
19
                cacheId
20
                allowDonations
21
                allowOverflow
22
                altRegPage
23
                created
24
                description
25
                displayDescription
26
                displayTicketSelector
27
                isActive
28
                isCancelled
29
                isExpired
30
                isInactive
31
                isPostponed
32
                isSoldOut
33
                isUpcoming
34
                maxRegistrations
35
                memberOnly
36
                name
37
                order
38
                phoneNumber
39
                shortDescription
40
                status
41
                timezoneString
42
                visibleOn
43
                wpUser {
44
                    id
45
                    name
46
                }
47
                __typename
48
            }
49
        }
50
QUERY;
51
        $this->setParams(
52
            [
53
                'operation_name' => 'GET_EVENT',
54
                'variables'      => $params,
55
                'query'          => $query,
56
            ]
57
        );
58
59
        return $this->getQueryResponse($field_key);
60
    }
61
}
62