@@ -37,8 +37,8 @@ |
||
37 | 37 | public function config(): array |
38 | 38 | { |
39 | 39 | return [ |
40 | - 'fromType' => $this->namespace . 'Datetime', |
|
41 | - 'toType' => $this->namespace . 'Ticket', |
|
40 | + 'fromType' => $this->namespace.'Datetime', |
|
41 | + 'toType' => $this->namespace.'Ticket', |
|
42 | 42 | 'fromFieldName' => 'tickets', |
43 | 43 | 'connectionTypeName' => "{$this->namespace}DatetimeTicketsConnection", |
44 | 44 | 'connectionArgs' => self::get_connection_args(), |
@@ -18,127 +18,127 @@ |
||
18 | 18 | */ |
19 | 19 | class DatetimeTicketsConnection extends ConnectionBase |
20 | 20 | { |
21 | - /** |
|
22 | - * DatetimeConnection constructor. |
|
23 | - * |
|
24 | - * @param EEM_Ticket $model |
|
25 | - */ |
|
26 | - public function __construct(EEM_Ticket $model) |
|
27 | - { |
|
28 | - parent::__construct($model); |
|
29 | - } |
|
21 | + /** |
|
22 | + * DatetimeConnection constructor. |
|
23 | + * |
|
24 | + * @param EEM_Ticket $model |
|
25 | + */ |
|
26 | + public function __construct(EEM_Ticket $model) |
|
27 | + { |
|
28 | + parent::__construct($model); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function config(): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'fromType' => $this->namespace . 'Datetime', |
|
39 | - 'toType' => $this->namespace . 'Ticket', |
|
40 | - 'fromFieldName' => 'tickets', |
|
41 | - 'connectionTypeName' => "{$this->namespace}DatetimeTicketsConnection", |
|
42 | - 'connectionArgs' => self::get_connection_args(), |
|
43 | - 'resolve' => [$this, 'resolveConnection'], |
|
44 | - ]; |
|
45 | - } |
|
32 | + /** |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function config(): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'fromType' => $this->namespace . 'Datetime', |
|
39 | + 'toType' => $this->namespace . 'Ticket', |
|
40 | + 'fromFieldName' => 'tickets', |
|
41 | + 'connectionTypeName' => "{$this->namespace}DatetimeTicketsConnection", |
|
42 | + 'connectionArgs' => self::get_connection_args(), |
|
43 | + 'resolve' => [$this, 'resolveConnection'], |
|
44 | + ]; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * @param $entity |
|
50 | - * @param $args |
|
51 | - * @param $context |
|
52 | - * @param $info |
|
53 | - * @return array|Deferred|mixed |
|
54 | - * @throws Exception |
|
55 | - */ |
|
56 | - public function resolveConnection($entity, $args, $context, $info) |
|
57 | - { |
|
58 | - $resolver = new TicketConnectionResolver($entity, $args, $context, $info); |
|
59 | - return $resolver->get_connection(); |
|
60 | - } |
|
48 | + /** |
|
49 | + * @param $entity |
|
50 | + * @param $args |
|
51 | + * @param $context |
|
52 | + * @param $info |
|
53 | + * @return array|Deferred|mixed |
|
54 | + * @throws Exception |
|
55 | + */ |
|
56 | + public function resolveConnection($entity, $args, $context, $info) |
|
57 | + { |
|
58 | + $resolver = new TicketConnectionResolver($entity, $args, $context, $info); |
|
59 | + return $resolver->get_connection(); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * Given an optional array of args, this returns the args to be used in the connection |
|
64 | - * |
|
65 | - * @param array $args The args to modify the defaults |
|
66 | - * @return array |
|
67 | - */ |
|
68 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
69 | - public static function get_connection_args(array $args = []): array |
|
70 | - { |
|
71 | - $newArgs = [ |
|
72 | - 'orderby' => [ |
|
73 | - 'type' => ['list_of' => 'EspressoTicketsConnectionOrderbyInput'], |
|
74 | - 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
75 | - ], |
|
76 | - 'datetime' => [ |
|
77 | - 'type' => 'ID', |
|
78 | - 'description' => esc_html__('Globally unique datetime ID to get the tickets for.', 'event_espresso'), |
|
79 | - ], |
|
80 | - 'datetimeIn' => [ |
|
81 | - 'type' => ['list_of' => 'ID'], |
|
82 | - 'description' => esc_html__('Globally unique datetime IDs to get the tickets for.', 'event_espresso'), |
|
83 | - ], |
|
84 | - 'datetimeId' => [ |
|
85 | - 'type' => 'Int', |
|
86 | - 'description' => esc_html__('Datetime ID to get the tickets for.', 'event_espresso'), |
|
87 | - ], |
|
88 | - 'datetimeIdIn' => [ |
|
89 | - 'type' => ['list_of' => 'Int'], |
|
90 | - 'description' => esc_html__('Datetime IDs to get the tickets for.', 'event_espresso'), |
|
91 | - ], |
|
92 | - 'event' => [ |
|
93 | - 'type' => 'ID', |
|
94 | - 'description' => esc_html__('Globally unique event ID to get the tickets for.', 'event_espresso'), |
|
95 | - ], |
|
96 | - 'eventIn' => [ |
|
97 | - 'type' => ['list_of' => 'ID'], |
|
98 | - 'description' => esc_html__('Globally unique event IDs to get the tickets for.', 'event_espresso'), |
|
99 | - ], |
|
100 | - 'eventId' => [ |
|
101 | - 'type' => 'Int', |
|
102 | - 'description' => esc_html__('Event ID to get the tickets for.', 'event_espresso'), |
|
103 | - ], |
|
104 | - 'eventIdIn' => [ |
|
105 | - 'type' => ['list_of' => 'Int'], |
|
106 | - 'description' => esc_html__('Event IDs to get the tickets for.', 'event_espresso'), |
|
107 | - ], |
|
108 | - 'includeDefaultTickets' => [ |
|
109 | - 'type' => 'Boolean', |
|
110 | - 'description' => esc_html__('Whether to add default tickets to the list.', 'event_espresso'), |
|
111 | - ], |
|
112 | - 'search' => [ |
|
113 | - 'type' => 'String', |
|
114 | - 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
115 | - ], |
|
116 | - 'isDefault' => [ |
|
117 | - 'type' => 'Boolean', |
|
118 | - 'description' => esc_html__('Filter the default tickets', 'event_espresso'), |
|
119 | - ], |
|
120 | - 'isRequired' => [ |
|
121 | - 'type' => 'Boolean', |
|
122 | - 'description' => esc_html__('Filter the required tickets', 'event_espresso'), |
|
123 | - ], |
|
124 | - 'isTaxable' => [ |
|
125 | - 'type' => 'Boolean', |
|
126 | - 'description' => esc_html__('Filter the taxable tickets', 'event_espresso'), |
|
127 | - ], |
|
128 | - 'isTrashed' => [ |
|
129 | - 'type' => 'Boolean', |
|
130 | - 'description' => esc_html__('Filter the trashed tickets', 'event_espresso'), |
|
131 | - ], |
|
132 | - ]; |
|
62 | + /** |
|
63 | + * Given an optional array of args, this returns the args to be used in the connection |
|
64 | + * |
|
65 | + * @param array $args The args to modify the defaults |
|
66 | + * @return array |
|
67 | + */ |
|
68 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
69 | + public static function get_connection_args(array $args = []): array |
|
70 | + { |
|
71 | + $newArgs = [ |
|
72 | + 'orderby' => [ |
|
73 | + 'type' => ['list_of' => 'EspressoTicketsConnectionOrderbyInput'], |
|
74 | + 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
75 | + ], |
|
76 | + 'datetime' => [ |
|
77 | + 'type' => 'ID', |
|
78 | + 'description' => esc_html__('Globally unique datetime ID to get the tickets for.', 'event_espresso'), |
|
79 | + ], |
|
80 | + 'datetimeIn' => [ |
|
81 | + 'type' => ['list_of' => 'ID'], |
|
82 | + 'description' => esc_html__('Globally unique datetime IDs to get the tickets for.', 'event_espresso'), |
|
83 | + ], |
|
84 | + 'datetimeId' => [ |
|
85 | + 'type' => 'Int', |
|
86 | + 'description' => esc_html__('Datetime ID to get the tickets for.', 'event_espresso'), |
|
87 | + ], |
|
88 | + 'datetimeIdIn' => [ |
|
89 | + 'type' => ['list_of' => 'Int'], |
|
90 | + 'description' => esc_html__('Datetime IDs to get the tickets for.', 'event_espresso'), |
|
91 | + ], |
|
92 | + 'event' => [ |
|
93 | + 'type' => 'ID', |
|
94 | + 'description' => esc_html__('Globally unique event ID to get the tickets for.', 'event_espresso'), |
|
95 | + ], |
|
96 | + 'eventIn' => [ |
|
97 | + 'type' => ['list_of' => 'ID'], |
|
98 | + 'description' => esc_html__('Globally unique event IDs to get the tickets for.', 'event_espresso'), |
|
99 | + ], |
|
100 | + 'eventId' => [ |
|
101 | + 'type' => 'Int', |
|
102 | + 'description' => esc_html__('Event ID to get the tickets for.', 'event_espresso'), |
|
103 | + ], |
|
104 | + 'eventIdIn' => [ |
|
105 | + 'type' => ['list_of' => 'Int'], |
|
106 | + 'description' => esc_html__('Event IDs to get the tickets for.', 'event_espresso'), |
|
107 | + ], |
|
108 | + 'includeDefaultTickets' => [ |
|
109 | + 'type' => 'Boolean', |
|
110 | + 'description' => esc_html__('Whether to add default tickets to the list.', 'event_espresso'), |
|
111 | + ], |
|
112 | + 'search' => [ |
|
113 | + 'type' => 'String', |
|
114 | + 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
115 | + ], |
|
116 | + 'isDefault' => [ |
|
117 | + 'type' => 'Boolean', |
|
118 | + 'description' => esc_html__('Filter the default tickets', 'event_espresso'), |
|
119 | + ], |
|
120 | + 'isRequired' => [ |
|
121 | + 'type' => 'Boolean', |
|
122 | + 'description' => esc_html__('Filter the required tickets', 'event_espresso'), |
|
123 | + ], |
|
124 | + 'isTaxable' => [ |
|
125 | + 'type' => 'Boolean', |
|
126 | + 'description' => esc_html__('Filter the taxable tickets', 'event_espresso'), |
|
127 | + ], |
|
128 | + 'isTrashed' => [ |
|
129 | + 'type' => 'Boolean', |
|
130 | + 'description' => esc_html__('Filter the trashed tickets', 'event_espresso'), |
|
131 | + ], |
|
132 | + ]; |
|
133 | 133 | |
134 | - $newArgs = apply_filters( |
|
135 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__ticket_args', |
|
136 | - $newArgs, |
|
137 | - $args |
|
138 | - ); |
|
139 | - return array_merge( |
|
140 | - $newArgs, |
|
141 | - $args |
|
142 | - ); |
|
143 | - } |
|
134 | + $newArgs = apply_filters( |
|
135 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__ticket_args', |
|
136 | + $newArgs, |
|
137 | + $args |
|
138 | + ); |
|
139 | + return array_merge( |
|
140 | + $newArgs, |
|
141 | + $args |
|
142 | + ); |
|
143 | + } |
|
144 | 144 | } |
@@ -35,8 +35,8 @@ |
||
35 | 35 | public function config(): array |
36 | 36 | { |
37 | 37 | return [ |
38 | - 'fromType' => $this->namespace . 'Ticket', |
|
39 | - 'toType' => $this->namespace . 'Price', |
|
38 | + 'fromType' => $this->namespace.'Ticket', |
|
39 | + 'toType' => $this->namespace.'Price', |
|
40 | 40 | 'fromFieldName' => 'prices', |
41 | 41 | 'connectionTypeName' => "{$this->namespace}TicketPricesConnection", |
42 | 42 | 'connectionArgs' => TicketPricesConnection::get_connection_args(), |
@@ -18,132 +18,132 @@ |
||
18 | 18 | */ |
19 | 19 | class TicketPricesConnection extends ConnectionBase |
20 | 20 | { |
21 | - /** |
|
22 | - * TicketConnection constructor. |
|
23 | - * |
|
24 | - * @param EEM_Price $model |
|
25 | - */ |
|
26 | - public function __construct(EEM_Price $model) |
|
27 | - { |
|
28 | - parent::__construct($model); |
|
29 | - } |
|
21 | + /** |
|
22 | + * TicketConnection constructor. |
|
23 | + * |
|
24 | + * @param EEM_Price $model |
|
25 | + */ |
|
26 | + public function __construct(EEM_Price $model) |
|
27 | + { |
|
28 | + parent::__construct($model); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function config(): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'fromType' => $this->namespace . 'Ticket', |
|
39 | - 'toType' => $this->namespace . 'Price', |
|
40 | - 'fromFieldName' => 'prices', |
|
41 | - 'connectionTypeName' => "{$this->namespace}TicketPricesConnection", |
|
42 | - 'connectionArgs' => TicketPricesConnection::get_connection_args(), |
|
43 | - 'resolve' => [$this, 'resolveConnection'], |
|
44 | - ]; |
|
45 | - } |
|
32 | + /** |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function config(): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'fromType' => $this->namespace . 'Ticket', |
|
39 | + 'toType' => $this->namespace . 'Price', |
|
40 | + 'fromFieldName' => 'prices', |
|
41 | + 'connectionTypeName' => "{$this->namespace}TicketPricesConnection", |
|
42 | + 'connectionArgs' => TicketPricesConnection::get_connection_args(), |
|
43 | + 'resolve' => [$this, 'resolveConnection'], |
|
44 | + ]; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * @param $entity |
|
50 | - * @param $args |
|
51 | - * @param $context |
|
52 | - * @param $info |
|
53 | - * @return array|Deferred|mixed |
|
54 | - * @throws Exception |
|
55 | - */ |
|
56 | - public function resolveConnection($entity, $args, $context, $info) |
|
57 | - { |
|
58 | - $resolver = new PriceConnectionResolver($entity, $args, $context, $info); |
|
59 | - return $resolver->get_connection(); |
|
60 | - } |
|
48 | + /** |
|
49 | + * @param $entity |
|
50 | + * @param $args |
|
51 | + * @param $context |
|
52 | + * @param $info |
|
53 | + * @return array|Deferred|mixed |
|
54 | + * @throws Exception |
|
55 | + */ |
|
56 | + public function resolveConnection($entity, $args, $context, $info) |
|
57 | + { |
|
58 | + $resolver = new PriceConnectionResolver($entity, $args, $context, $info); |
|
59 | + return $resolver->get_connection(); |
|
60 | + } |
|
61 | 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 | - 'in' => [ |
|
74 | - 'type' => ['list_of' => 'ID'], |
|
75 | - 'description' => esc_html__('Limit prices to the given globally unique IDs', 'event_espresso'), |
|
76 | - ], |
|
77 | - 'idIn' => [ |
|
78 | - 'type' => ['list_of' => 'ID'], |
|
79 | - 'description' => esc_html__('Limit prices to the given IDs', 'event_espresso'), |
|
80 | - ], |
|
81 | - 'event' => [ |
|
82 | - 'type' => 'ID', |
|
83 | - 'description' => esc_html__('Globally unique event ID to get the prices for.', 'event_espresso'), |
|
84 | - ], |
|
85 | - 'eventId' => [ |
|
86 | - 'type' => 'Int', |
|
87 | - 'description' => esc_html__('Event ID to get the prices for.', 'event_espresso'), |
|
88 | - ], |
|
89 | - 'includeDefaultPrices' => [ |
|
90 | - 'type' => 'Boolean', |
|
91 | - 'description' => esc_html__('Whether to add default prices to the list.', 'event_espresso'), |
|
92 | - ], |
|
93 | - 'includeDefaultTicketsPrices' => [ |
|
94 | - 'type' => 'Boolean', |
|
95 | - 'description' => esc_html__('Whether to add default tickets prices to the list.', 'event_espresso'), |
|
96 | - ], |
|
97 | - 'isDefault' => [ |
|
98 | - 'type' => 'Boolean', |
|
99 | - 'description' => esc_html__('Filter the default prices', 'event_espresso'), |
|
100 | - ], |
|
101 | - 'ticket' => [ |
|
102 | - 'type' => 'ID', |
|
103 | - 'description' => esc_html__('Globally unique ticket ID to get the prices for.', 'event_espresso'), |
|
104 | - ], |
|
105 | - 'ticketIn' => [ |
|
106 | - 'type' => ['list_of' => 'ID'], |
|
107 | - 'description' => esc_html__('Globally unique ticket IDs to get the prices for.', 'event_espresso'), |
|
108 | - ], |
|
109 | - 'ticketId' => [ |
|
110 | - 'type' => 'Int', |
|
111 | - 'description' => esc_html__('Ticket ID to get the prices for.', 'event_espresso'), |
|
112 | - ], |
|
113 | - 'ticketIdIn' => [ |
|
114 | - 'type' => ['list_of' => 'Int'], |
|
115 | - 'description' => esc_html__('Ticket IDs to get the prices for.', 'event_espresso'), |
|
116 | - ], |
|
117 | - 'priceType' => [ |
|
118 | - 'type' => 'ID', |
|
119 | - 'description' => esc_html__('Globally unique price type ID to get the prices for.', 'event_espresso'), |
|
120 | - ], |
|
121 | - 'priceTypeIn' => [ |
|
122 | - 'type' => ['list_of' => 'ID'], |
|
123 | - 'description' => esc_html__('Globally unique price type IDs to get the prices for.', 'event_espresso'), |
|
124 | - ], |
|
125 | - 'priceTypeId' => [ |
|
126 | - 'type' => 'Int', |
|
127 | - 'description' => esc_html__('Price type ID to get the prices for.', 'event_espresso'), |
|
128 | - ], |
|
129 | - 'priceTypeIdIn' => [ |
|
130 | - 'type' => ['list_of' => 'Int'], |
|
131 | - 'description' => esc_html__('Price type IDs to get the prices for.', 'event_espresso'), |
|
132 | - ], |
|
133 | - 'priceBaseTypeIn' => [ |
|
134 | - 'type' => ['list_of' => 'PriceBaseTypeEnum'], |
|
135 | - 'description' => esc_html__('Price Base types.', 'event_espresso'), |
|
136 | - ], |
|
137 | - ]; |
|
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 | + 'in' => [ |
|
74 | + 'type' => ['list_of' => 'ID'], |
|
75 | + 'description' => esc_html__('Limit prices to the given globally unique IDs', 'event_espresso'), |
|
76 | + ], |
|
77 | + 'idIn' => [ |
|
78 | + 'type' => ['list_of' => 'ID'], |
|
79 | + 'description' => esc_html__('Limit prices to the given IDs', 'event_espresso'), |
|
80 | + ], |
|
81 | + 'event' => [ |
|
82 | + 'type' => 'ID', |
|
83 | + 'description' => esc_html__('Globally unique event ID to get the prices for.', 'event_espresso'), |
|
84 | + ], |
|
85 | + 'eventId' => [ |
|
86 | + 'type' => 'Int', |
|
87 | + 'description' => esc_html__('Event ID to get the prices for.', 'event_espresso'), |
|
88 | + ], |
|
89 | + 'includeDefaultPrices' => [ |
|
90 | + 'type' => 'Boolean', |
|
91 | + 'description' => esc_html__('Whether to add default prices to the list.', 'event_espresso'), |
|
92 | + ], |
|
93 | + 'includeDefaultTicketsPrices' => [ |
|
94 | + 'type' => 'Boolean', |
|
95 | + 'description' => esc_html__('Whether to add default tickets prices to the list.', 'event_espresso'), |
|
96 | + ], |
|
97 | + 'isDefault' => [ |
|
98 | + 'type' => 'Boolean', |
|
99 | + 'description' => esc_html__('Filter the default prices', 'event_espresso'), |
|
100 | + ], |
|
101 | + 'ticket' => [ |
|
102 | + 'type' => 'ID', |
|
103 | + 'description' => esc_html__('Globally unique ticket ID to get the prices for.', 'event_espresso'), |
|
104 | + ], |
|
105 | + 'ticketIn' => [ |
|
106 | + 'type' => ['list_of' => 'ID'], |
|
107 | + 'description' => esc_html__('Globally unique ticket IDs to get the prices for.', 'event_espresso'), |
|
108 | + ], |
|
109 | + 'ticketId' => [ |
|
110 | + 'type' => 'Int', |
|
111 | + 'description' => esc_html__('Ticket ID to get the prices for.', 'event_espresso'), |
|
112 | + ], |
|
113 | + 'ticketIdIn' => [ |
|
114 | + 'type' => ['list_of' => 'Int'], |
|
115 | + 'description' => esc_html__('Ticket IDs to get the prices for.', 'event_espresso'), |
|
116 | + ], |
|
117 | + 'priceType' => [ |
|
118 | + 'type' => 'ID', |
|
119 | + 'description' => esc_html__('Globally unique price type ID to get the prices for.', 'event_espresso'), |
|
120 | + ], |
|
121 | + 'priceTypeIn' => [ |
|
122 | + 'type' => ['list_of' => 'ID'], |
|
123 | + 'description' => esc_html__('Globally unique price type IDs to get the prices for.', 'event_espresso'), |
|
124 | + ], |
|
125 | + 'priceTypeId' => [ |
|
126 | + 'type' => 'Int', |
|
127 | + 'description' => esc_html__('Price type ID to get the prices for.', 'event_espresso'), |
|
128 | + ], |
|
129 | + 'priceTypeIdIn' => [ |
|
130 | + 'type' => ['list_of' => 'Int'], |
|
131 | + 'description' => esc_html__('Price type IDs to get the prices for.', 'event_espresso'), |
|
132 | + ], |
|
133 | + 'priceBaseTypeIn' => [ |
|
134 | + 'type' => ['list_of' => 'PriceBaseTypeEnum'], |
|
135 | + 'description' => esc_html__('Price Base types.', 'event_espresso'), |
|
136 | + ], |
|
137 | + ]; |
|
138 | 138 | |
139 | - $newArgs = apply_filters( |
|
140 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__price_args', |
|
141 | - $newArgs, |
|
142 | - $args |
|
143 | - ); |
|
144 | - return array_merge( |
|
145 | - $newArgs, |
|
146 | - $args |
|
147 | - ); |
|
148 | - } |
|
139 | + $newArgs = apply_filters( |
|
140 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__price_args', |
|
141 | + $newArgs, |
|
142 | + $args |
|
143 | + ); |
|
144 | + return array_merge( |
|
145 | + $newArgs, |
|
146 | + $args |
|
147 | + ); |
|
148 | + } |
|
149 | 149 | } |
@@ -37,8 +37,8 @@ |
||
37 | 37 | public function config(): array |
38 | 38 | { |
39 | 39 | return [ |
40 | - 'fromType' => $this->namespace . 'Event', |
|
41 | - 'toType' => $this->namespace . 'Datetime', |
|
40 | + 'fromType' => $this->namespace.'Event', |
|
41 | + 'toType' => $this->namespace.'Datetime', |
|
42 | 42 | 'fromFieldName' => 'datetimes', |
43 | 43 | 'connectionTypeName' => "{$this->namespace}EventDatetimesConnection", |
44 | 44 | 'connectionArgs' => self::get_connection_args(), |
@@ -18,119 +18,119 @@ |
||
18 | 18 | */ |
19 | 19 | class EventDatetimesConnection extends ConnectionBase |
20 | 20 | { |
21 | - /** |
|
22 | - * DatetimeConnection constructor. |
|
23 | - * |
|
24 | - * @param EEM_Datetime $model |
|
25 | - */ |
|
26 | - public function __construct(EEM_Datetime $model) |
|
27 | - { |
|
28 | - parent::__construct($model); |
|
29 | - } |
|
21 | + /** |
|
22 | + * DatetimeConnection constructor. |
|
23 | + * |
|
24 | + * @param EEM_Datetime $model |
|
25 | + */ |
|
26 | + public function __construct(EEM_Datetime $model) |
|
27 | + { |
|
28 | + parent::__construct($model); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function config(): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'fromType' => $this->namespace . 'Event', |
|
39 | - 'toType' => $this->namespace . 'Datetime', |
|
40 | - 'fromFieldName' => 'datetimes', |
|
41 | - 'connectionTypeName' => "{$this->namespace}EventDatetimesConnection", |
|
42 | - 'connectionArgs' => self::get_connection_args(), |
|
43 | - 'resolve' => [$this, 'resolveConnection'], |
|
44 | - ]; |
|
45 | - } |
|
32 | + /** |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function config(): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'fromType' => $this->namespace . 'Event', |
|
39 | + 'toType' => $this->namespace . 'Datetime', |
|
40 | + 'fromFieldName' => 'datetimes', |
|
41 | + 'connectionTypeName' => "{$this->namespace}EventDatetimesConnection", |
|
42 | + 'connectionArgs' => self::get_connection_args(), |
|
43 | + 'resolve' => [$this, 'resolveConnection'], |
|
44 | + ]; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * @param $entity |
|
50 | - * @param $args |
|
51 | - * @param $context |
|
52 | - * @param $info |
|
53 | - * @return array|Deferred|mixed |
|
54 | - * @throws Exception |
|
55 | - */ |
|
56 | - public function resolveConnection($entity, $args, $context, $info) |
|
57 | - { |
|
58 | - $resolver = new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
59 | - return $resolver->get_connection(); |
|
60 | - } |
|
48 | + /** |
|
49 | + * @param $entity |
|
50 | + * @param $args |
|
51 | + * @param $context |
|
52 | + * @param $info |
|
53 | + * @return array|Deferred|mixed |
|
54 | + * @throws Exception |
|
55 | + */ |
|
56 | + public function resolveConnection($entity, $args, $context, $info) |
|
57 | + { |
|
58 | + $resolver = new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
59 | + return $resolver->get_connection(); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * Given an optional array of args, this returns the args to be used in the connection |
|
64 | - * |
|
65 | - * @param array $args The args to modify the defaults |
|
66 | - * @return array |
|
67 | - */ |
|
68 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
69 | - public static function get_connection_args(array $args = []): array |
|
70 | - { |
|
71 | - $newArgs = [ |
|
72 | - 'orderby' => [ |
|
73 | - 'type' => ['list_of' => 'EspressoDatetimesConnectionOrderbyInput'], |
|
74 | - 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
75 | - ], |
|
76 | - 'event' => [ |
|
77 | - 'type' => 'ID', |
|
78 | - 'description' => esc_html__('Globally unique event ID to get the datetimes for.', 'event_espresso'), |
|
79 | - ], |
|
80 | - 'eventIn' => [ |
|
81 | - 'type' => ['list_of' => 'ID'], |
|
82 | - 'description' => esc_html__('Globally unique event IDs to get the datetimes for.', 'event_espresso'), |
|
83 | - ], |
|
84 | - 'eventId' => [ |
|
85 | - 'type' => 'Int', |
|
86 | - 'description' => esc_html__('Event ID to get the datetimes for.', 'event_espresso'), |
|
87 | - ], |
|
88 | - 'eventIdIn' => [ |
|
89 | - 'type' => ['list_of' => 'Int'], |
|
90 | - 'description' => esc_html__('Event IDs to get the datetimes for.', 'event_espresso'), |
|
91 | - ], |
|
92 | - 'ticket' => [ |
|
93 | - 'type' => 'ID', |
|
94 | - 'description' => esc_html__('Globally unique ticket ID to get the datetimes for.', 'event_espresso'), |
|
95 | - ], |
|
96 | - 'ticketIn' => [ |
|
97 | - 'type' => ['list_of' => 'ID'], |
|
98 | - 'description' => esc_html__('Globally unique ticket IDs to get the datetimes for.', 'event_espresso'), |
|
99 | - ], |
|
100 | - 'ticketId' => [ |
|
101 | - 'type' => 'Int', |
|
102 | - 'description' => esc_html__('Ticket ID to get the datetimes for.', 'event_espresso'), |
|
103 | - ], |
|
104 | - 'ticketIdIn' => [ |
|
105 | - 'type' => ['list_of' => 'Int'], |
|
106 | - 'description' => esc_html__('Ticket IDs to get the datetimes for.', 'event_espresso'), |
|
107 | - ], |
|
108 | - 'upcoming' => [ |
|
109 | - 'type' => 'Boolean', |
|
110 | - 'description' => esc_html__('Datetimes which are upcoming.', 'event_espresso'), |
|
111 | - ], |
|
112 | - 'active' => [ |
|
113 | - 'type' => 'Boolean', |
|
114 | - 'description' => esc_html__('Datetimes which are active.', 'event_espresso'), |
|
115 | - ], |
|
116 | - 'expired' => [ |
|
117 | - 'type' => 'Boolean', |
|
118 | - 'description' => esc_html__('Datetimes which are expired.', 'event_espresso'), |
|
119 | - ], |
|
120 | - 'search' => [ |
|
121 | - 'type' => 'String', |
|
122 | - 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
123 | - ], |
|
124 | - ]; |
|
62 | + /** |
|
63 | + * Given an optional array of args, this returns the args to be used in the connection |
|
64 | + * |
|
65 | + * @param array $args The args to modify the defaults |
|
66 | + * @return array |
|
67 | + */ |
|
68 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
69 | + public static function get_connection_args(array $args = []): array |
|
70 | + { |
|
71 | + $newArgs = [ |
|
72 | + 'orderby' => [ |
|
73 | + 'type' => ['list_of' => 'EspressoDatetimesConnectionOrderbyInput'], |
|
74 | + 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
75 | + ], |
|
76 | + 'event' => [ |
|
77 | + 'type' => 'ID', |
|
78 | + 'description' => esc_html__('Globally unique event ID to get the datetimes for.', 'event_espresso'), |
|
79 | + ], |
|
80 | + 'eventIn' => [ |
|
81 | + 'type' => ['list_of' => 'ID'], |
|
82 | + 'description' => esc_html__('Globally unique event IDs to get the datetimes for.', 'event_espresso'), |
|
83 | + ], |
|
84 | + 'eventId' => [ |
|
85 | + 'type' => 'Int', |
|
86 | + 'description' => esc_html__('Event ID to get the datetimes for.', 'event_espresso'), |
|
87 | + ], |
|
88 | + 'eventIdIn' => [ |
|
89 | + 'type' => ['list_of' => 'Int'], |
|
90 | + 'description' => esc_html__('Event IDs to get the datetimes for.', 'event_espresso'), |
|
91 | + ], |
|
92 | + 'ticket' => [ |
|
93 | + 'type' => 'ID', |
|
94 | + 'description' => esc_html__('Globally unique ticket ID to get the datetimes for.', 'event_espresso'), |
|
95 | + ], |
|
96 | + 'ticketIn' => [ |
|
97 | + 'type' => ['list_of' => 'ID'], |
|
98 | + 'description' => esc_html__('Globally unique ticket IDs to get the datetimes for.', 'event_espresso'), |
|
99 | + ], |
|
100 | + 'ticketId' => [ |
|
101 | + 'type' => 'Int', |
|
102 | + 'description' => esc_html__('Ticket ID to get the datetimes for.', 'event_espresso'), |
|
103 | + ], |
|
104 | + 'ticketIdIn' => [ |
|
105 | + 'type' => ['list_of' => 'Int'], |
|
106 | + 'description' => esc_html__('Ticket IDs to get the datetimes for.', 'event_espresso'), |
|
107 | + ], |
|
108 | + 'upcoming' => [ |
|
109 | + 'type' => 'Boolean', |
|
110 | + 'description' => esc_html__('Datetimes which are upcoming.', 'event_espresso'), |
|
111 | + ], |
|
112 | + 'active' => [ |
|
113 | + 'type' => 'Boolean', |
|
114 | + 'description' => esc_html__('Datetimes which are active.', 'event_espresso'), |
|
115 | + ], |
|
116 | + 'expired' => [ |
|
117 | + 'type' => 'Boolean', |
|
118 | + 'description' => esc_html__('Datetimes which are expired.', 'event_espresso'), |
|
119 | + ], |
|
120 | + 'search' => [ |
|
121 | + 'type' => 'String', |
|
122 | + 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
123 | + ], |
|
124 | + ]; |
|
125 | 125 | |
126 | - $newArgs = apply_filters( |
|
127 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__datetime_args', |
|
128 | - $newArgs, |
|
129 | - $args |
|
130 | - ); |
|
131 | - return array_merge( |
|
132 | - $newArgs, |
|
133 | - $args |
|
134 | - ); |
|
135 | - } |
|
126 | + $newArgs = apply_filters( |
|
127 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__datetime_args', |
|
128 | + $newArgs, |
|
129 | + $args |
|
130 | + ); |
|
131 | + return array_merge( |
|
132 | + $newArgs, |
|
133 | + $args |
|
134 | + ); |
|
135 | + } |
|
136 | 136 | } |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'fromType' => 'RootQuery', |
41 | - 'toType' => $this->namespace . 'FormElement', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormElements', |
|
41 | + 'toType' => $this->namespace.'FormElement', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace).'FormElements', |
|
43 | 43 | 'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection", |
44 | 44 | 'connectionArgs' => $this->get_connection_args(), |
45 | 45 | 'resolve' => [$this, 'resolveConnection'], |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ), |
79 | 79 | ], |
80 | 80 | 'status' => [ |
81 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
81 | + 'type' => ['list_of' => $this->namespace.'FormSectionStatusEnum'], |
|
82 | 82 | 'description' => esc_html__( |
83 | 83 | 'Filter the form elements by status.', |
84 | 84 | 'event_espresso' |
@@ -18,80 +18,80 @@ |
||
18 | 18 | */ |
19 | 19 | class RootQueryFormElementsConnection extends AbstractRootQueryConnection |
20 | 20 | { |
21 | - /** |
|
22 | - * FormElementConnection constructor. |
|
23 | - * |
|
24 | - * @param EEM_Form_Element $model |
|
25 | - */ |
|
26 | - public function __construct(EEM_Form_Element $model) |
|
27 | - { |
|
28 | - parent::__construct($model); |
|
29 | - } |
|
21 | + /** |
|
22 | + * FormElementConnection constructor. |
|
23 | + * |
|
24 | + * @param EEM_Form_Element $model |
|
25 | + */ |
|
26 | + public function __construct(EEM_Form_Element $model) |
|
27 | + { |
|
28 | + parent::__construct($model); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function config(): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'fromType' => 'RootQuery', |
|
39 | - 'toType' => $this->namespace . 'FormElement', |
|
40 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormElements', |
|
41 | - 'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection", |
|
42 | - 'connectionArgs' => $this->get_connection_args(), |
|
43 | - 'resolve' => [$this, 'resolveConnection'], |
|
44 | - ]; |
|
45 | - } |
|
32 | + /** |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function config(): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'fromType' => 'RootQuery', |
|
39 | + 'toType' => $this->namespace . 'FormElement', |
|
40 | + 'fromFieldName' => lcfirst($this->namespace) . 'FormElements', |
|
41 | + 'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection", |
|
42 | + 'connectionArgs' => $this->get_connection_args(), |
|
43 | + 'resolve' => [$this, 'resolveConnection'], |
|
44 | + ]; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * @param $entity |
|
50 | - * @param $args |
|
51 | - * @param $context |
|
52 | - * @param $info |
|
53 | - * @return FormElementConnectionResolver |
|
54 | - * @throws Exception |
|
55 | - */ |
|
56 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
57 | - { |
|
58 | - return new FormElementConnectionResolver($entity, $args, $context, $info); |
|
59 | - } |
|
48 | + /** |
|
49 | + * @param $entity |
|
50 | + * @param $args |
|
51 | + * @param $context |
|
52 | + * @param $info |
|
53 | + * @return FormElementConnectionResolver |
|
54 | + * @throws Exception |
|
55 | + */ |
|
56 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
57 | + { |
|
58 | + return new FormElementConnectionResolver($entity, $args, $context, $info); |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Given an optional array of args, this returns the args to be used in the connection |
|
63 | - * |
|
64 | - * @param array $args The args to modify the defaults |
|
65 | - * @return array |
|
66 | - */ |
|
67 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
68 | - public function get_connection_args(array $args = []): array |
|
69 | - { |
|
70 | - $newArgs = [ |
|
71 | - 'belongsTo' => [ |
|
72 | - 'type' => ['list_of' => 'ID'], |
|
73 | - 'description' => esc_html__( |
|
74 | - 'Related entity IDs to get the form elements for.', |
|
75 | - 'event_espresso' |
|
76 | - ), |
|
77 | - ], |
|
78 | - 'status' => [ |
|
79 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
80 | - 'description' => esc_html__( |
|
81 | - 'Filter the form elements by status.', |
|
82 | - 'event_espresso' |
|
83 | - ), |
|
84 | - ], |
|
85 | - ]; |
|
61 | + /** |
|
62 | + * Given an optional array of args, this returns the args to be used in the connection |
|
63 | + * |
|
64 | + * @param array $args The args to modify the defaults |
|
65 | + * @return array |
|
66 | + */ |
|
67 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
68 | + public function get_connection_args(array $args = []): array |
|
69 | + { |
|
70 | + $newArgs = [ |
|
71 | + 'belongsTo' => [ |
|
72 | + 'type' => ['list_of' => 'ID'], |
|
73 | + 'description' => esc_html__( |
|
74 | + 'Related entity IDs to get the form elements for.', |
|
75 | + 'event_espresso' |
|
76 | + ), |
|
77 | + ], |
|
78 | + 'status' => [ |
|
79 | + 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
80 | + 'description' => esc_html__( |
|
81 | + 'Filter the form elements by status.', |
|
82 | + 'event_espresso' |
|
83 | + ), |
|
84 | + ], |
|
85 | + ]; |
|
86 | 86 | |
87 | - $newArgs = apply_filters( |
|
88 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_element_args', |
|
89 | - $newArgs, |
|
90 | - $args |
|
91 | - ); |
|
92 | - return array_merge( |
|
93 | - $newArgs, |
|
94 | - $args |
|
95 | - ); |
|
96 | - } |
|
87 | + $newArgs = apply_filters( |
|
88 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_element_args', |
|
89 | + $newArgs, |
|
90 | + $args |
|
91 | + ); |
|
92 | + return array_merge( |
|
93 | + $newArgs, |
|
94 | + $args |
|
95 | + ); |
|
96 | + } |
|
97 | 97 | } |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'fromType' => 'RootQuery', |
41 | - 'toType' => $this->namespace . 'FormSection', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormSections', |
|
41 | + 'toType' => $this->namespace.'FormSection', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace).'FormSections', |
|
43 | 43 | 'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection", |
44 | 44 | 'connectionArgs' => $this->get_connection_args(), |
45 | 45 | 'resolve' => [$this, 'resolveConnection'], |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | $newArgs = [ |
73 | 73 | 'appliesTo' => [ |
74 | - 'type' => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'], |
|
74 | + 'type' => ['list_of' => $this->namespace.'FormSectionAppliesToEnum'], |
|
75 | 75 | 'description' => esc_html__( |
76 | 76 | 'Form user types to get the form sections for.', |
77 | 77 | 'event_espresso' |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ), |
86 | 86 | ], |
87 | 87 | 'status' => [ |
88 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
88 | + 'type' => ['list_of' => $this->namespace.'FormSectionStatusEnum'], |
|
89 | 89 | 'description' => esc_html__( |
90 | 90 | 'Filter the form sections by status.', |
91 | 91 | 'event_espresso' |
@@ -18,87 +18,87 @@ |
||
18 | 18 | */ |
19 | 19 | class RootQueryFormSectionsConnection extends AbstractRootQueryConnection |
20 | 20 | { |
21 | - /** |
|
22 | - * FormSectionConnection constructor. |
|
23 | - * |
|
24 | - * @param EEM_Form_Section $model |
|
25 | - */ |
|
26 | - public function __construct(EEM_Form_Section $model) |
|
27 | - { |
|
28 | - parent::__construct($model); |
|
29 | - } |
|
21 | + /** |
|
22 | + * FormSectionConnection constructor. |
|
23 | + * |
|
24 | + * @param EEM_Form_Section $model |
|
25 | + */ |
|
26 | + public function __construct(EEM_Form_Section $model) |
|
27 | + { |
|
28 | + parent::__construct($model); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function config(): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'fromType' => 'RootQuery', |
|
39 | - 'toType' => $this->namespace . 'FormSection', |
|
40 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormSections', |
|
41 | - 'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection", |
|
42 | - 'connectionArgs' => $this->get_connection_args(), |
|
43 | - 'resolve' => [$this, 'resolveConnection'], |
|
44 | - ]; |
|
45 | - } |
|
32 | + /** |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function config(): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'fromType' => 'RootQuery', |
|
39 | + 'toType' => $this->namespace . 'FormSection', |
|
40 | + 'fromFieldName' => lcfirst($this->namespace) . 'FormSections', |
|
41 | + 'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection", |
|
42 | + 'connectionArgs' => $this->get_connection_args(), |
|
43 | + 'resolve' => [$this, 'resolveConnection'], |
|
44 | + ]; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * @param $entity |
|
50 | - * @param $args |
|
51 | - * @param $context |
|
52 | - * @param $info |
|
53 | - * @return FormSectionConnectionResolver |
|
54 | - * @throws Exception |
|
55 | - */ |
|
56 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
57 | - { |
|
58 | - return new FormSectionConnectionResolver($entity, $args, $context, $info); |
|
59 | - } |
|
48 | + /** |
|
49 | + * @param $entity |
|
50 | + * @param $args |
|
51 | + * @param $context |
|
52 | + * @param $info |
|
53 | + * @return FormSectionConnectionResolver |
|
54 | + * @throws Exception |
|
55 | + */ |
|
56 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
57 | + { |
|
58 | + return new FormSectionConnectionResolver($entity, $args, $context, $info); |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Given an optional array of args, this returns the args to be used in the connection |
|
63 | - * |
|
64 | - * @param array $args The args to modify the defaults |
|
65 | - * @return array |
|
66 | - */ |
|
67 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
68 | - public function get_connection_args(array $args = []): array |
|
69 | - { |
|
70 | - $newArgs = [ |
|
71 | - 'appliesTo' => [ |
|
72 | - 'type' => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'], |
|
73 | - 'description' => esc_html__( |
|
74 | - 'Form user types to get the form sections for.', |
|
75 | - 'event_espresso' |
|
76 | - ), |
|
77 | - ], |
|
78 | - 'belongsTo' => [ |
|
79 | - 'type' => ['list_of' => 'ID'], |
|
80 | - 'description' => esc_html__( |
|
81 | - 'Related entity IDs to get the form sections for.', |
|
82 | - 'event_espresso' |
|
83 | - ), |
|
84 | - ], |
|
85 | - 'status' => [ |
|
86 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
87 | - 'description' => esc_html__( |
|
88 | - 'Filter the form sections by status.', |
|
89 | - 'event_espresso' |
|
90 | - ), |
|
91 | - ], |
|
92 | - ]; |
|
61 | + /** |
|
62 | + * Given an optional array of args, this returns the args to be used in the connection |
|
63 | + * |
|
64 | + * @param array $args The args to modify the defaults |
|
65 | + * @return array |
|
66 | + */ |
|
67 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
68 | + public function get_connection_args(array $args = []): array |
|
69 | + { |
|
70 | + $newArgs = [ |
|
71 | + 'appliesTo' => [ |
|
72 | + 'type' => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'], |
|
73 | + 'description' => esc_html__( |
|
74 | + 'Form user types to get the form sections for.', |
|
75 | + 'event_espresso' |
|
76 | + ), |
|
77 | + ], |
|
78 | + 'belongsTo' => [ |
|
79 | + 'type' => ['list_of' => 'ID'], |
|
80 | + 'description' => esc_html__( |
|
81 | + 'Related entity IDs to get the form sections for.', |
|
82 | + 'event_espresso' |
|
83 | + ), |
|
84 | + ], |
|
85 | + 'status' => [ |
|
86 | + 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
87 | + 'description' => esc_html__( |
|
88 | + 'Filter the form sections by status.', |
|
89 | + 'event_espresso' |
|
90 | + ), |
|
91 | + ], |
|
92 | + ]; |
|
93 | 93 | |
94 | - $newArgs = apply_filters( |
|
95 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_section_args', |
|
96 | - $newArgs, |
|
97 | - $args |
|
98 | - ); |
|
99 | - return array_merge( |
|
100 | - $newArgs, |
|
101 | - $args |
|
102 | - ); |
|
103 | - } |
|
94 | + $newArgs = apply_filters( |
|
95 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_section_args', |
|
96 | + $newArgs, |
|
97 | + $args |
|
98 | + ); |
|
99 | + return array_merge( |
|
100 | + $newArgs, |
|
101 | + $args |
|
102 | + ); |
|
103 | + } |
|
104 | 104 | } |
@@ -36,8 +36,8 @@ |
||
36 | 36 | public function config(): array |
37 | 37 | { |
38 | 38 | return [ |
39 | - 'fromType' => $this->namespace . 'Ticket', |
|
40 | - 'toType' => $this->namespace . 'Datetime', |
|
39 | + 'fromType' => $this->namespace.'Ticket', |
|
40 | + 'toType' => $this->namespace.'Datetime', |
|
41 | 41 | 'fromFieldName' => 'datetimes', |
42 | 42 | 'connectionTypeName' => "{$this->namespace}TicketDatetimesConnection", |
43 | 43 | 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
@@ -18,44 +18,44 @@ |
||
18 | 18 | */ |
19 | 19 | class TicketDatetimesConnection extends ConnectionBase |
20 | 20 | { |
21 | - /** |
|
22 | - * DatetimeConnection constructor. |
|
23 | - * |
|
24 | - * @param EEM_Datetime $model |
|
25 | - */ |
|
26 | - public function __construct(EEM_Datetime $model) |
|
27 | - { |
|
28 | - parent::__construct($model); |
|
29 | - } |
|
21 | + /** |
|
22 | + * DatetimeConnection constructor. |
|
23 | + * |
|
24 | + * @param EEM_Datetime $model |
|
25 | + */ |
|
26 | + public function __construct(EEM_Datetime $model) |
|
27 | + { |
|
28 | + parent::__construct($model); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function config(): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'fromType' => $this->namespace . 'Ticket', |
|
39 | - 'toType' => $this->namespace . 'Datetime', |
|
40 | - 'fromFieldName' => 'datetimes', |
|
41 | - 'connectionTypeName' => "{$this->namespace}TicketDatetimesConnection", |
|
42 | - 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
|
43 | - 'resolve' => [$this, 'resolveConnection'], |
|
44 | - ]; |
|
45 | - } |
|
32 | + /** |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function config(): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'fromType' => $this->namespace . 'Ticket', |
|
39 | + 'toType' => $this->namespace . 'Datetime', |
|
40 | + 'fromFieldName' => 'datetimes', |
|
41 | + 'connectionTypeName' => "{$this->namespace}TicketDatetimesConnection", |
|
42 | + 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
|
43 | + 'resolve' => [$this, 'resolveConnection'], |
|
44 | + ]; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * @param $entity |
|
50 | - * @param $args |
|
51 | - * @param $context |
|
52 | - * @param $info |
|
53 | - * @return array|Deferred|mixed |
|
54 | - * @throws Exception |
|
55 | - */ |
|
56 | - public function resolveConnection($entity, $args, $context, $info) |
|
57 | - { |
|
58 | - $resolver = new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
59 | - return $resolver->get_connection(); |
|
60 | - } |
|
48 | + /** |
|
49 | + * @param $entity |
|
50 | + * @param $args |
|
51 | + * @param $context |
|
52 | + * @param $info |
|
53 | + * @return array|Deferred|mixed |
|
54 | + * @throws Exception |
|
55 | + */ |
|
56 | + public function resolveConnection($entity, $args, $context, $info) |
|
57 | + { |
|
58 | + $resolver = new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
59 | + return $resolver->get_connection(); |
|
60 | + } |
|
61 | 61 | } |
@@ -37,8 +37,8 @@ |
||
37 | 37 | public function config(): array |
38 | 38 | { |
39 | 39 | return [ |
40 | - 'fromType' => $this->namespace . 'Event', |
|
41 | - 'toType' => $this->namespace . 'Venue', |
|
40 | + 'fromType' => $this->namespace.'Event', |
|
41 | + 'toType' => $this->namespace.'Venue', |
|
42 | 42 | 'fromFieldName' => 'venues', |
43 | 43 | 'connectionTypeName' => "{$this->namespace}EventVenuesConnection", |
44 | 44 | 'resolve' => [$this, 'resolveConnection'], |
@@ -18,43 +18,43 @@ |
||
18 | 18 | */ |
19 | 19 | class EventVenuesConnection extends ConnectionBase |
20 | 20 | { |
21 | - /** |
|
22 | - * DatetimeConnection constructor. |
|
23 | - * |
|
24 | - * @param EEM_Venue $model |
|
25 | - */ |
|
26 | - public function __construct(EEM_Venue $model) |
|
27 | - { |
|
28 | - parent::__construct($model); |
|
29 | - } |
|
21 | + /** |
|
22 | + * DatetimeConnection constructor. |
|
23 | + * |
|
24 | + * @param EEM_Venue $model |
|
25 | + */ |
|
26 | + public function __construct(EEM_Venue $model) |
|
27 | + { |
|
28 | + parent::__construct($model); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function config(): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'fromType' => $this->namespace . 'Event', |
|
39 | - 'toType' => $this->namespace . 'Venue', |
|
40 | - 'fromFieldName' => 'venues', |
|
41 | - 'connectionTypeName' => "{$this->namespace}EventVenuesConnection", |
|
42 | - 'resolve' => [$this, 'resolveConnection'], |
|
43 | - ]; |
|
44 | - } |
|
32 | + /** |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function config(): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'fromType' => $this->namespace . 'Event', |
|
39 | + 'toType' => $this->namespace . 'Venue', |
|
40 | + 'fromFieldName' => 'venues', |
|
41 | + 'connectionTypeName' => "{$this->namespace}EventVenuesConnection", |
|
42 | + 'resolve' => [$this, 'resolveConnection'], |
|
43 | + ]; |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * @param $entity |
|
49 | - * @param $args |
|
50 | - * @param $context |
|
51 | - * @param $info |
|
52 | - * @return array|Deferred|mixed |
|
53 | - * @throws Exception |
|
54 | - */ |
|
55 | - public function resolveConnection($entity, $args, $context, $info) |
|
56 | - { |
|
57 | - $resolver = new VenueConnectionResolver($entity, $args, $context, $info); |
|
58 | - return $resolver->get_connection(); |
|
59 | - } |
|
47 | + /** |
|
48 | + * @param $entity |
|
49 | + * @param $args |
|
50 | + * @param $context |
|
51 | + * @param $info |
|
52 | + * @return array|Deferred|mixed |
|
53 | + * @throws Exception |
|
54 | + */ |
|
55 | + public function resolveConnection($entity, $args, $context, $info) |
|
56 | + { |
|
57 | + $resolver = new VenueConnectionResolver($entity, $args, $context, $info); |
|
58 | + return $resolver->get_connection(); |
|
59 | + } |
|
60 | 60 | } |
@@ -15,27 +15,27 @@ |
||
15 | 15 | */ |
16 | 16 | class PriceTypeLoader extends AbstractLoader |
17 | 17 | { |
18 | - /** |
|
19 | - * @return EEM_Base |
|
20 | - * @throws EE_Error |
|
21 | - * @throws InvalidArgumentException |
|
22 | - * @throws InvalidDataTypeException |
|
23 | - * @throws InvalidInterfaceException |
|
24 | - * @throws ReflectionException |
|
25 | - */ |
|
26 | - protected function getQuery(): EEM_Base |
|
27 | - { |
|
28 | - return EEM_Price_Type::instance(); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @return EEM_Base |
|
20 | + * @throws EE_Error |
|
21 | + * @throws InvalidArgumentException |
|
22 | + * @throws InvalidDataTypeException |
|
23 | + * @throws InvalidInterfaceException |
|
24 | + * @throws ReflectionException |
|
25 | + */ |
|
26 | + protected function getQuery(): EEM_Base |
|
27 | + { |
|
28 | + return EEM_Price_Type::instance(); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * @param array $keys |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - protected function getWhereParams(array $keys): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'PRT_ID' => ['IN', $keys], |
|
39 | - ]; |
|
40 | - } |
|
31 | + /** |
|
32 | + * @param array $keys |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + protected function getWhereParams(array $keys): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'PRT_ID' => ['IN', $keys], |
|
39 | + ]; |
|
40 | + } |
|
41 | 41 | } |
@@ -15,28 +15,28 @@ |
||
15 | 15 | */ |
16 | 16 | class AttendeeLoader extends AbstractLoader |
17 | 17 | { |
18 | - /** |
|
19 | - * @return EEM_Base|EEM_Attendee |
|
20 | - * @throws EE_Error |
|
21 | - * @throws InvalidArgumentException |
|
22 | - * @throws InvalidDataTypeException |
|
23 | - * @throws InvalidInterfaceException |
|
24 | - * @throws ReflectionException |
|
25 | - */ |
|
26 | - protected function getQuery(): EEM_Base |
|
27 | - { |
|
28 | - return EEM_Attendee::instance(); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @return EEM_Base|EEM_Attendee |
|
20 | + * @throws EE_Error |
|
21 | + * @throws InvalidArgumentException |
|
22 | + * @throws InvalidDataTypeException |
|
23 | + * @throws InvalidInterfaceException |
|
24 | + * @throws ReflectionException |
|
25 | + */ |
|
26 | + protected function getQuery(): EEM_Base |
|
27 | + { |
|
28 | + return EEM_Attendee::instance(); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @param array $keys |
|
34 | - * @return array |
|
35 | - */ |
|
36 | - protected function getWhereParams(array $keys): array |
|
37 | - { |
|
38 | - return [ |
|
39 | - 'ATT_ID' => ['IN', $keys], |
|
40 | - ]; |
|
41 | - } |
|
32 | + /** |
|
33 | + * @param array $keys |
|
34 | + * @return array |
|
35 | + */ |
|
36 | + protected function getWhereParams(array $keys): array |
|
37 | + { |
|
38 | + return [ |
|
39 | + 'ATT_ID' => ['IN', $keys], |
|
40 | + ]; |
|
41 | + } |
|
42 | 42 | } |