Code Duplication    Length = 43-58 lines in 4 locations

core/domain/entities/admin/GraphQLData/Datetimes.php 1 location

@@ 13-63 (lines=51) @@
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13
class Datetimes 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) . 'Datetimes';
24
        $query = <<<QUERY
25
        query GET_DATETIMES(\$where: {$this->namespace}RootQueryDatetimesConnectionWhereArgs, \$first: Int, \$last: Int ) {
26
            {$field_key}(where: \$where, first: \$first, last: \$last) {
27
                nodes {
28
                    id
29
                    dbId
30
                    cacheId
31
                    capacity
32
                    description
33
                    endDate
34
                    isActive
35
                    isExpired
36
                    isPrimary
37
                    isSoldOut
38
                    isTrashed
39
                    isUpcoming
40
                    length
41
                    name
42
                    order
43
                    reserved
44
                    sold
45
                    status
46
                    startDate
47
                    __typename
48
                }
49
                __typename
50
            }
51
        }
52
QUERY;
53
        $this->setParams([
54
            'operation_name' => 'GET_DATETIMES',
55
            'variables'      => [
56
                'first' => 100,
57
            ],
58
            'query'          => $query,
59
        ]);
60
61
        return $this->getQueryResponse($field_key, $where_params);
62
    }
63
}
64

core/domain/entities/admin/GraphQLData/Prices.php 1 location

@@ 13-58 (lines=46) @@
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13
class Prices 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) . 'Prices';
24
        $query = <<<QUERY
25
        query GET_PRICES(\$where: {$this->namespace}RootQueryPricesConnectionWhereArgs, \$first: Int, \$last: Int ) {
26
            {$field_key}(where: \$where, first: \$first, last: \$last) {
27
                nodes {
28
                    id
29
                    dbId
30
                    amount
31
                    cacheId
32
                    desc
33
                    isBasePrice
34
                    isDefault
35
                    isDiscount
36
                    isPercent
37
                    isTax
38
                    isTrashed
39
                    name
40
                    order
41
                    overrides
42
                    __typename
43
                }
44
                __typename
45
            }
46
        }
47
QUERY;
48
        $this->setParams([
49
            'operation_name' => 'GET_PRICES',
50
            'variables'      => [
51
                'first' => 100,
52
            ],
53
            'query'          => $query,
54
        ]);
55
56
        return $this->getQueryResponse($field_key, $where_params);
57
    }
58
}
59

core/domain/entities/admin/GraphQLData/PriceTypes.php 1 location

@@ 13-55 (lines=43) @@
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13
class PriceTypes 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) . 'PriceTypes';
24
        $query = <<<QUERY
25
        query GET_PRICE_TYPES(\$first: Int, \$last: Int ) {
26
            {$field_key}(first: \$first, last: \$last) {
27
                nodes {
28
                    id
29
                    dbId
30
                    baseType
31
                    cacheId
32
                    isBasePrice
33
                    isDiscount
34
                    isPercent
35
                    isTax
36
                    isTrashed
37
                    name
38
                    order
39
                    __typename
40
                }
41
                __typename
42
            }
43
        }
44
QUERY;
45
        $this->setParams([
46
            'operation_name' => 'GET_PRICE_TYPES',
47
            'variables'      => [
48
                'first' => 100,
49
            ],
50
            'query'          => $query,
51
        ]);
52
53
        return $this->getQueryResponse($field_key, $where_params);
54
    }
55
}
56

core/domain/entities/admin/GraphQLData/Tickets.php 1 location

@@ 13-70 (lines=58) @@
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13
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