@@ -38,8 +38,8 @@ |
||
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'fromType' => 'RootQuery', |
41 | - 'toType' => $this->namespace . 'Attendee', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'Attendees', |
|
41 | + 'toType' => $this->namespace.'Attendee', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace).'Attendees', |
|
43 | 43 | 'connectionTypeName' => "{$this->namespace}RootQueryAttendeesConnection", |
44 | 44 | 'connectionArgs' => self::get_connection_args(), |
45 | 45 | 'resolve' => [$this, 'resolveConnection'], |
@@ -20,128 +20,128 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * AttendeeConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_Attendee $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Attendee $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
23 | + /** |
|
24 | + * AttendeeConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_Attendee $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Attendee $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => 'RootQuery', |
|
41 | - 'toType' => $this->namespace . 'Attendee', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'Attendees', |
|
43 | - 'connectionTypeName' => "{$this->namespace}RootQueryAttendeesConnection", |
|
44 | - 'connectionArgs' => self::get_connection_args(), |
|
45 | - 'resolve' => [$this, 'resolveConnection'], |
|
46 | - ]; |
|
47 | - } |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => 'RootQuery', |
|
41 | + 'toType' => $this->namespace . 'Attendee', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace) . 'Attendees', |
|
43 | + 'connectionTypeName' => "{$this->namespace}RootQueryAttendeesConnection", |
|
44 | + 'connectionArgs' => self::get_connection_args(), |
|
45 | + 'resolve' => [$this, 'resolveConnection'], |
|
46 | + ]; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @param $entity |
|
52 | - * @param $args |
|
53 | - * @param $context |
|
54 | - * @param $info |
|
55 | - * @return AttendeeConnectionResolver |
|
56 | - * @throws Exception |
|
57 | - */ |
|
58 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | - { |
|
60 | - return new AttendeeConnectionResolver($entity, $args, $context, $info); |
|
61 | - } |
|
50 | + /** |
|
51 | + * @param $entity |
|
52 | + * @param $args |
|
53 | + * @param $context |
|
54 | + * @param $info |
|
55 | + * @return AttendeeConnectionResolver |
|
56 | + * @throws Exception |
|
57 | + */ |
|
58 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | + { |
|
60 | + return new AttendeeConnectionResolver($entity, $args, $context, $info); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Given an optional array of args, this returns the args to be used in the connection |
|
65 | - * |
|
66 | - * @param array $args The args to modify the defaults |
|
67 | - * @return array |
|
68 | - */ |
|
69 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | - public static function get_connection_args(array $args = []): array |
|
71 | - { |
|
72 | - $newArgs = [ |
|
73 | - 'datetime' => [ |
|
74 | - 'type' => 'ID', |
|
75 | - 'description' => esc_html__( |
|
76 | - 'Globally unique datetime ID to get the attendees for.', |
|
77 | - 'event_espresso' |
|
78 | - ), |
|
79 | - ], |
|
80 | - 'datetimeIn' => [ |
|
81 | - 'type' => ['list_of' => 'ID'], |
|
82 | - 'description' => esc_html__( |
|
83 | - 'Globally unique datetime IDs to get the attendees for.', |
|
84 | - 'event_espresso' |
|
85 | - ), |
|
86 | - ], |
|
87 | - 'event' => [ |
|
88 | - 'type' => 'ID', |
|
89 | - 'description' => esc_html__( |
|
90 | - 'Globally unique event ID to get the attendees for.', |
|
91 | - 'event_espresso' |
|
92 | - ), |
|
93 | - ], |
|
94 | - 'eventIn' => [ |
|
95 | - 'type' => ['list_of' => 'ID'], |
|
96 | - 'description' => esc_html__( |
|
97 | - 'Globally unique event IDs to get the attendees for.', |
|
98 | - 'event_espresso' |
|
99 | - ), |
|
100 | - ], |
|
101 | - 'orderby' => [ |
|
102 | - 'type' => ['list_of' => 'EspressoAttendeesConnectionOrderbyInput'], |
|
103 | - 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
104 | - ], |
|
105 | - 'regTicket' => [ |
|
106 | - 'type' => 'ID', |
|
107 | - 'description' => esc_html__( |
|
108 | - 'Globally unique registration ticket ID to get the attendees for.', |
|
109 | - 'event_espresso' |
|
110 | - ), |
|
111 | - ], |
|
112 | - 'regTicketIn' => [ |
|
113 | - 'type' => ['list_of' => 'ID'], |
|
114 | - 'description' => esc_html__( |
|
115 | - 'Globally unique registration ticket IDs to get the attendees for.', |
|
116 | - 'event_espresso' |
|
117 | - ), |
|
118 | - ], |
|
119 | - 'regTicketId' => [ |
|
120 | - 'type' => 'Int', |
|
121 | - 'description' => esc_html__('Registration ticket ID to get the attendees for.', 'event_espresso'), |
|
122 | - ], |
|
123 | - 'regTicketIdIn' => [ |
|
124 | - 'type' => ['list_of' => 'Int'], |
|
125 | - 'description' => esc_html__('Registration ticket IDs to get the attendees for.', 'event_espresso'), |
|
126 | - ], |
|
127 | - 'regStatus' => [ |
|
128 | - 'type' => 'EspressoRegistrationStatusEnum', |
|
129 | - 'description' => esc_html__('Limit attendees to registration status.', 'event_espresso'), |
|
130 | - ], |
|
131 | - 'search' => [ |
|
132 | - 'type' => 'String', |
|
133 | - 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
134 | - ], |
|
135 | - ]; |
|
63 | + /** |
|
64 | + * Given an optional array of args, this returns the args to be used in the connection |
|
65 | + * |
|
66 | + * @param array $args The args to modify the defaults |
|
67 | + * @return array |
|
68 | + */ |
|
69 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | + public static function get_connection_args(array $args = []): array |
|
71 | + { |
|
72 | + $newArgs = [ |
|
73 | + 'datetime' => [ |
|
74 | + 'type' => 'ID', |
|
75 | + 'description' => esc_html__( |
|
76 | + 'Globally unique datetime ID to get the attendees for.', |
|
77 | + 'event_espresso' |
|
78 | + ), |
|
79 | + ], |
|
80 | + 'datetimeIn' => [ |
|
81 | + 'type' => ['list_of' => 'ID'], |
|
82 | + 'description' => esc_html__( |
|
83 | + 'Globally unique datetime IDs to get the attendees for.', |
|
84 | + 'event_espresso' |
|
85 | + ), |
|
86 | + ], |
|
87 | + 'event' => [ |
|
88 | + 'type' => 'ID', |
|
89 | + 'description' => esc_html__( |
|
90 | + 'Globally unique event ID to get the attendees for.', |
|
91 | + 'event_espresso' |
|
92 | + ), |
|
93 | + ], |
|
94 | + 'eventIn' => [ |
|
95 | + 'type' => ['list_of' => 'ID'], |
|
96 | + 'description' => esc_html__( |
|
97 | + 'Globally unique event IDs to get the attendees for.', |
|
98 | + 'event_espresso' |
|
99 | + ), |
|
100 | + ], |
|
101 | + 'orderby' => [ |
|
102 | + 'type' => ['list_of' => 'EspressoAttendeesConnectionOrderbyInput'], |
|
103 | + 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
104 | + ], |
|
105 | + 'regTicket' => [ |
|
106 | + 'type' => 'ID', |
|
107 | + 'description' => esc_html__( |
|
108 | + 'Globally unique registration ticket ID to get the attendees for.', |
|
109 | + 'event_espresso' |
|
110 | + ), |
|
111 | + ], |
|
112 | + 'regTicketIn' => [ |
|
113 | + 'type' => ['list_of' => 'ID'], |
|
114 | + 'description' => esc_html__( |
|
115 | + 'Globally unique registration ticket IDs to get the attendees for.', |
|
116 | + 'event_espresso' |
|
117 | + ), |
|
118 | + ], |
|
119 | + 'regTicketId' => [ |
|
120 | + 'type' => 'Int', |
|
121 | + 'description' => esc_html__('Registration ticket ID to get the attendees for.', 'event_espresso'), |
|
122 | + ], |
|
123 | + 'regTicketIdIn' => [ |
|
124 | + 'type' => ['list_of' => 'Int'], |
|
125 | + 'description' => esc_html__('Registration ticket IDs to get the attendees for.', 'event_espresso'), |
|
126 | + ], |
|
127 | + 'regStatus' => [ |
|
128 | + 'type' => 'EspressoRegistrationStatusEnum', |
|
129 | + 'description' => esc_html__('Limit attendees to registration status.', 'event_espresso'), |
|
130 | + ], |
|
131 | + 'search' => [ |
|
132 | + 'type' => 'String', |
|
133 | + 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
134 | + ], |
|
135 | + ]; |
|
136 | 136 | |
137 | - $newArgs = apply_filters( |
|
138 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__attendee_args', |
|
139 | - $newArgs, |
|
140 | - $args |
|
141 | - ); |
|
142 | - return array_merge( |
|
143 | - $newArgs, |
|
144 | - $args |
|
145 | - ); |
|
146 | - } |
|
137 | + $newArgs = apply_filters( |
|
138 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__attendee_args', |
|
139 | + $newArgs, |
|
140 | + $args |
|
141 | + ); |
|
142 | + return array_merge( |
|
143 | + $newArgs, |
|
144 | + $args |
|
145 | + ); |
|
146 | + } |
|
147 | 147 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function __construct() |
26 | 26 | { |
27 | - $this->setName($this->namespace . 'AttendeesConnectionOrderbyInput'); |
|
27 | + $this->setName($this->namespace.'AttendeesConnectionOrderbyInput'); |
|
28 | 28 | $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
29 | 29 | parent::__construct(); |
30 | 30 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | return [ |
40 | 40 | new GraphQLField( |
41 | 41 | 'field', |
42 | - ['non_null' => $this->namespace . 'AttendeesConnectionOrderbyEnum'] |
|
42 | + ['non_null' => $this->namespace.'AttendeesConnectionOrderbyEnum'] |
|
43 | 43 | ), |
44 | 44 | new GraphQLField( |
45 | 45 | 'order', |
@@ -17,31 +17,31 @@ |
||
17 | 17 | class AttendeesConnectionOrderbyInput extends InputBase |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * AttendeesConnectionOrderbyInput constructor. |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
25 | - $this->setName($this->namespace . 'AttendeesConnectionOrderbyInput'); |
|
26 | - $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
|
27 | - parent::__construct(); |
|
28 | - } |
|
20 | + /** |
|
21 | + * AttendeesConnectionOrderbyInput constructor. |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | + $this->setName($this->namespace . 'AttendeesConnectionOrderbyInput'); |
|
26 | + $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
|
27 | + parent::__construct(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * @return GraphQLFieldInterface[] |
|
33 | - */ |
|
34 | - protected function getFields(): array |
|
35 | - { |
|
36 | - return [ |
|
37 | - new GraphQLField( |
|
38 | - 'field', |
|
39 | - ['non_null' => $this->namespace . 'AttendeesConnectionOrderbyEnum'] |
|
40 | - ), |
|
41 | - new GraphQLField( |
|
42 | - 'order', |
|
43 | - 'OrderEnum' |
|
44 | - ), |
|
45 | - ]; |
|
46 | - } |
|
31 | + /** |
|
32 | + * @return GraphQLFieldInterface[] |
|
33 | + */ |
|
34 | + protected function getFields(): array |
|
35 | + { |
|
36 | + return [ |
|
37 | + new GraphQLField( |
|
38 | + 'field', |
|
39 | + ['non_null' => $this->namespace . 'AttendeesConnectionOrderbyEnum'] |
|
40 | + ), |
|
41 | + new GraphQLField( |
|
42 | + 'order', |
|
43 | + 'OrderEnum' |
|
44 | + ), |
|
45 | + ]; |
|
46 | + } |
|
47 | 47 | } |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | class Prices extends GraphQLData |
14 | 14 | { |
15 | 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 |
|
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 | 25 | query GET_PRICES(\$where: {$this->namespace}RootQueryPricesConnectionWhereArgs, \$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(where: \$where, first: \$first, last: \$last) { |
27 | 27 | nodes { |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | QUERY; |
48 | - $this->setParams([ |
|
49 | - 'operation_name' => 'GET_PRICES', |
|
50 | - 'variables' => [ |
|
51 | - 'first' => 100, |
|
52 | - ], |
|
53 | - 'query' => $query, |
|
54 | - ]); |
|
48 | + $this->setParams([ |
|
49 | + 'operation_name' => 'GET_PRICES', |
|
50 | + 'variables' => [ |
|
51 | + 'first' => 100, |
|
52 | + ], |
|
53 | + 'query' => $query, |
|
54 | + ]); |
|
55 | 55 | |
56 | - return $this->getQueryResponse($field_key, $where_params); |
|
57 | - } |
|
56 | + return $this->getQueryResponse($field_key, $where_params); |
|
57 | + } |
|
58 | 58 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function getData(array $where_params = []) |
22 | 22 | { |
23 | - $field_key = lcfirst($this->namespace) . 'Prices'; |
|
23 | + $field_key = lcfirst($this->namespace).'Prices'; |
|
24 | 24 | $query = <<<QUERY |
25 | 25 | query GET_PRICES(\$where: {$this->namespace}RootQueryPricesConnectionWhereArgs, \$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(where: \$where, first: \$first, last: \$last) { |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | class Tickets extends GraphQLData |
14 | 14 | { |
15 | 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 |
|
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 | 25 | query GET_TICKETS(\$where: {$this->namespace}RootQueryTicketsConnectionWhereArgs, \$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(where: \$where, first: \$first, last: \$last) { |
27 | 27 | nodes { |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | QUERY; |
60 | - $this->setParams([ |
|
61 | - 'operation_name' => 'GET_TICKETS', |
|
62 | - 'variables' => [ |
|
63 | - 'first' => 100, |
|
64 | - ], |
|
65 | - 'query' => $query, |
|
66 | - ]); |
|
60 | + $this->setParams([ |
|
61 | + 'operation_name' => 'GET_TICKETS', |
|
62 | + 'variables' => [ |
|
63 | + 'first' => 100, |
|
64 | + ], |
|
65 | + 'query' => $query, |
|
66 | + ]); |
|
67 | 67 | |
68 | - return $this->getQueryResponse($field_key, $where_params); |
|
69 | - } |
|
68 | + return $this->getQueryResponse($field_key, $where_params); |
|
69 | + } |
|
70 | 70 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function getData(array $where_params = []) |
22 | 22 | { |
23 | - $field_key = lcfirst($this->namespace) . 'Tickets'; |
|
23 | + $field_key = lcfirst($this->namespace).'Tickets'; |
|
24 | 24 | $query = <<<QUERY |
25 | 25 | query GET_TICKETS(\$where: {$this->namespace}RootQueryTicketsConnectionWhereArgs, \$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(where: \$where, first: \$first, last: \$last) { |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | class PriceTypes extends GraphQLData |
14 | 14 | { |
15 | 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 |
|
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 | 25 | query GET_PRICE_TYPES(\$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(first: \$first, last: \$last) { |
27 | 27 | nodes { |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | } |
43 | 43 | } |
44 | 44 | QUERY; |
45 | - $this->setParams([ |
|
46 | - 'operation_name' => 'GET_PRICE_TYPES', |
|
47 | - 'variables' => [ |
|
48 | - 'first' => 100, |
|
49 | - ], |
|
50 | - 'query' => $query, |
|
51 | - ]); |
|
45 | + $this->setParams([ |
|
46 | + 'operation_name' => 'GET_PRICE_TYPES', |
|
47 | + 'variables' => [ |
|
48 | + 'first' => 100, |
|
49 | + ], |
|
50 | + 'query' => $query, |
|
51 | + ]); |
|
52 | 52 | |
53 | - return $this->getQueryResponse($field_key, $where_params); |
|
54 | - } |
|
53 | + return $this->getQueryResponse($field_key, $where_params); |
|
54 | + } |
|
55 | 55 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function getData(array $where_params = []) |
22 | 22 | { |
23 | - $field_key = lcfirst($this->namespace) . 'PriceTypes'; |
|
23 | + $field_key = lcfirst($this->namespace).'PriceTypes'; |
|
24 | 24 | $query = <<<QUERY |
25 | 25 | query GET_PRICE_TYPES(\$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(first: \$first, last: \$last) { |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | class Datetimes extends GraphQLData |
14 | 14 | { |
15 | 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 |
|
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 | 25 | query GET_DATETIMES(\$where: {$this->namespace}RootQueryDatetimesConnectionWhereArgs, \$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(where: \$where, first: \$first, last: \$last) { |
27 | 27 | nodes { |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | } |
51 | 51 | } |
52 | 52 | QUERY; |
53 | - $this->setParams([ |
|
54 | - 'operation_name' => 'GET_DATETIMES', |
|
55 | - 'variables' => [ |
|
56 | - 'first' => 100, |
|
57 | - ], |
|
58 | - 'query' => $query, |
|
59 | - ]); |
|
53 | + $this->setParams([ |
|
54 | + 'operation_name' => 'GET_DATETIMES', |
|
55 | + 'variables' => [ |
|
56 | + 'first' => 100, |
|
57 | + ], |
|
58 | + 'query' => $query, |
|
59 | + ]); |
|
60 | 60 | |
61 | - return $this->getQueryResponse($field_key, $where_params); |
|
62 | - } |
|
61 | + return $this->getQueryResponse($field_key, $where_params); |
|
62 | + } |
|
63 | 63 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function getData(array $where_params = []) |
22 | 22 | { |
23 | - $field_key = lcfirst($this->namespace) . 'Datetimes'; |
|
23 | + $field_key = lcfirst($this->namespace).'Datetimes'; |
|
24 | 24 | $query = <<<QUERY |
25 | 25 | query GET_DATETIMES(\$where: {$this->namespace}RootQueryDatetimesConnectionWhereArgs, \$first: Int, \$last: Int ) { |
26 | 26 | {$field_key}(where: \$where, first: \$first, last: \$last) { |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | class GeneralSettings extends GraphQLData |
14 | 14 | { |
15 | 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 = 'generalSettings'; |
|
24 | - $query = <<<QUERY |
|
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 = 'generalSettings'; |
|
24 | + $query = <<<QUERY |
|
25 | 25 | query GET_GENERAL_SETTINGS { |
26 | 26 | {$field_key} { |
27 | 27 | dateFormat |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | } |
32 | 32 | } |
33 | 33 | QUERY; |
34 | - $this->setParams([ |
|
35 | - 'operation_name' => 'GET_GENERAL_SETTINGS', |
|
36 | - 'query' => $query, |
|
37 | - ]); |
|
34 | + $this->setParams([ |
|
35 | + 'operation_name' => 'GET_GENERAL_SETTINGS', |
|
36 | + 'query' => $query, |
|
37 | + ]); |
|
38 | 38 | |
39 | - return $this->getQueryResponse($field_key, $where_params); |
|
40 | - } |
|
39 | + return $this->getQueryResponse($field_key, $where_params); |
|
40 | + } |
|
41 | 41 | } |
@@ -13,151 +13,151 @@ |
||
13 | 13 | interface RequestTypeContextCheckerInterface |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * true if the current request involves some form of activation |
|
18 | - * |
|
19 | - * @return bool |
|
20 | - */ |
|
21 | - public function isActivation(); |
|
16 | + /** |
|
17 | + * true if the current request involves some form of activation |
|
18 | + * |
|
19 | + * @return bool |
|
20 | + */ |
|
21 | + public function isActivation(); |
|
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * @param $is_activation |
|
26 | - */ |
|
27 | - public function setIsActivation($is_activation); |
|
24 | + /** |
|
25 | + * @param $is_activation |
|
26 | + */ |
|
27 | + public function setIsActivation($is_activation); |
|
28 | 28 | |
29 | 29 | |
30 | - /** |
|
31 | - * true if the current request is for the admin and is not being made via AJAX |
|
32 | - * |
|
33 | - * @return bool |
|
34 | - */ |
|
35 | - public function isAdmin(); |
|
30 | + /** |
|
31 | + * true if the current request is for the admin and is not being made via AJAX |
|
32 | + * |
|
33 | + * @return bool |
|
34 | + */ |
|
35 | + public function isAdmin(); |
|
36 | 36 | |
37 | 37 | |
38 | - /** |
|
39 | - * true if the current request is for the admin AND is being made via AJAX |
|
40 | - * and the ajax request contains the request parameter "ee_admin_ajax" |
|
41 | - * |
|
42 | - * @return bool |
|
43 | - */ |
|
44 | - public function isAdminAjax(); |
|
38 | + /** |
|
39 | + * true if the current request is for the admin AND is being made via AJAX |
|
40 | + * and the ajax request contains the request parameter "ee_admin_ajax" |
|
41 | + * |
|
42 | + * @return bool |
|
43 | + */ |
|
44 | + public function isAdminAjax(); |
|
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * true if the current request is being made via AJAX... any AJAX |
|
49 | - * |
|
50 | - * @return bool |
|
51 | - */ |
|
52 | - public function isAjax(); |
|
47 | + /** |
|
48 | + * true if the current request is being made via AJAX... any AJAX |
|
49 | + * |
|
50 | + * @return bool |
|
51 | + */ |
|
52 | + public function isAjax(); |
|
53 | 53 | |
54 | 54 | |
55 | - /** |
|
56 | - * true if the current request is for the EE REST API |
|
57 | - * |
|
58 | - * @return bool |
|
59 | - */ |
|
60 | - public function isApi(); |
|
55 | + /** |
|
56 | + * true if the current request is for the EE REST API |
|
57 | + * |
|
58 | + * @return bool |
|
59 | + */ |
|
60 | + public function isApi(); |
|
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * true if the current request is from the command line |
|
65 | - * |
|
66 | - * @return bool |
|
67 | - */ |
|
68 | - public function isCli(); |
|
63 | + /** |
|
64 | + * true if the current request is from the command line |
|
65 | + * |
|
66 | + * @return bool |
|
67 | + */ |
|
68 | + public function isCli(); |
|
69 | 69 | |
70 | 70 | |
71 | - /** |
|
72 | - * true if the current request is for a WP_Cron |
|
73 | - * |
|
74 | - * @return bool |
|
75 | - */ |
|
76 | - public function isCron(); |
|
71 | + /** |
|
72 | + * true if the current request is for a WP_Cron |
|
73 | + * |
|
74 | + * @return bool |
|
75 | + */ |
|
76 | + public function isCron(); |
|
77 | 77 | |
78 | 78 | |
79 | - /** |
|
80 | - * true if the current request is for either the EE admin or EE frontend AND is being made via AJAX |
|
81 | - * |
|
82 | - * @return bool |
|
83 | - */ |
|
84 | - public function isEeAjax(); |
|
79 | + /** |
|
80 | + * true if the current request is for either the EE admin or EE frontend AND is being made via AJAX |
|
81 | + * |
|
82 | + * @return bool |
|
83 | + */ |
|
84 | + public function isEeAjax(); |
|
85 | 85 | |
86 | 86 | |
87 | - /** |
|
88 | - * true if the current request is for a feed (ie: RSS) |
|
89 | - * |
|
90 | - * @return bool |
|
91 | - */ |
|
92 | - public function isFeed(); |
|
87 | + /** |
|
88 | + * true if the current request is for a feed (ie: RSS) |
|
89 | + * |
|
90 | + * @return bool |
|
91 | + */ |
|
92 | + public function isFeed(); |
|
93 | 93 | |
94 | 94 | |
95 | - /** |
|
96 | - * true if the current request is for the frontend and is not being made via AJAX |
|
97 | - * |
|
98 | - * @return bool |
|
99 | - */ |
|
100 | - public function isFrontend(); |
|
95 | + /** |
|
96 | + * true if the current request is for the frontend and is not being made via AJAX |
|
97 | + * |
|
98 | + * @return bool |
|
99 | + */ |
|
100 | + public function isFrontend(); |
|
101 | 101 | |
102 | 102 | |
103 | - /** |
|
104 | - * @return bool |
|
105 | - */ |
|
106 | - public function isFrontAjax(); |
|
103 | + /** |
|
104 | + * @return bool |
|
105 | + */ |
|
106 | + public function isFrontAjax(); |
|
107 | 107 | |
108 | - /** |
|
109 | - * @return bool |
|
110 | - */ |
|
111 | - public function isGQL(); |
|
108 | + /** |
|
109 | + * @return bool |
|
110 | + */ |
|
111 | + public function isGQL(); |
|
112 | 112 | |
113 | 113 | |
114 | - /** |
|
115 | - * @return bool |
|
116 | - */ |
|
117 | - public function isIframe(); |
|
114 | + /** |
|
115 | + * @return bool |
|
116 | + */ |
|
117 | + public function isIframe(); |
|
118 | 118 | |
119 | 119 | |
120 | - /** |
|
121 | - * true if the current request is being made via AJAX but is NOT for EE related logic |
|
122 | - * |
|
123 | - * @return bool |
|
124 | - */ |
|
125 | - public function isOtherAjax(); |
|
120 | + /** |
|
121 | + * true if the current request is being made via AJAX but is NOT for EE related logic |
|
122 | + * |
|
123 | + * @return bool |
|
124 | + */ |
|
125 | + public function isOtherAjax(); |
|
126 | 126 | |
127 | 127 | |
128 | - /** |
|
129 | - * true if the current request is occurring while unit testing |
|
130 | - * |
|
131 | - * @return bool |
|
132 | - */ |
|
133 | - public function isUnitTesting(); |
|
128 | + /** |
|
129 | + * true if the current request is occurring while unit testing |
|
130 | + * |
|
131 | + * @return bool |
|
132 | + */ |
|
133 | + public function isUnitTesting(); |
|
134 | 134 | |
135 | - /** |
|
136 | - * true if the current request is for the WP REST API |
|
137 | - * |
|
138 | - * @return bool |
|
139 | - */ |
|
140 | - public function isWordPressApi(); |
|
135 | + /** |
|
136 | + * true if the current request is for the WP REST API |
|
137 | + * |
|
138 | + * @return bool |
|
139 | + */ |
|
140 | + public function isWordPressApi(); |
|
141 | 141 | |
142 | 142 | |
143 | - /** |
|
144 | - * true if the current request is being made via AJAX for the WP Heartbeat |
|
145 | - * |
|
146 | - * @return bool |
|
147 | - */ |
|
148 | - public function isWordPressHeartbeat(); |
|
143 | + /** |
|
144 | + * true if the current request is being made via AJAX for the WP Heartbeat |
|
145 | + * |
|
146 | + * @return bool |
|
147 | + */ |
|
148 | + public function isWordPressHeartbeat(); |
|
149 | 149 | |
150 | 150 | |
151 | - /** |
|
152 | - * true if the current request is a loopback sent from WP core to test for errors |
|
153 | - * |
|
154 | - * @return bool |
|
155 | - */ |
|
156 | - public function isWordPressScrape(); |
|
151 | + /** |
|
152 | + * true if the current request is a loopback sent from WP core to test for errors |
|
153 | + * |
|
154 | + * @return bool |
|
155 | + */ |
|
156 | + public function isWordPressScrape(); |
|
157 | 157 | |
158 | 158 | |
159 | - /** |
|
160 | - * @return string |
|
161 | - */ |
|
162 | - public function slug(); |
|
159 | + /** |
|
160 | + * @return string |
|
161 | + */ |
|
162 | + public function slug(); |
|
163 | 163 | } |
@@ -18,60 +18,60 @@ |
||
18 | 18 | class EnumsManager implements GQLManagerInterface |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * @var EnumCollection|EnumInterface[] $enums |
|
23 | - */ |
|
24 | - private $enums; |
|
21 | + /** |
|
22 | + * @var EnumCollection|EnumInterface[] $enums |
|
23 | + */ |
|
24 | + private $enums; |
|
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * EnumsManager constructor. |
|
29 | - * |
|
30 | - * @param EnumCollection|EnumInterface[] $enums |
|
31 | - */ |
|
32 | - public function __construct(EnumCollection $enums) |
|
33 | - { |
|
34 | - $this->enums = $enums; |
|
35 | - } |
|
27 | + /** |
|
28 | + * EnumsManager constructor. |
|
29 | + * |
|
30 | + * @param EnumCollection|EnumInterface[] $enums |
|
31 | + */ |
|
32 | + public function __construct(EnumCollection $enums) |
|
33 | + { |
|
34 | + $this->enums = $enums; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | |
38 | - /** |
|
39 | - * @throws CollectionDetailsException |
|
40 | - * @throws CollectionLoaderException |
|
41 | - * @since $VID:$ |
|
42 | - */ |
|
43 | - public function init() |
|
44 | - { |
|
45 | - $this->enums->loadEnums(); |
|
46 | - add_action('graphql_register_types', [$this, 'configureEnums'], 8); |
|
47 | - } |
|
38 | + /** |
|
39 | + * @throws CollectionDetailsException |
|
40 | + * @throws CollectionLoaderException |
|
41 | + * @since $VID:$ |
|
42 | + */ |
|
43 | + public function init() |
|
44 | + { |
|
45 | + $this->enums->loadEnums(); |
|
46 | + add_action('graphql_register_types', [$this, 'configureEnums'], 8); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @since $VID:$ |
|
52 | - */ |
|
53 | - public function configureEnums() |
|
54 | - { |
|
55 | - // loop through the collection of enums and register their fields |
|
56 | - foreach ($this->enums as $enum) { |
|
57 | - $this->registerEnum($enum); |
|
58 | - } |
|
59 | - } |
|
50 | + /** |
|
51 | + * @since $VID:$ |
|
52 | + */ |
|
53 | + public function configureEnums() |
|
54 | + { |
|
55 | + // loop through the collection of enums and register their fields |
|
56 | + foreach ($this->enums as $enum) { |
|
57 | + $this->registerEnum($enum); |
|
58 | + } |
|
59 | + } |
|
60 | 60 | |
61 | 61 | |
62 | - /** |
|
63 | - * @param EnumInterface $enum |
|
64 | - * @since $VID:$ |
|
65 | - */ |
|
66 | - public function registerEnum(EnumInterface $enum) |
|
67 | - { |
|
68 | - // Register the enum type. |
|
69 | - register_graphql_enum_type( |
|
70 | - $enum->name(), |
|
71 | - [ |
|
72 | - 'description' => $enum->description(), |
|
73 | - 'values' => $enum->values(), |
|
74 | - ] |
|
75 | - ); |
|
76 | - } |
|
62 | + /** |
|
63 | + * @param EnumInterface $enum |
|
64 | + * @since $VID:$ |
|
65 | + */ |
|
66 | + public function registerEnum(EnumInterface $enum) |
|
67 | + { |
|
68 | + // Register the enum type. |
|
69 | + register_graphql_enum_type( |
|
70 | + $enum->name(), |
|
71 | + [ |
|
72 | + 'description' => $enum->description(), |
|
73 | + 'values' => $enum->values(), |
|
74 | + ] |
|
75 | + ); |
|
76 | + } |
|
77 | 77 | } |