@@ -15,28 +15,28 @@ |
||
15 | 15 | */ |
16 | 16 | class StateLoader extends AbstractLoader |
17 | 17 | { |
18 | - /** |
|
19 | - * @return EEM_Base|EEM_State |
|
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_State::instance(); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @return EEM_Base|EEM_State |
|
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_State::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 | - 'STA_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 | + 'STA_ID' => ['IN', $keys], |
|
40 | + ]; |
|
41 | + } |
|
42 | 42 | } |
@@ -17,27 +17,27 @@ |
||
17 | 17 | class EspressoEditor implements GQLDataDomainInterface |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @param array $loaders The loaders accessible in the AppContext |
|
22 | - * @param AppContext $context The AppContext |
|
23 | - * @return array |
|
24 | - * @return array |
|
25 | - */ |
|
26 | - public function registerLoaders(array $loaders, AppContext $context): array |
|
27 | - { |
|
28 | - $newLoaders = [ |
|
29 | - 'espresso_attendee' => new Loaders\AttendeeLoader($context), |
|
30 | - 'espresso_country' => new Loaders\CountryLoader($context), |
|
31 | - 'espresso_datetime' => new Loaders\DatetimeLoader($context), |
|
32 | - 'espresso_price' => new Loaders\PriceLoader($context), |
|
33 | - 'espresso_priceType' => new Loaders\PriceTypeLoader($context), |
|
34 | - 'espresso_formSection' => new Loaders\FormSectionLoader($context), |
|
35 | - 'espresso_formElement' => new Loaders\FormElementLoader($context), |
|
36 | - 'espresso_state' => new Loaders\StateLoader($context), |
|
37 | - 'espresso_ticket' => new Loaders\TicketLoader($context), |
|
38 | - 'espresso_venue' => new Loaders\VenueLoader($context), |
|
39 | - ]; |
|
20 | + /** |
|
21 | + * @param array $loaders The loaders accessible in the AppContext |
|
22 | + * @param AppContext $context The AppContext |
|
23 | + * @return array |
|
24 | + * @return array |
|
25 | + */ |
|
26 | + public function registerLoaders(array $loaders, AppContext $context): array |
|
27 | + { |
|
28 | + $newLoaders = [ |
|
29 | + 'espresso_attendee' => new Loaders\AttendeeLoader($context), |
|
30 | + 'espresso_country' => new Loaders\CountryLoader($context), |
|
31 | + 'espresso_datetime' => new Loaders\DatetimeLoader($context), |
|
32 | + 'espresso_price' => new Loaders\PriceLoader($context), |
|
33 | + 'espresso_priceType' => new Loaders\PriceTypeLoader($context), |
|
34 | + 'espresso_formSection' => new Loaders\FormSectionLoader($context), |
|
35 | + 'espresso_formElement' => new Loaders\FormElementLoader($context), |
|
36 | + 'espresso_state' => new Loaders\StateLoader($context), |
|
37 | + 'espresso_ticket' => new Loaders\TicketLoader($context), |
|
38 | + 'espresso_venue' => new Loaders\VenueLoader($context), |
|
39 | + ]; |
|
40 | 40 | |
41 | - return array_merge($loaders, $newLoaders); |
|
42 | - } |
|
41 | + return array_merge($loaders, $newLoaders); |
|
42 | + } |
|
43 | 43 | } |
@@ -15,35 +15,35 @@ |
||
15 | 15 | class CountriesConnectionOrderbyEnum extends EnumBase |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * CountriesConnectionOrderbyEnum constructor. |
|
20 | - */ |
|
21 | - public function __construct() |
|
22 | - { |
|
23 | - $this->setName($this->namespace . 'CountriesConnectionOrderbyEnum'); |
|
24 | - $this->setDescription(esc_html__('Field to order the connection by', 'event_espresso')); |
|
25 | - parent::__construct(); |
|
26 | - } |
|
18 | + /** |
|
19 | + * CountriesConnectionOrderbyEnum constructor. |
|
20 | + */ |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | + $this->setName($this->namespace . 'CountriesConnectionOrderbyEnum'); |
|
24 | + $this->setDescription(esc_html__('Field to order the connection by', 'event_espresso')); |
|
25 | + parent::__construct(); |
|
26 | + } |
|
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * @return array |
|
31 | - */ |
|
32 | - protected function getValues(): array |
|
33 | - { |
|
34 | - return [ |
|
35 | - 'NAME' => [ |
|
36 | - 'value' => 'CNT_name', |
|
37 | - 'description' => esc_html__('Order by country name', 'event_espresso'), |
|
38 | - ], |
|
39 | - 'ISO' => [ |
|
40 | - 'value' => 'CNT_ISO', |
|
41 | - 'description' => esc_html__('Order by country ISO', 'event_espresso'), |
|
42 | - ], |
|
43 | - 'CNT_ISO3' => [ |
|
44 | - 'value' => 'CNT_ISO3', |
|
45 | - 'description' => esc_html__('Order by country ISO3', 'event_espresso'), |
|
46 | - ], |
|
47 | - ]; |
|
48 | - } |
|
29 | + /** |
|
30 | + * @return array |
|
31 | + */ |
|
32 | + protected function getValues(): array |
|
33 | + { |
|
34 | + return [ |
|
35 | + 'NAME' => [ |
|
36 | + 'value' => 'CNT_name', |
|
37 | + 'description' => esc_html__('Order by country name', 'event_espresso'), |
|
38 | + ], |
|
39 | + 'ISO' => [ |
|
40 | + 'value' => 'CNT_ISO', |
|
41 | + 'description' => esc_html__('Order by country ISO', 'event_espresso'), |
|
42 | + ], |
|
43 | + 'CNT_ISO3' => [ |
|
44 | + 'value' => 'CNT_ISO3', |
|
45 | + 'description' => esc_html__('Order by country ISO3', 'event_espresso'), |
|
46 | + ], |
|
47 | + ]; |
|
48 | + } |
|
49 | 49 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct() |
22 | 22 | { |
23 | - $this->setName($this->namespace . 'CountriesConnectionOrderbyEnum'); |
|
23 | + $this->setName($this->namespace.'CountriesConnectionOrderbyEnum'); |
|
24 | 24 | $this->setDescription(esc_html__('Field to order the connection by', 'event_espresso')); |
25 | 25 | parent::__construct(); |
26 | 26 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | class StatesConnectionOrderbyEnum extends EnumBase |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * StatesConnectionOrderbyEnum constructor. |
|
20 | - */ |
|
21 | - public function __construct() |
|
22 | - { |
|
23 | - $this->setName($this->namespace . 'StatesConnectionOrderbyEnum'); |
|
24 | - $this->setDescription(esc_html__('Field to order the connection by', 'event_espresso')); |
|
25 | - parent::__construct(); |
|
26 | - } |
|
18 | + /** |
|
19 | + * StatesConnectionOrderbyEnum constructor. |
|
20 | + */ |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | + $this->setName($this->namespace . 'StatesConnectionOrderbyEnum'); |
|
24 | + $this->setDescription(esc_html__('Field to order the connection by', 'event_espresso')); |
|
25 | + parent::__construct(); |
|
26 | + } |
|
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * @return array |
|
31 | - */ |
|
32 | - protected function getValues(): array |
|
33 | - { |
|
34 | - return [ |
|
35 | - 'NAME' => [ |
|
36 | - 'value' => 'CNT_name', |
|
37 | - 'description' => esc_html__('Order by state name', 'event_espresso'), |
|
38 | - ], |
|
39 | - 'COUNTRY_ISO' => [ |
|
40 | - 'value' => 'CNT_ISO', |
|
41 | - 'description' => esc_html__('Order by country ISO', 'event_espresso'), |
|
42 | - ], |
|
43 | - ]; |
|
44 | - } |
|
29 | + /** |
|
30 | + * @return array |
|
31 | + */ |
|
32 | + protected function getValues(): array |
|
33 | + { |
|
34 | + return [ |
|
35 | + 'NAME' => [ |
|
36 | + 'value' => 'CNT_name', |
|
37 | + 'description' => esc_html__('Order by state name', 'event_espresso'), |
|
38 | + ], |
|
39 | + 'COUNTRY_ISO' => [ |
|
40 | + 'value' => 'CNT_ISO', |
|
41 | + 'description' => esc_html__('Order by country ISO', 'event_espresso'), |
|
42 | + ], |
|
43 | + ]; |
|
44 | + } |
|
45 | 45 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct() |
22 | 22 | { |
23 | - $this->setName($this->namespace . 'StatesConnectionOrderbyEnum'); |
|
23 | + $this->setName($this->namespace.'StatesConnectionOrderbyEnum'); |
|
24 | 24 | $this->setDescription(esc_html__('Field to order the connection by', 'event_espresso')); |
25 | 25 | parent::__construct(); |
26 | 26 | } |
@@ -14,152 +14,152 @@ |
||
14 | 14 | */ |
15 | 15 | class StateConnectionResolver extends AbstractConnectionResolver |
16 | 16 | { |
17 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
18 | - public function get_loader_name(): string |
|
19 | - { |
|
20 | - return 'espresso_state'; |
|
21 | - } |
|
22 | - |
|
23 | - /** |
|
24 | - * @return EEM_State |
|
25 | - * @throws EE_Error |
|
26 | - * @throws InvalidArgumentException |
|
27 | - * @throws InvalidDataTypeException |
|
28 | - * @throws InvalidInterfaceException |
|
29 | - * @throws ReflectionException |
|
30 | - */ |
|
31 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
32 | - public function get_query(): EEM_State |
|
33 | - { |
|
34 | - return EEM_State::instance(); |
|
35 | - } |
|
36 | - |
|
37 | - |
|
38 | - /** |
|
39 | - * Return an array of item IDs from the query |
|
40 | - * |
|
41 | - * @return array |
|
42 | - */ |
|
43 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
44 | - public function get_ids(): array |
|
45 | - { |
|
46 | - $results = $this->query->get_col($this->query_args); |
|
47 | - |
|
48 | - return ! empty($results) ? $results : []; |
|
49 | - } |
|
50 | - |
|
51 | - |
|
52 | - /** |
|
53 | - * Here, we map the args from the input, then we make sure that we're only querying |
|
54 | - * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers |
|
55 | - * handle batch resolution of the posts. |
|
56 | - * |
|
57 | - * @return array |
|
58 | - * @throws InvalidArgumentException |
|
59 | - * @throws InvalidDataTypeException |
|
60 | - * @throws InvalidInterfaceException |
|
61 | - */ |
|
62 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
63 | - public function get_query_args(): array |
|
64 | - { |
|
65 | - $where_params = []; |
|
66 | - $query_args = []; |
|
67 | - |
|
68 | - $query_args['limit'] = $this->getLimit(); |
|
69 | - |
|
70 | - // Avoid multiple entries by join. |
|
71 | - $query_args['group_by'] = 'STA_ID'; |
|
72 | - |
|
73 | - $query_args['default_where_conditions'] = 'minimum'; |
|
74 | - |
|
75 | - /** |
|
76 | - * Collect the input_fields and sanitize them to prepare them for sending to the Query |
|
77 | - */ |
|
78 | - $input_fields = []; |
|
79 | - if (! empty($this->args['where'])) { |
|
80 | - $input_fields = $this->sanitizeInputFields($this->args['where']); |
|
81 | - |
|
82 | - // Since we do not have any falsy values in query params |
|
83 | - // Lets get rid of empty values |
|
84 | - $input_fields = array_filter($input_fields); |
|
85 | - |
|
86 | - // Use the proper operator. |
|
87 | - if (! empty($input_fields['STA_ID']) && is_array($input_fields['STA_ID'])) { |
|
88 | - $input_fields['STA_ID'] = ['IN', $input_fields['STA_ID']]; |
|
89 | - } |
|
90 | - if (! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
91 | - $input_fields['CNT_ISO'] = ['IN', $input_fields['CNT_ISO']]; |
|
92 | - } |
|
93 | - } |
|
94 | - |
|
95 | - /** |
|
96 | - * Merge the input_fields with the default query_args |
|
97 | - */ |
|
98 | - if (! empty($input_fields)) { |
|
99 | - $where_params = array_merge($where_params, $input_fields); |
|
100 | - } |
|
101 | - |
|
102 | - // limit to active countries by default. |
|
103 | - if (!isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
104 | - $where_params['STA_active'] = true; |
|
105 | - } |
|
106 | - |
|
107 | - [$query_args, $where_params] = $this->mapOrderbyInputArgs($query_args, $where_params, 'STA_ID'); |
|
108 | - |
|
109 | - if (empty($query_args['order_by'])) { |
|
110 | - // set order_by to 'name' by default |
|
111 | - $query_args['order_by'] = [ |
|
112 | - 'STA_name' => 'ASC', |
|
113 | - ]; |
|
114 | - } |
|
115 | - |
|
116 | - $search = $this->getSearchKeywords($this->args['where']); |
|
117 | - |
|
118 | - if (! empty($search)) { |
|
119 | - // use OR operator to search in any of the fields |
|
120 | - $where_params['OR'] = array( |
|
121 | - 'STA_name' => array('LIKE', '%' . $search . '%'), |
|
122 | - ); |
|
123 | - } |
|
124 | - |
|
125 | - $where_params = apply_filters( |
|
126 | - 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__state_where_params', |
|
127 | - $where_params, |
|
128 | - $this->source, |
|
129 | - $this->args |
|
130 | - ); |
|
131 | - |
|
132 | - $query_args[] = $where_params; |
|
133 | - |
|
134 | - /** |
|
135 | - * Return the $query_args |
|
136 | - */ |
|
137 | - return apply_filters( |
|
138 | - 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__state_query_args', |
|
139 | - $query_args, |
|
140 | - $this->source, |
|
141 | - $this->args |
|
142 | - ); |
|
143 | - } |
|
144 | - |
|
145 | - |
|
146 | - /** |
|
147 | - * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model |
|
148 | - * friendly keys. |
|
149 | - * |
|
150 | - * @param array $where_args |
|
151 | - * @return array |
|
152 | - */ |
|
153 | - public function sanitizeInputFields(array $where_args): array |
|
154 | - { |
|
155 | - $arg_mapping = [ |
|
156 | - 'in' => 'STA_ID', |
|
157 | - 'countryIsoIn' => 'CNT_ISO', |
|
158 | - ]; |
|
159 | - return $this->sanitizeWhereArgsForInputFields( |
|
160 | - $where_args, |
|
161 | - $arg_mapping, |
|
162 | - ['in'] |
|
163 | - ); |
|
164 | - } |
|
17 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
18 | + public function get_loader_name(): string |
|
19 | + { |
|
20 | + return 'espresso_state'; |
|
21 | + } |
|
22 | + |
|
23 | + /** |
|
24 | + * @return EEM_State |
|
25 | + * @throws EE_Error |
|
26 | + * @throws InvalidArgumentException |
|
27 | + * @throws InvalidDataTypeException |
|
28 | + * @throws InvalidInterfaceException |
|
29 | + * @throws ReflectionException |
|
30 | + */ |
|
31 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
32 | + public function get_query(): EEM_State |
|
33 | + { |
|
34 | + return EEM_State::instance(); |
|
35 | + } |
|
36 | + |
|
37 | + |
|
38 | + /** |
|
39 | + * Return an array of item IDs from the query |
|
40 | + * |
|
41 | + * @return array |
|
42 | + */ |
|
43 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
44 | + public function get_ids(): array |
|
45 | + { |
|
46 | + $results = $this->query->get_col($this->query_args); |
|
47 | + |
|
48 | + return ! empty($results) ? $results : []; |
|
49 | + } |
|
50 | + |
|
51 | + |
|
52 | + /** |
|
53 | + * Here, we map the args from the input, then we make sure that we're only querying |
|
54 | + * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers |
|
55 | + * handle batch resolution of the posts. |
|
56 | + * |
|
57 | + * @return array |
|
58 | + * @throws InvalidArgumentException |
|
59 | + * @throws InvalidDataTypeException |
|
60 | + * @throws InvalidInterfaceException |
|
61 | + */ |
|
62 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
63 | + public function get_query_args(): array |
|
64 | + { |
|
65 | + $where_params = []; |
|
66 | + $query_args = []; |
|
67 | + |
|
68 | + $query_args['limit'] = $this->getLimit(); |
|
69 | + |
|
70 | + // Avoid multiple entries by join. |
|
71 | + $query_args['group_by'] = 'STA_ID'; |
|
72 | + |
|
73 | + $query_args['default_where_conditions'] = 'minimum'; |
|
74 | + |
|
75 | + /** |
|
76 | + * Collect the input_fields and sanitize them to prepare them for sending to the Query |
|
77 | + */ |
|
78 | + $input_fields = []; |
|
79 | + if (! empty($this->args['where'])) { |
|
80 | + $input_fields = $this->sanitizeInputFields($this->args['where']); |
|
81 | + |
|
82 | + // Since we do not have any falsy values in query params |
|
83 | + // Lets get rid of empty values |
|
84 | + $input_fields = array_filter($input_fields); |
|
85 | + |
|
86 | + // Use the proper operator. |
|
87 | + if (! empty($input_fields['STA_ID']) && is_array($input_fields['STA_ID'])) { |
|
88 | + $input_fields['STA_ID'] = ['IN', $input_fields['STA_ID']]; |
|
89 | + } |
|
90 | + if (! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
91 | + $input_fields['CNT_ISO'] = ['IN', $input_fields['CNT_ISO']]; |
|
92 | + } |
|
93 | + } |
|
94 | + |
|
95 | + /** |
|
96 | + * Merge the input_fields with the default query_args |
|
97 | + */ |
|
98 | + if (! empty($input_fields)) { |
|
99 | + $where_params = array_merge($where_params, $input_fields); |
|
100 | + } |
|
101 | + |
|
102 | + // limit to active countries by default. |
|
103 | + if (!isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
104 | + $where_params['STA_active'] = true; |
|
105 | + } |
|
106 | + |
|
107 | + [$query_args, $where_params] = $this->mapOrderbyInputArgs($query_args, $where_params, 'STA_ID'); |
|
108 | + |
|
109 | + if (empty($query_args['order_by'])) { |
|
110 | + // set order_by to 'name' by default |
|
111 | + $query_args['order_by'] = [ |
|
112 | + 'STA_name' => 'ASC', |
|
113 | + ]; |
|
114 | + } |
|
115 | + |
|
116 | + $search = $this->getSearchKeywords($this->args['where']); |
|
117 | + |
|
118 | + if (! empty($search)) { |
|
119 | + // use OR operator to search in any of the fields |
|
120 | + $where_params['OR'] = array( |
|
121 | + 'STA_name' => array('LIKE', '%' . $search . '%'), |
|
122 | + ); |
|
123 | + } |
|
124 | + |
|
125 | + $where_params = apply_filters( |
|
126 | + 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__state_where_params', |
|
127 | + $where_params, |
|
128 | + $this->source, |
|
129 | + $this->args |
|
130 | + ); |
|
131 | + |
|
132 | + $query_args[] = $where_params; |
|
133 | + |
|
134 | + /** |
|
135 | + * Return the $query_args |
|
136 | + */ |
|
137 | + return apply_filters( |
|
138 | + 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__state_query_args', |
|
139 | + $query_args, |
|
140 | + $this->source, |
|
141 | + $this->args |
|
142 | + ); |
|
143 | + } |
|
144 | + |
|
145 | + |
|
146 | + /** |
|
147 | + * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model |
|
148 | + * friendly keys. |
|
149 | + * |
|
150 | + * @param array $where_args |
|
151 | + * @return array |
|
152 | + */ |
|
153 | + public function sanitizeInputFields(array $where_args): array |
|
154 | + { |
|
155 | + $arg_mapping = [ |
|
156 | + 'in' => 'STA_ID', |
|
157 | + 'countryIsoIn' => 'CNT_ISO', |
|
158 | + ]; |
|
159 | + return $this->sanitizeWhereArgsForInputFields( |
|
160 | + $where_args, |
|
161 | + $arg_mapping, |
|
162 | + ['in'] |
|
163 | + ); |
|
164 | + } |
|
165 | 165 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * Collect the input_fields and sanitize them to prepare them for sending to the Query |
77 | 77 | */ |
78 | 78 | $input_fields = []; |
79 | - if (! empty($this->args['where'])) { |
|
79 | + if ( ! empty($this->args['where'])) { |
|
80 | 80 | $input_fields = $this->sanitizeInputFields($this->args['where']); |
81 | 81 | |
82 | 82 | // Since we do not have any falsy values in query params |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | $input_fields = array_filter($input_fields); |
85 | 85 | |
86 | 86 | // Use the proper operator. |
87 | - if (! empty($input_fields['STA_ID']) && is_array($input_fields['STA_ID'])) { |
|
87 | + if ( ! empty($input_fields['STA_ID']) && is_array($input_fields['STA_ID'])) { |
|
88 | 88 | $input_fields['STA_ID'] = ['IN', $input_fields['STA_ID']]; |
89 | 89 | } |
90 | - if (! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
90 | + if ( ! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
91 | 91 | $input_fields['CNT_ISO'] = ['IN', $input_fields['CNT_ISO']]; |
92 | 92 | } |
93 | 93 | } |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * Merge the input_fields with the default query_args |
97 | 97 | */ |
98 | - if (! empty($input_fields)) { |
|
98 | + if ( ! empty($input_fields)) { |
|
99 | 99 | $where_params = array_merge($where_params, $input_fields); |
100 | 100 | } |
101 | 101 | |
102 | 102 | // limit to active countries by default. |
103 | - if (!isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
103 | + if ( ! isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
104 | 104 | $where_params['STA_active'] = true; |
105 | 105 | } |
106 | 106 | |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | |
116 | 116 | $search = $this->getSearchKeywords($this->args['where']); |
117 | 117 | |
118 | - if (! empty($search)) { |
|
118 | + if ( ! empty($search)) { |
|
119 | 119 | // use OR operator to search in any of the fields |
120 | 120 | $where_params['OR'] = array( |
121 | - 'STA_name' => array('LIKE', '%' . $search . '%'), |
|
121 | + 'STA_name' => array('LIKE', '%'.$search.'%'), |
|
122 | 122 | ); |
123 | 123 | } |
124 | 124 |
@@ -16,170 +16,170 @@ |
||
16 | 16 | */ |
17 | 17 | class CountryConnectionResolver extends AbstractConnectionResolver |
18 | 18 | { |
19 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
20 | - public function get_loader_name(): string |
|
21 | - { |
|
22 | - return 'espresso_country'; |
|
23 | - } |
|
24 | - |
|
25 | - /** |
|
26 | - * @return EEM_Country |
|
27 | - * @throws EE_Error |
|
28 | - * @throws InvalidArgumentException |
|
29 | - * @throws InvalidDataTypeException |
|
30 | - * @throws InvalidInterfaceException |
|
31 | - * @throws ReflectionException |
|
32 | - */ |
|
33 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
34 | - public function get_query(): EEM_Country |
|
35 | - { |
|
36 | - return EEM_Country::instance(); |
|
37 | - } |
|
38 | - |
|
39 | - |
|
40 | - /** |
|
41 | - * Return an array of item IDs from the query |
|
42 | - * |
|
43 | - * @return array |
|
44 | - */ |
|
45 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
46 | - public function get_ids(): array |
|
47 | - { |
|
48 | - $results = $this->query->get_col($this->query_args); |
|
49 | - |
|
50 | - return ! empty($results) ? $results : []; |
|
51 | - } |
|
52 | - |
|
53 | - /** |
|
54 | - * Get_query_amount |
|
55 | - * |
|
56 | - * Returns the max between what was requested and what is defined as the $max_query_amount to |
|
57 | - * ensure that queries don't exceed unwanted limits when querying data. |
|
58 | - * |
|
59 | - * @return int |
|
60 | - * @throws Exception |
|
61 | - */ |
|
62 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
63 | - public function get_query_amount() |
|
64 | - { |
|
65 | - // Override the default limit (100) for countries |
|
66 | - return 300; |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * Here, we map the args from the input, then we make sure that we're only querying |
|
72 | - * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers |
|
73 | - * handle batch resolution of the posts. |
|
74 | - * |
|
75 | - * @return array |
|
76 | - * @throws InvalidArgumentException |
|
77 | - * @throws InvalidDataTypeException |
|
78 | - * @throws InvalidInterfaceException |
|
79 | - */ |
|
80 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
81 | - public function get_query_args(): array |
|
82 | - { |
|
83 | - $where_params = []; |
|
84 | - $query_args = []; |
|
85 | - |
|
86 | - $query_args['limit'] = $this->getLimit(); |
|
87 | - |
|
88 | - // Avoid multiple entries by join. |
|
89 | - $query_args['group_by'] = 'CNT_ISO'; |
|
90 | - |
|
91 | - $query_args['default_where_conditions'] = 'minimum'; |
|
92 | - |
|
93 | - /** |
|
94 | - * Collect the input_fields and sanitize them to prepare them for sending to the Query |
|
95 | - */ |
|
96 | - $input_fields = []; |
|
97 | - if (! empty($this->args['where'])) { |
|
98 | - $input_fields = $this->sanitizeInputFields($this->args['where']); |
|
99 | - |
|
100 | - // Since we do not have any falsy values in query params |
|
101 | - // Lets get rid of empty values |
|
102 | - $input_fields = array_filter($input_fields); |
|
103 | - |
|
104 | - // Use the proper operator. |
|
105 | - if (! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
106 | - $input_fields['CNT_ISO'] = ['IN', $input_fields['CNT_ISO']]; |
|
107 | - } |
|
108 | - if (! empty($input_fields['CNT_ISO3']) && is_array($input_fields['CNT_ISO3'])) { |
|
109 | - $input_fields['CNT_ISO3'] = ['IN', $input_fields['CNT_ISO3']]; |
|
110 | - } |
|
111 | - } |
|
112 | - |
|
113 | - /** |
|
114 | - * Merge the input_fields with the default query_args |
|
115 | - */ |
|
116 | - if (! empty($input_fields)) { |
|
117 | - $where_params = array_merge($where_params, $input_fields); |
|
118 | - } |
|
119 | - |
|
120 | - // limit to active countries by default. |
|
121 | - if (!isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
122 | - $where_params['CNT_active'] = true; |
|
123 | - } |
|
124 | - |
|
125 | - [$query_args, $where_params] = $this->mapOrderbyInputArgs($query_args, $where_params, 'CNT_ISO'); |
|
126 | - |
|
127 | - if (empty($query_args['order_by'])) { |
|
128 | - // set order_by to 'name' by default |
|
129 | - $query_args['order_by'] = [ |
|
130 | - 'CNT_name' => 'ASC', |
|
131 | - ]; |
|
132 | - } |
|
133 | - |
|
134 | - $search = $this->getSearchKeywords($this->args['where']); |
|
135 | - |
|
136 | - if (! empty($search)) { |
|
137 | - // use OR operator to search in any of the fields |
|
138 | - $where_params['OR'] = array( |
|
139 | - 'CNT_name' => array('LIKE', '%' . $search . '%'), |
|
140 | - 'CNT_ISO' => array('LIKE', '%' . $search . '%'), |
|
141 | - ); |
|
142 | - } |
|
143 | - |
|
144 | - $where_params = apply_filters( |
|
145 | - 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__country_where_params', |
|
146 | - $where_params, |
|
147 | - $this->source, |
|
148 | - $this->args |
|
149 | - ); |
|
150 | - |
|
151 | - $query_args[] = $where_params; |
|
152 | - |
|
153 | - /** |
|
154 | - * Return the $query_args |
|
155 | - */ |
|
156 | - return apply_filters( |
|
157 | - 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__country_query_args', |
|
158 | - $query_args, |
|
159 | - $this->source, |
|
160 | - $this->args |
|
161 | - ); |
|
162 | - } |
|
163 | - |
|
164 | - |
|
165 | - /** |
|
166 | - * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model |
|
167 | - * friendly keys. |
|
168 | - * |
|
169 | - * @param array $where_args |
|
170 | - * @return array |
|
171 | - */ |
|
172 | - public function sanitizeInputFields(array $where_args): array |
|
173 | - { |
|
174 | - $arg_mapping = [ |
|
175 | - 'isoIn' => 'CNT_ISO', |
|
176 | - 'in' => 'CNT_ISO', |
|
177 | - 'iso3In' => 'CNT_ISO3', |
|
178 | - ]; |
|
179 | - return $this->sanitizeWhereArgsForInputFields( |
|
180 | - $where_args, |
|
181 | - $arg_mapping, |
|
182 | - ['in'] |
|
183 | - ); |
|
184 | - } |
|
19 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
20 | + public function get_loader_name(): string |
|
21 | + { |
|
22 | + return 'espresso_country'; |
|
23 | + } |
|
24 | + |
|
25 | + /** |
|
26 | + * @return EEM_Country |
|
27 | + * @throws EE_Error |
|
28 | + * @throws InvalidArgumentException |
|
29 | + * @throws InvalidDataTypeException |
|
30 | + * @throws InvalidInterfaceException |
|
31 | + * @throws ReflectionException |
|
32 | + */ |
|
33 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
34 | + public function get_query(): EEM_Country |
|
35 | + { |
|
36 | + return EEM_Country::instance(); |
|
37 | + } |
|
38 | + |
|
39 | + |
|
40 | + /** |
|
41 | + * Return an array of item IDs from the query |
|
42 | + * |
|
43 | + * @return array |
|
44 | + */ |
|
45 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
46 | + public function get_ids(): array |
|
47 | + { |
|
48 | + $results = $this->query->get_col($this->query_args); |
|
49 | + |
|
50 | + return ! empty($results) ? $results : []; |
|
51 | + } |
|
52 | + |
|
53 | + /** |
|
54 | + * Get_query_amount |
|
55 | + * |
|
56 | + * Returns the max between what was requested and what is defined as the $max_query_amount to |
|
57 | + * ensure that queries don't exceed unwanted limits when querying data. |
|
58 | + * |
|
59 | + * @return int |
|
60 | + * @throws Exception |
|
61 | + */ |
|
62 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
63 | + public function get_query_amount() |
|
64 | + { |
|
65 | + // Override the default limit (100) for countries |
|
66 | + return 300; |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * Here, we map the args from the input, then we make sure that we're only querying |
|
72 | + * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers |
|
73 | + * handle batch resolution of the posts. |
|
74 | + * |
|
75 | + * @return array |
|
76 | + * @throws InvalidArgumentException |
|
77 | + * @throws InvalidDataTypeException |
|
78 | + * @throws InvalidInterfaceException |
|
79 | + */ |
|
80 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
81 | + public function get_query_args(): array |
|
82 | + { |
|
83 | + $where_params = []; |
|
84 | + $query_args = []; |
|
85 | + |
|
86 | + $query_args['limit'] = $this->getLimit(); |
|
87 | + |
|
88 | + // Avoid multiple entries by join. |
|
89 | + $query_args['group_by'] = 'CNT_ISO'; |
|
90 | + |
|
91 | + $query_args['default_where_conditions'] = 'minimum'; |
|
92 | + |
|
93 | + /** |
|
94 | + * Collect the input_fields and sanitize them to prepare them for sending to the Query |
|
95 | + */ |
|
96 | + $input_fields = []; |
|
97 | + if (! empty($this->args['where'])) { |
|
98 | + $input_fields = $this->sanitizeInputFields($this->args['where']); |
|
99 | + |
|
100 | + // Since we do not have any falsy values in query params |
|
101 | + // Lets get rid of empty values |
|
102 | + $input_fields = array_filter($input_fields); |
|
103 | + |
|
104 | + // Use the proper operator. |
|
105 | + if (! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
106 | + $input_fields['CNT_ISO'] = ['IN', $input_fields['CNT_ISO']]; |
|
107 | + } |
|
108 | + if (! empty($input_fields['CNT_ISO3']) && is_array($input_fields['CNT_ISO3'])) { |
|
109 | + $input_fields['CNT_ISO3'] = ['IN', $input_fields['CNT_ISO3']]; |
|
110 | + } |
|
111 | + } |
|
112 | + |
|
113 | + /** |
|
114 | + * Merge the input_fields with the default query_args |
|
115 | + */ |
|
116 | + if (! empty($input_fields)) { |
|
117 | + $where_params = array_merge($where_params, $input_fields); |
|
118 | + } |
|
119 | + |
|
120 | + // limit to active countries by default. |
|
121 | + if (!isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
122 | + $where_params['CNT_active'] = true; |
|
123 | + } |
|
124 | + |
|
125 | + [$query_args, $where_params] = $this->mapOrderbyInputArgs($query_args, $where_params, 'CNT_ISO'); |
|
126 | + |
|
127 | + if (empty($query_args['order_by'])) { |
|
128 | + // set order_by to 'name' by default |
|
129 | + $query_args['order_by'] = [ |
|
130 | + 'CNT_name' => 'ASC', |
|
131 | + ]; |
|
132 | + } |
|
133 | + |
|
134 | + $search = $this->getSearchKeywords($this->args['where']); |
|
135 | + |
|
136 | + if (! empty($search)) { |
|
137 | + // use OR operator to search in any of the fields |
|
138 | + $where_params['OR'] = array( |
|
139 | + 'CNT_name' => array('LIKE', '%' . $search . '%'), |
|
140 | + 'CNT_ISO' => array('LIKE', '%' . $search . '%'), |
|
141 | + ); |
|
142 | + } |
|
143 | + |
|
144 | + $where_params = apply_filters( |
|
145 | + 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__country_where_params', |
|
146 | + $where_params, |
|
147 | + $this->source, |
|
148 | + $this->args |
|
149 | + ); |
|
150 | + |
|
151 | + $query_args[] = $where_params; |
|
152 | + |
|
153 | + /** |
|
154 | + * Return the $query_args |
|
155 | + */ |
|
156 | + return apply_filters( |
|
157 | + 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__country_query_args', |
|
158 | + $query_args, |
|
159 | + $this->source, |
|
160 | + $this->args |
|
161 | + ); |
|
162 | + } |
|
163 | + |
|
164 | + |
|
165 | + /** |
|
166 | + * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model |
|
167 | + * friendly keys. |
|
168 | + * |
|
169 | + * @param array $where_args |
|
170 | + * @return array |
|
171 | + */ |
|
172 | + public function sanitizeInputFields(array $where_args): array |
|
173 | + { |
|
174 | + $arg_mapping = [ |
|
175 | + 'isoIn' => 'CNT_ISO', |
|
176 | + 'in' => 'CNT_ISO', |
|
177 | + 'iso3In' => 'CNT_ISO3', |
|
178 | + ]; |
|
179 | + return $this->sanitizeWhereArgsForInputFields( |
|
180 | + $where_args, |
|
181 | + $arg_mapping, |
|
182 | + ['in'] |
|
183 | + ); |
|
184 | + } |
|
185 | 185 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * Collect the input_fields and sanitize them to prepare them for sending to the Query |
95 | 95 | */ |
96 | 96 | $input_fields = []; |
97 | - if (! empty($this->args['where'])) { |
|
97 | + if ( ! empty($this->args['where'])) { |
|
98 | 98 | $input_fields = $this->sanitizeInputFields($this->args['where']); |
99 | 99 | |
100 | 100 | // Since we do not have any falsy values in query params |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | $input_fields = array_filter($input_fields); |
103 | 103 | |
104 | 104 | // Use the proper operator. |
105 | - if (! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
105 | + if ( ! empty($input_fields['CNT_ISO']) && is_array($input_fields['CNT_ISO'])) { |
|
106 | 106 | $input_fields['CNT_ISO'] = ['IN', $input_fields['CNT_ISO']]; |
107 | 107 | } |
108 | - if (! empty($input_fields['CNT_ISO3']) && is_array($input_fields['CNT_ISO3'])) { |
|
108 | + if ( ! empty($input_fields['CNT_ISO3']) && is_array($input_fields['CNT_ISO3'])) { |
|
109 | 109 | $input_fields['CNT_ISO3'] = ['IN', $input_fields['CNT_ISO3']]; |
110 | 110 | } |
111 | 111 | } |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | /** |
114 | 114 | * Merge the input_fields with the default query_args |
115 | 115 | */ |
116 | - if (! empty($input_fields)) { |
|
116 | + if ( ! empty($input_fields)) { |
|
117 | 117 | $where_params = array_merge($where_params, $input_fields); |
118 | 118 | } |
119 | 119 | |
120 | 120 | // limit to active countries by default. |
121 | - if (!isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
121 | + if ( ! isset($this->args['where']['activeOnly']) || $this->args['where']['activeOnly']) { |
|
122 | 122 | $where_params['CNT_active'] = true; |
123 | 123 | } |
124 | 124 | |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | |
134 | 134 | $search = $this->getSearchKeywords($this->args['where']); |
135 | 135 | |
136 | - if (! empty($search)) { |
|
136 | + if ( ! empty($search)) { |
|
137 | 137 | // use OR operator to search in any of the fields |
138 | 138 | $where_params['OR'] = array( |
139 | - 'CNT_name' => array('LIKE', '%' . $search . '%'), |
|
140 | - 'CNT_ISO' => array('LIKE', '%' . $search . '%'), |
|
139 | + 'CNT_name' => array('LIKE', '%'.$search.'%'), |
|
140 | + 'CNT_ISO' => array('LIKE', '%'.$search.'%'), |
|
141 | 141 | ); |
142 | 142 | } |
143 | 143 |
@@ -19,231 +19,231 @@ |
||
19 | 19 | */ |
20 | 20 | class GQLRequests extends Route |
21 | 21 | { |
22 | - /** |
|
23 | - * @var AssetManifestFactory |
|
24 | - */ |
|
25 | - private $manifest_factory; |
|
22 | + /** |
|
23 | + * @var AssetManifestFactory |
|
24 | + */ |
|
25 | + private $manifest_factory; |
|
26 | 26 | |
27 | 27 | |
28 | - /** |
|
29 | - * AssetRequests constructor. |
|
30 | - * |
|
31 | - * @param EE_Dependency_Map $dependency_map |
|
32 | - * @param LoaderInterface $loader |
|
33 | - * @param RequestInterface $request |
|
34 | - * @param AssetManifestFactory $manifest_factory |
|
35 | - */ |
|
36 | - public function __construct( |
|
37 | - EE_Dependency_Map $dependency_map, |
|
38 | - LoaderInterface $loader, |
|
39 | - RequestInterface $request, |
|
40 | - AssetManifestFactory $manifest_factory |
|
41 | - ) { |
|
42 | - $this->manifest_factory = $manifest_factory; |
|
43 | - parent::__construct($dependency_map, $loader, $request); |
|
44 | - } |
|
28 | + /** |
|
29 | + * AssetRequests constructor. |
|
30 | + * |
|
31 | + * @param EE_Dependency_Map $dependency_map |
|
32 | + * @param LoaderInterface $loader |
|
33 | + * @param RequestInterface $request |
|
34 | + * @param AssetManifestFactory $manifest_factory |
|
35 | + */ |
|
36 | + public function __construct( |
|
37 | + EE_Dependency_Map $dependency_map, |
|
38 | + LoaderInterface $loader, |
|
39 | + RequestInterface $request, |
|
40 | + AssetManifestFactory $manifest_factory |
|
41 | + ) { |
|
42 | + $this->manifest_factory = $manifest_factory; |
|
43 | + parent::__construct($dependency_map, $loader, $request); |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * returns true if the current request matches this route |
|
49 | - * |
|
50 | - * @return bool |
|
51 | - * @since $VID:$ |
|
52 | - */ |
|
53 | - public function matchesCurrentRequest(): bool |
|
54 | - { |
|
55 | - global $pagenow; |
|
56 | - return ( |
|
57 | - $this->request->isGQL() |
|
58 | - || $this->request->isUnitTesting() |
|
59 | - || ( |
|
60 | - $this->request->isAdmin() |
|
61 | - && $this->request->getRequestParam('page') === 'espresso_events' |
|
62 | - && ( |
|
63 | - $this->request->getRequestParam('action') === 'create_new' |
|
64 | - || $this->request->getRequestParam('action') === 'edit' |
|
65 | - ) |
|
66 | - ) |
|
67 | - || ( |
|
68 | - $pagenow |
|
69 | - && ( |
|
70 | - $pagenow === 'post-new.php' |
|
71 | - || ( |
|
72 | - $pagenow === 'post.php' |
|
73 | - && $this->request->getRequestParam('action') === 'edit' |
|
74 | - ) |
|
75 | - ) |
|
76 | - ) |
|
77 | - ); |
|
78 | - } |
|
47 | + /** |
|
48 | + * returns true if the current request matches this route |
|
49 | + * |
|
50 | + * @return bool |
|
51 | + * @since $VID:$ |
|
52 | + */ |
|
53 | + public function matchesCurrentRequest(): bool |
|
54 | + { |
|
55 | + global $pagenow; |
|
56 | + return ( |
|
57 | + $this->request->isGQL() |
|
58 | + || $this->request->isUnitTesting() |
|
59 | + || ( |
|
60 | + $this->request->isAdmin() |
|
61 | + && $this->request->getRequestParam('page') === 'espresso_events' |
|
62 | + && ( |
|
63 | + $this->request->getRequestParam('action') === 'create_new' |
|
64 | + || $this->request->getRequestParam('action') === 'edit' |
|
65 | + ) |
|
66 | + ) |
|
67 | + || ( |
|
68 | + $pagenow |
|
69 | + && ( |
|
70 | + $pagenow === 'post-new.php' |
|
71 | + || ( |
|
72 | + $pagenow === 'post.php' |
|
73 | + && $this->request->getRequestParam('action') === 'edit' |
|
74 | + ) |
|
75 | + ) |
|
76 | + ) |
|
77 | + ); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * @since $VID:$ |
|
83 | - */ |
|
84 | - protected function registerDependencies() |
|
85 | - { |
|
86 | - $this->dependency_map->registerDependencies( |
|
87 | - 'EventEspresso\core\services\graphql\GraphQLManager', |
|
88 | - [ |
|
89 | - 'EventEspresso\core\services\graphql\ConnectionsManager' => EE_Dependency_Map::load_from_cache, |
|
90 | - 'EventEspresso\core\services\graphql\DataLoaderManager' => EE_Dependency_Map::load_from_cache, |
|
91 | - 'EventEspresso\core\services\graphql\EnumsManager' => EE_Dependency_Map::load_from_cache, |
|
92 | - 'EventEspresso\core\services\graphql\InputsManager' => EE_Dependency_Map::load_from_cache, |
|
93 | - 'EventEspresso\core\services\graphql\TypesManager' => EE_Dependency_Map::load_from_cache, |
|
94 | - ] |
|
95 | - ); |
|
96 | - $this->dependency_map->registerDependencies( |
|
97 | - 'EventEspresso\core\services\graphql\TypesManager', |
|
98 | - [ |
|
99 | - 'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache, |
|
100 | - ] |
|
101 | - ); |
|
102 | - $this->dependency_map->registerDependencies( |
|
103 | - 'EventEspresso\core\services\graphql\InputsManager', |
|
104 | - [ |
|
105 | - 'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache, |
|
106 | - ] |
|
107 | - ); |
|
108 | - $this->dependency_map->registerDependencies( |
|
109 | - 'EventEspresso\core\services\graphql\EnumsManager', |
|
110 | - [ |
|
111 | - 'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache, |
|
112 | - ] |
|
113 | - ); |
|
114 | - $this->dependency_map->registerDependencies( |
|
115 | - 'EventEspresso\core\services\graphql\ConnectionsManager', |
|
116 | - [ |
|
117 | - 'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache, |
|
118 | - ] |
|
119 | - ); |
|
120 | - $this->dependency_map->registerDependencies( |
|
121 | - 'EventEspresso\core\services\graphql\DataLoaderManager', |
|
122 | - [ |
|
123 | - 'EventEspresso\core\services\graphql\loaders\DataLoaderCollection' => EE_Dependency_Map::load_from_cache, |
|
124 | - ] |
|
125 | - ); |
|
126 | - $this->dependency_map->registerDependencies( |
|
127 | - 'EventEspresso\core\domain\services\graphql\types\Datetime', |
|
128 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
129 | - ); |
|
130 | - $this->dependency_map->registerDependencies( |
|
131 | - 'EventEspresso\core\domain\services\graphql\types\Attendee', |
|
132 | - ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
133 | - ); |
|
134 | - $this->dependency_map->registerDependencies( |
|
135 | - 'EventEspresso\core\domain\services\graphql\types\Event', |
|
136 | - ['EEM_Event' => EE_Dependency_Map::load_from_cache] |
|
137 | - ); |
|
138 | - $this->dependency_map->registerDependencies( |
|
139 | - 'EventEspresso\core\domain\services\graphql\types\FormElement', |
|
140 | - ['EEM_Form_Element' => EE_Dependency_Map::load_from_cache] |
|
141 | - ); |
|
142 | - $this->dependency_map->registerDependencies( |
|
143 | - 'EventEspresso\core\domain\services\graphql\types\FormSection', |
|
144 | - ['EEM_Form_Section' => EE_Dependency_Map::load_from_cache] |
|
145 | - ); |
|
146 | - $this->dependency_map->registerDependencies( |
|
147 | - 'EventEspresso\core\domain\services\graphql\types\Ticket', |
|
148 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
149 | - ); |
|
150 | - $this->dependency_map->registerDependencies( |
|
151 | - 'EventEspresso\core\domain\services\graphql\types\Price', |
|
152 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
153 | - ); |
|
154 | - $this->dependency_map->registerDependencies( |
|
155 | - 'EventEspresso\core\domain\services\graphql\types\PriceType', |
|
156 | - ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
157 | - ); |
|
158 | - $this->dependency_map->registerDependencies( |
|
159 | - 'EventEspresso\core\domain\services\graphql\types\Venue', |
|
160 | - ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
161 | - ); |
|
162 | - $this->dependency_map->registerDependencies( |
|
163 | - 'EventEspresso\core\domain\services\graphql\types\State', |
|
164 | - ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
165 | - ); |
|
166 | - $this->dependency_map->registerDependencies( |
|
167 | - 'EventEspresso\core\domain\services\graphql\types\Country', |
|
168 | - ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
169 | - ); |
|
170 | - $this->dependency_map->registerDependencies( |
|
171 | - 'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection', |
|
172 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
173 | - ); |
|
174 | - $this->dependency_map->registerDependencies( |
|
175 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection', |
|
176 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
177 | - ); |
|
178 | - $this->dependency_map->registerDependencies( |
|
179 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryAttendeesConnection', |
|
180 | - ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
181 | - ); |
|
182 | - $this->dependency_map->registerDependencies( |
|
183 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryCountriesConnection', |
|
184 | - ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
185 | - ); |
|
186 | - $this->dependency_map->registerDependencies( |
|
187 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryFormElementsConnection', |
|
188 | - ['EEM_Form_Element' => EE_Dependency_Map::load_from_cache] |
|
189 | - ); |
|
190 | - $this->dependency_map->registerDependencies( |
|
191 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryFormSectionsConnection', |
|
192 | - ['EEM_Form_Section' => EE_Dependency_Map::load_from_cache] |
|
193 | - ); |
|
194 | - $this->dependency_map->registerDependencies( |
|
195 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryStatesConnection', |
|
196 | - ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
197 | - ); |
|
198 | - $this->dependency_map->registerDependencies( |
|
199 | - 'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection', |
|
200 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
201 | - ); |
|
202 | - $this->dependency_map->registerDependencies( |
|
203 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection', |
|
204 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
205 | - ); |
|
206 | - $this->dependency_map->registerDependencies( |
|
207 | - 'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection', |
|
208 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
209 | - ); |
|
210 | - $this->dependency_map->registerDependencies( |
|
211 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection', |
|
212 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
213 | - ); |
|
214 | - $this->dependency_map->registerDependencies( |
|
215 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection', |
|
216 | - ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
217 | - ); |
|
218 | - $this->dependency_map->registerDependencies( |
|
219 | - 'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection', |
|
220 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
221 | - ); |
|
222 | - $this->dependency_map->registerDependencies( |
|
223 | - 'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection', |
|
224 | - ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
225 | - ); |
|
226 | - } |
|
81 | + /** |
|
82 | + * @since $VID:$ |
|
83 | + */ |
|
84 | + protected function registerDependencies() |
|
85 | + { |
|
86 | + $this->dependency_map->registerDependencies( |
|
87 | + 'EventEspresso\core\services\graphql\GraphQLManager', |
|
88 | + [ |
|
89 | + 'EventEspresso\core\services\graphql\ConnectionsManager' => EE_Dependency_Map::load_from_cache, |
|
90 | + 'EventEspresso\core\services\graphql\DataLoaderManager' => EE_Dependency_Map::load_from_cache, |
|
91 | + 'EventEspresso\core\services\graphql\EnumsManager' => EE_Dependency_Map::load_from_cache, |
|
92 | + 'EventEspresso\core\services\graphql\InputsManager' => EE_Dependency_Map::load_from_cache, |
|
93 | + 'EventEspresso\core\services\graphql\TypesManager' => EE_Dependency_Map::load_from_cache, |
|
94 | + ] |
|
95 | + ); |
|
96 | + $this->dependency_map->registerDependencies( |
|
97 | + 'EventEspresso\core\services\graphql\TypesManager', |
|
98 | + [ |
|
99 | + 'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache, |
|
100 | + ] |
|
101 | + ); |
|
102 | + $this->dependency_map->registerDependencies( |
|
103 | + 'EventEspresso\core\services\graphql\InputsManager', |
|
104 | + [ |
|
105 | + 'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache, |
|
106 | + ] |
|
107 | + ); |
|
108 | + $this->dependency_map->registerDependencies( |
|
109 | + 'EventEspresso\core\services\graphql\EnumsManager', |
|
110 | + [ |
|
111 | + 'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache, |
|
112 | + ] |
|
113 | + ); |
|
114 | + $this->dependency_map->registerDependencies( |
|
115 | + 'EventEspresso\core\services\graphql\ConnectionsManager', |
|
116 | + [ |
|
117 | + 'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache, |
|
118 | + ] |
|
119 | + ); |
|
120 | + $this->dependency_map->registerDependencies( |
|
121 | + 'EventEspresso\core\services\graphql\DataLoaderManager', |
|
122 | + [ |
|
123 | + 'EventEspresso\core\services\graphql\loaders\DataLoaderCollection' => EE_Dependency_Map::load_from_cache, |
|
124 | + ] |
|
125 | + ); |
|
126 | + $this->dependency_map->registerDependencies( |
|
127 | + 'EventEspresso\core\domain\services\graphql\types\Datetime', |
|
128 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
129 | + ); |
|
130 | + $this->dependency_map->registerDependencies( |
|
131 | + 'EventEspresso\core\domain\services\graphql\types\Attendee', |
|
132 | + ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
133 | + ); |
|
134 | + $this->dependency_map->registerDependencies( |
|
135 | + 'EventEspresso\core\domain\services\graphql\types\Event', |
|
136 | + ['EEM_Event' => EE_Dependency_Map::load_from_cache] |
|
137 | + ); |
|
138 | + $this->dependency_map->registerDependencies( |
|
139 | + 'EventEspresso\core\domain\services\graphql\types\FormElement', |
|
140 | + ['EEM_Form_Element' => EE_Dependency_Map::load_from_cache] |
|
141 | + ); |
|
142 | + $this->dependency_map->registerDependencies( |
|
143 | + 'EventEspresso\core\domain\services\graphql\types\FormSection', |
|
144 | + ['EEM_Form_Section' => EE_Dependency_Map::load_from_cache] |
|
145 | + ); |
|
146 | + $this->dependency_map->registerDependencies( |
|
147 | + 'EventEspresso\core\domain\services\graphql\types\Ticket', |
|
148 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
149 | + ); |
|
150 | + $this->dependency_map->registerDependencies( |
|
151 | + 'EventEspresso\core\domain\services\graphql\types\Price', |
|
152 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
153 | + ); |
|
154 | + $this->dependency_map->registerDependencies( |
|
155 | + 'EventEspresso\core\domain\services\graphql\types\PriceType', |
|
156 | + ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
157 | + ); |
|
158 | + $this->dependency_map->registerDependencies( |
|
159 | + 'EventEspresso\core\domain\services\graphql\types\Venue', |
|
160 | + ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
161 | + ); |
|
162 | + $this->dependency_map->registerDependencies( |
|
163 | + 'EventEspresso\core\domain\services\graphql\types\State', |
|
164 | + ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
165 | + ); |
|
166 | + $this->dependency_map->registerDependencies( |
|
167 | + 'EventEspresso\core\domain\services\graphql\types\Country', |
|
168 | + ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
169 | + ); |
|
170 | + $this->dependency_map->registerDependencies( |
|
171 | + 'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection', |
|
172 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
173 | + ); |
|
174 | + $this->dependency_map->registerDependencies( |
|
175 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection', |
|
176 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
177 | + ); |
|
178 | + $this->dependency_map->registerDependencies( |
|
179 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryAttendeesConnection', |
|
180 | + ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
181 | + ); |
|
182 | + $this->dependency_map->registerDependencies( |
|
183 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryCountriesConnection', |
|
184 | + ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
185 | + ); |
|
186 | + $this->dependency_map->registerDependencies( |
|
187 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryFormElementsConnection', |
|
188 | + ['EEM_Form_Element' => EE_Dependency_Map::load_from_cache] |
|
189 | + ); |
|
190 | + $this->dependency_map->registerDependencies( |
|
191 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryFormSectionsConnection', |
|
192 | + ['EEM_Form_Section' => EE_Dependency_Map::load_from_cache] |
|
193 | + ); |
|
194 | + $this->dependency_map->registerDependencies( |
|
195 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryStatesConnection', |
|
196 | + ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
197 | + ); |
|
198 | + $this->dependency_map->registerDependencies( |
|
199 | + 'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection', |
|
200 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
201 | + ); |
|
202 | + $this->dependency_map->registerDependencies( |
|
203 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection', |
|
204 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
205 | + ); |
|
206 | + $this->dependency_map->registerDependencies( |
|
207 | + 'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection', |
|
208 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
209 | + ); |
|
210 | + $this->dependency_map->registerDependencies( |
|
211 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection', |
|
212 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
213 | + ); |
|
214 | + $this->dependency_map->registerDependencies( |
|
215 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection', |
|
216 | + ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
217 | + ); |
|
218 | + $this->dependency_map->registerDependencies( |
|
219 | + 'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection', |
|
220 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
221 | + ); |
|
222 | + $this->dependency_map->registerDependencies( |
|
223 | + 'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection', |
|
224 | + ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
225 | + ); |
|
226 | + } |
|
227 | 227 | |
228 | 228 | |
229 | - /** |
|
230 | - * implements logic required to run during request |
|
231 | - * |
|
232 | - * @return bool |
|
233 | - * @since $VID:$ |
|
234 | - */ |
|
235 | - protected function requestHandler(): bool |
|
236 | - { |
|
237 | - if (! class_exists('WPGraphQL')) { |
|
238 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
239 | - } |
|
240 | - // load handler for EE GraphQL requests |
|
241 | - $graphQL_manager = $this->loader->getShared( |
|
242 | - 'EventEspresso\core\services\graphql\GraphQLManager' |
|
243 | - ); |
|
244 | - $graphQL_manager->init(); |
|
245 | - $manifest = $this->manifest_factory->createFromDomainObject(DomainFactory::getEventEspressoCoreDomain()); |
|
246 | - $manifest->initialize(); |
|
247 | - return true; |
|
248 | - } |
|
229 | + /** |
|
230 | + * implements logic required to run during request |
|
231 | + * |
|
232 | + * @return bool |
|
233 | + * @since $VID:$ |
|
234 | + */ |
|
235 | + protected function requestHandler(): bool |
|
236 | + { |
|
237 | + if (! class_exists('WPGraphQL')) { |
|
238 | + require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
239 | + } |
|
240 | + // load handler for EE GraphQL requests |
|
241 | + $graphQL_manager = $this->loader->getShared( |
|
242 | + 'EventEspresso\core\services\graphql\GraphQLManager' |
|
243 | + ); |
|
244 | + $graphQL_manager->init(); |
|
245 | + $manifest = $this->manifest_factory->createFromDomainObject(DomainFactory::getEventEspressoCoreDomain()); |
|
246 | + $manifest->initialize(); |
|
247 | + return true; |
|
248 | + } |
|
249 | 249 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | function espresso_ticket_selector( $event = NULL ) { |
207 | 207 | if ( ! apply_filters( 'FHEE_disable_espresso_ticket_selector', FALSE ) ) { |
208 | 208 | espresso_load_ticket_selector(); |
209 | - \EED_Ticket_Selector::set_definitions(); |
|
209 | + \EED_Ticket_Selector::set_definitions(); |
|
210 | 210 | echo EED_Ticket_Selector::display_ticket_selector( $event ); |
211 | 211 | } |
212 | 212 | } |
@@ -460,12 +460,12 @@ discard block |
||
460 | 460 | * @return string |
461 | 461 | */ |
462 | 462 | function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) { |
463 | - $arguments = apply_filters( |
|
464 | - 'FHEE__espresso_list_of_event_dates__arguments', |
|
465 | - [ $EVT_ID, $date_format, $time_format, $echo, $show_expired, $format, $add_breaks, $limit ] |
|
466 | - ); |
|
467 | - [$EVT_ID, $date_format, $time_format, $echo, $show_expired, $format, $add_breaks, $limit] = $arguments; |
|
468 | - $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit ); |
|
463 | + $arguments = apply_filters( |
|
464 | + 'FHEE__espresso_list_of_event_dates__arguments', |
|
465 | + [ $EVT_ID, $date_format, $time_format, $echo, $show_expired, $format, $add_breaks, $limit ] |
|
466 | + ); |
|
467 | + [$EVT_ID, $date_format, $time_format, $echo, $show_expired, $format, $add_breaks, $limit] = $arguments; |
|
468 | + $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit ); |
|
469 | 469 | $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
470 | 470 | $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
471 | 471 | $date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format ); |
@@ -481,51 +481,51 @@ discard block |
||
481 | 481 | $html = '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="'. $ul_class.'">'; |
482 | 482 | foreach ( $datetimes as $datetime ) { |
483 | 483 | if ( $datetime instanceof EE_Datetime ) { |
484 | - $datetime_name = $datetime->name(); |
|
485 | - $datetime_description = $datetime->description(); |
|
486 | - $html .= '<li id="ee-event-datetimes-li-' . $datetime->ID(); |
|
487 | - $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-' . $datetime->get_active_status() . '">'; |
|
488 | - $inner_html = ''; |
|
489 | - if (! empty( $datetime_name )) { |
|
490 | - $inner_html .= '<strong>' . $datetime_name . '</strong>'; |
|
491 | - $inner_html .= $add_breaks ? '<br />' : ''; |
|
492 | - } |
|
493 | - // add date |
|
494 | - $inner_html .= '<span class="ee-event-datetimes-li-daterange">'; |
|
495 | - $inner_html .= '<span class="dashicons dashicons-calendar"></span> '; |
|
496 | - $inner_html .= $datetime->date_range( $date_format ) . '</span><br/>'; |
|
497 | - // add time |
|
498 | - $inner_html .= '<span class="ee-event-datetimes-li-timerange">'; |
|
499 | - $inner_html .= '<span class="dashicons dashicons-clock"></span> '; |
|
500 | - $inner_html .= $datetime->time_range( $time_format ) . '</span>'; |
|
501 | - |
|
502 | - $venue = $datetime->venue(); |
|
503 | - if ($venue instanceof EE_Venue) { |
|
504 | - $inner_html .= '<br /><span class="ee-event-datetimes-li-venue">'; |
|
505 | - $inner_html .= '<span class="dashicons dashicons-admin-home"></span> '; |
|
506 | - $inner_html .= '<a href="'. $venue->get_permalink() .'" '; |
|
507 | - $inner_html .= 'alt="'. $venue->name() .'" target="_blank">'; |
|
508 | - $inner_html .= $venue->name() . '</a></span>'; |
|
509 | - } |
|
510 | - if (! empty( $datetime_description )) { |
|
511 | - $inner_html .= $add_breaks ? '<br />' : ''; |
|
512 | - $inner_html .= $datetime_description; |
|
513 | - } |
|
514 | - $inner_html = apply_filters( |
|
515 | - 'FHEE__espresso_list_of_event_dates__datetime_html', |
|
516 | - $inner_html, |
|
517 | - $datetime, |
|
518 | - $arguments |
|
519 | - ); |
|
520 | - $html .= $inner_html . '</li>'; |
|
484 | + $datetime_name = $datetime->name(); |
|
485 | + $datetime_description = $datetime->description(); |
|
486 | + $html .= '<li id="ee-event-datetimes-li-' . $datetime->ID(); |
|
487 | + $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-' . $datetime->get_active_status() . '">'; |
|
488 | + $inner_html = ''; |
|
489 | + if (! empty( $datetime_name )) { |
|
490 | + $inner_html .= '<strong>' . $datetime_name . '</strong>'; |
|
491 | + $inner_html .= $add_breaks ? '<br />' : ''; |
|
492 | + } |
|
493 | + // add date |
|
494 | + $inner_html .= '<span class="ee-event-datetimes-li-daterange">'; |
|
495 | + $inner_html .= '<span class="dashicons dashicons-calendar"></span> '; |
|
496 | + $inner_html .= $datetime->date_range( $date_format ) . '</span><br/>'; |
|
497 | + // add time |
|
498 | + $inner_html .= '<span class="ee-event-datetimes-li-timerange">'; |
|
499 | + $inner_html .= '<span class="dashicons dashicons-clock"></span> '; |
|
500 | + $inner_html .= $datetime->time_range( $time_format ) . '</span>'; |
|
501 | + |
|
502 | + $venue = $datetime->venue(); |
|
503 | + if ($venue instanceof EE_Venue) { |
|
504 | + $inner_html .= '<br /><span class="ee-event-datetimes-li-venue">'; |
|
505 | + $inner_html .= '<span class="dashicons dashicons-admin-home"></span> '; |
|
506 | + $inner_html .= '<a href="'. $venue->get_permalink() .'" '; |
|
507 | + $inner_html .= 'alt="'. $venue->name() .'" target="_blank">'; |
|
508 | + $inner_html .= $venue->name() . '</a></span>'; |
|
509 | + } |
|
510 | + if (! empty( $datetime_description )) { |
|
511 | + $inner_html .= $add_breaks ? '<br />' : ''; |
|
512 | + $inner_html .= $datetime_description; |
|
513 | + } |
|
514 | + $inner_html = apply_filters( |
|
515 | + 'FHEE__espresso_list_of_event_dates__datetime_html', |
|
516 | + $inner_html, |
|
517 | + $datetime, |
|
518 | + $arguments |
|
519 | + ); |
|
520 | + $html .= $inner_html . '</li>'; |
|
521 | 521 | } |
522 | 522 | } |
523 | 523 | $html .= '</ul>'; |
524 | - $html = apply_filters('FHEE__espresso_list_of_event_dates__html', $html, $arguments, $datetime); |
|
524 | + $html = apply_filters('FHEE__espresso_list_of_event_dates__html', $html, $arguments, $datetime); |
|
525 | 525 | } else { |
526 | - $html = '<p><span class="dashicons dashicons-marker pink-text"></span>'; |
|
527 | - $html .= esc_html__( 'There are no upcoming dates for this event.', 'event_espresso' ); |
|
528 | - $html .= '</p><br/>'; |
|
526 | + $html = '<p><span class="dashicons dashicons-marker pink-text"></span>'; |
|
527 | + $html .= esc_html__( 'There are no upcoming dates for this event.', 'event_espresso' ); |
|
528 | + $html .= '</p><br/>'; |
|
529 | 529 | } |
530 | 530 | if ( $echo ) { |
531 | 531 | echo $html; |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | * @param int | \EE_Event $event |
15 | 15 | * @return bool |
16 | 16 | */ |
17 | -function is_espresso_event( $event = NULL ) { |
|
18 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
17 | +function is_espresso_event($event = NULL) { |
|
18 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
19 | 19 | // extract EE_Event object from passed param regardless of what it is (within reason of course) |
20 | - $event = EEH_Event_View::get_event( $event ); |
|
20 | + $event = EEH_Event_View::get_event($event); |
|
21 | 21 | // do we have a valid event ? |
22 | - return $event instanceof EE_Event ? TRUE : FALSE; |
|
22 | + return $event instanceof EE_Event ? TRUE : FALSE; |
|
23 | 23 | } |
24 | 24 | return FALSE; |
25 | 25 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @return bool |
32 | 32 | */ |
33 | 33 | function is_espresso_event_single() { |
34 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
34 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
35 | 35 | global $wp_query; |
36 | 36 | // return conditionals set by CPTs |
37 | 37 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_single : FALSE; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @return bool |
47 | 47 | */ |
48 | 48 | function is_espresso_event_archive() { |
49 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
49 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
50 | 50 | global $wp_query; |
51 | 51 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_archive : FALSE; |
52 | 52 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @return bool |
61 | 61 | */ |
62 | 62 | function is_espresso_event_taxonomy() { |
63 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
63 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
64 | 64 | global $wp_query; |
65 | 65 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_taxonomy : FALSE; |
66 | 66 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | * @param int | \EE_Venue $venue |
75 | 75 | * @return bool |
76 | 76 | */ |
77 | -function is_espresso_venue( $venue = NULL ) { |
|
78 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
77 | +function is_espresso_venue($venue = NULL) { |
|
78 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
79 | 79 | // extract EE_Venue object from passed param regardless of what it is (within reason of course) |
80 | - $venue = EEH_Venue_View::get_venue( $venue, FALSE ); |
|
80 | + $venue = EEH_Venue_View::get_venue($venue, FALSE); |
|
81 | 81 | // do we have a valid event ? |
82 | 82 | return $venue instanceof EE_Venue ? TRUE : FALSE; |
83 | 83 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return bool |
92 | 92 | */ |
93 | 93 | function is_espresso_venue_single() { |
94 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
94 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
95 | 95 | global $wp_query; |
96 | 96 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_single : FALSE; |
97 | 97 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @return bool |
106 | 106 | */ |
107 | 107 | function is_espresso_venue_archive() { |
108 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
108 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
109 | 109 | global $wp_query; |
110 | 110 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_archive : FALSE; |
111 | 111 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @return bool |
120 | 120 | */ |
121 | 121 | function is_espresso_venue_taxonomy() { |
122 | - if ( can_use_espresso_conditionals( __FUNCTION__ )) { |
|
122 | + if (can_use_espresso_conditionals(__FUNCTION__)) { |
|
123 | 123 | global $wp_query; |
124 | 124 | return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_taxonomy : FALSE; |
125 | 125 | } |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | * @param $conditional_tag |
134 | 134 | * @return bool |
135 | 135 | */ |
136 | -function can_use_espresso_conditionals( $conditional_tag ) { |
|
137 | - if ( ! did_action( 'AHEE__EE_System__initialize' )) { |
|
136 | +function can_use_espresso_conditionals($conditional_tag) { |
|
137 | + if ( ! did_action('AHEE__EE_System__initialize')) { |
|
138 | 138 | EE_Error::doing_it_wrong( |
139 | 139 | __FUNCTION__, |
140 | 140 | sprintf( |
141 | - esc_html__( 'The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.','event_espresso'), |
|
141 | + esc_html__('The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.', 'event_espresso'), |
|
142 | 142 | $conditional_tag |
143 | 143 | ), |
144 | 144 | '4.4.0' |
@@ -153,13 +153,13 @@ discard block |
||
153 | 153 | |
154 | 154 | /*************************** Event Queries ***************************/ |
155 | 155 | |
156 | -if ( ! function_exists( 'espresso_get_events' )) { |
|
156 | +if ( ! function_exists('espresso_get_events')) { |
|
157 | 157 | /** |
158 | 158 | * espresso_get_events |
159 | 159 | * @param array $params |
160 | 160 | * @return array |
161 | 161 | */ |
162 | - function espresso_get_events( $params = array() ) { |
|
162 | + function espresso_get_events($params = array()) { |
|
163 | 163 | //set default params |
164 | 164 | $default_espresso_events_params = array( |
165 | 165 | 'limit' => 10, |
@@ -170,18 +170,18 @@ discard block |
||
170 | 170 | 'sort' => 'ASC' |
171 | 171 | ); |
172 | 172 | // allow the defaults to be filtered |
173 | - $default_espresso_events_params = apply_filters( 'espresso_get_events__default_espresso_events_params', $default_espresso_events_params ); |
|
173 | + $default_espresso_events_params = apply_filters('espresso_get_events__default_espresso_events_params', $default_espresso_events_params); |
|
174 | 174 | // grab params and merge with defaults, then extract |
175 | - $params = array_merge( $default_espresso_events_params, $params ); |
|
175 | + $params = array_merge($default_espresso_events_params, $params); |
|
176 | 176 | // run the query |
177 | - $events_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery( $params ); |
|
177 | + $events_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery($params); |
|
178 | 178 | // assign results to a variable so we can return it |
179 | 179 | $events = $events_query->have_posts() ? $events_query->posts : array(); |
180 | 180 | // but first reset the query and postdata |
181 | 181 | wp_reset_query(); |
182 | 182 | wp_reset_postdata(); |
183 | 183 | EED_Events_Archive::remove_all_events_archive_filters(); |
184 | - unset( $events_query ); |
|
184 | + unset($events_query); |
|
185 | 185 | return $events; |
186 | 186 | } |
187 | 187 | } |
@@ -195,33 +195,33 @@ discard block |
||
195 | 195 | * espresso_load_ticket_selector |
196 | 196 | */ |
197 | 197 | function espresso_load_ticket_selector() { |
198 | - EE_Registry::instance()->load_file( EE_MODULES . 'ticket_selector', 'EED_Ticket_Selector', 'module' ); |
|
198 | + EE_Registry::instance()->load_file(EE_MODULES.'ticket_selector', 'EED_Ticket_Selector', 'module'); |
|
199 | 199 | } |
200 | 200 | |
201 | -if ( ! function_exists( 'espresso_ticket_selector' )) { |
|
201 | +if ( ! function_exists('espresso_ticket_selector')) { |
|
202 | 202 | /** |
203 | 203 | * espresso_ticket_selector |
204 | 204 | * @param null $event |
205 | 205 | */ |
206 | - function espresso_ticket_selector( $event = NULL ) { |
|
207 | - if ( ! apply_filters( 'FHEE_disable_espresso_ticket_selector', FALSE ) ) { |
|
206 | + function espresso_ticket_selector($event = NULL) { |
|
207 | + if ( ! apply_filters('FHEE_disable_espresso_ticket_selector', FALSE)) { |
|
208 | 208 | espresso_load_ticket_selector(); |
209 | 209 | \EED_Ticket_Selector::set_definitions(); |
210 | - echo EED_Ticket_Selector::display_ticket_selector( $event ); |
|
210 | + echo EED_Ticket_Selector::display_ticket_selector($event); |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | 215 | |
216 | - if ( ! function_exists( 'espresso_view_details_btn' )) { |
|
216 | + if ( ! function_exists('espresso_view_details_btn')) { |
|
217 | 217 | /** |
218 | 218 | * espresso_view_details_btn |
219 | 219 | * @param null $event |
220 | 220 | */ |
221 | - function espresso_view_details_btn( $event = NULL ) { |
|
222 | - if ( ! apply_filters( 'FHEE_disable_espresso_view_details_btn', FALSE ) ) { |
|
221 | + function espresso_view_details_btn($event = NULL) { |
|
222 | + if ( ! apply_filters('FHEE_disable_espresso_view_details_btn', FALSE)) { |
|
223 | 223 | espresso_load_ticket_selector(); |
224 | - echo EED_Ticket_Selector::display_ticket_selector( $event, TRUE ); |
|
224 | + echo EED_Ticket_Selector::display_ticket_selector($event, TRUE); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | /*************************** EEH_Event_View ***************************/ |
233 | 233 | |
234 | -if ( ! function_exists( 'espresso_load_event_list_assets' )) { |
|
234 | +if ( ! function_exists('espresso_load_event_list_assets')) { |
|
235 | 235 | /** |
236 | 236 | * espresso_load_event_list_assets |
237 | 237 | * ensures that event list styles and scripts are loaded |
@@ -240,13 +240,13 @@ discard block |
||
240 | 240 | */ |
241 | 241 | function espresso_load_event_list_assets() { |
242 | 242 | $event_list = EED_Events_Archive::instance(); |
243 | - add_action( 'AHEE__EE_System__initialize_last', array( $event_list, 'load_event_list_assets' ), 10 ); |
|
244 | - add_filter( 'FHEE_enable_default_espresso_css', '__return_true' ); |
|
243 | + add_action('AHEE__EE_System__initialize_last', array($event_list, 'load_event_list_assets'), 10); |
|
244 | + add_filter('FHEE_enable_default_espresso_css', '__return_true'); |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
248 | 248 | |
249 | -if ( ! function_exists( 'espresso_event_reg_button' )) { |
|
249 | +if ( ! function_exists('espresso_event_reg_button')) { |
|
250 | 250 | /** |
251 | 251 | * espresso_event_reg_button |
252 | 252 | * returns the "Register Now" button if event is active, |
@@ -258,13 +258,13 @@ discard block |
||
258 | 258 | * @param bool $EVT_ID |
259 | 259 | * @return string |
260 | 260 | */ |
261 | - function espresso_event_reg_button( $btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE ) { |
|
262 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
263 | - if ( ! $event instanceof EE_Event ) { |
|
261 | + function espresso_event_reg_button($btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE) { |
|
262 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
263 | + if ( ! $event instanceof EE_Event) { |
|
264 | 264 | return; |
265 | 265 | } |
266 | 266 | $event_status = $event->get_active_status(); |
267 | - switch ( $event_status ) { |
|
267 | + switch ($event_status) { |
|
268 | 268 | case EE_Datetime::sold_out : |
269 | 269 | $btn_text = esc_html__('Sold Out', 'event_espresso'); |
270 | 270 | $class = 'ee-pink'; |
@@ -284,15 +284,15 @@ discard block |
||
284 | 284 | case EE_Datetime::upcoming : |
285 | 285 | case EE_Datetime::active : |
286 | 286 | default : |
287 | - $btn_text =! empty( $btn_text_if_active ) ? $btn_text_if_active : esc_html__( 'Register Now', 'event_espresso' ); |
|
287 | + $btn_text = ! empty($btn_text_if_active) ? $btn_text_if_active : esc_html__('Register Now', 'event_espresso'); |
|
288 | 288 | $class = 'ee-green'; |
289 | 289 | } |
290 | - if ( $event_status < 1 && ! empty( $btn_text_if_inactive )) { |
|
290 | + if ($event_status < 1 && ! empty($btn_text_if_inactive)) { |
|
291 | 291 | $btn_text = $btn_text_if_inactive; |
292 | 292 | $class = 'ee-grey'; |
293 | 293 | } |
294 | 294 | ?> |
295 | - <a class="ee-button ee-register-button <?php echo $class; ?>" href="<?php espresso_event_link_url( $EVT_ID ); ?>"<?php echo \EED_Events_Archive::link_target(); ?>> |
|
295 | + <a class="ee-button ee-register-button <?php echo $class; ?>" href="<?php espresso_event_link_url($EVT_ID); ?>"<?php echo \EED_Events_Archive::link_target(); ?>> |
|
296 | 296 | <?php echo $btn_text; ?> |
297 | 297 | </a> |
298 | 298 | <?php |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | |
303 | 303 | |
304 | -if ( ! function_exists( 'espresso_display_ticket_selector' )) { |
|
304 | +if ( ! function_exists('espresso_display_ticket_selector')) { |
|
305 | 305 | /** |
306 | 306 | * espresso_display_ticket_selector |
307 | 307 | * whether or not to display the Ticket Selector for an event |
@@ -309,14 +309,14 @@ discard block |
||
309 | 309 | * @param bool $EVT_ID |
310 | 310 | * @return boolean |
311 | 311 | */ |
312 | - function espresso_display_ticket_selector( $EVT_ID = FALSE ) { |
|
313 | - return EEH_Event_View::display_ticket_selector( $EVT_ID ); |
|
312 | + function espresso_display_ticket_selector($EVT_ID = FALSE) { |
|
313 | + return EEH_Event_View::display_ticket_selector($EVT_ID); |
|
314 | 314 | } |
315 | 315 | } |
316 | 316 | |
317 | 317 | |
318 | 318 | |
319 | -if ( ! function_exists( 'espresso_event_status_banner' )) { |
|
319 | +if ( ! function_exists('espresso_event_status_banner')) { |
|
320 | 320 | /** |
321 | 321 | * espresso_event_status |
322 | 322 | * returns a banner showing the event status if it is sold out, expired, or inactive |
@@ -324,13 +324,13 @@ discard block |
||
324 | 324 | * @param bool $EVT_ID |
325 | 325 | * @return string |
326 | 326 | */ |
327 | - function espresso_event_status_banner( $EVT_ID = FALSE ) { |
|
328 | - return EEH_Event_View::event_status( $EVT_ID ); |
|
327 | + function espresso_event_status_banner($EVT_ID = FALSE) { |
|
328 | + return EEH_Event_View::event_status($EVT_ID); |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | |
332 | 332 | |
333 | -if ( ! function_exists( 'espresso_event_status' )) { |
|
333 | +if ( ! function_exists('espresso_event_status')) { |
|
334 | 334 | /** |
335 | 335 | * espresso_event_status |
336 | 336 | * returns the event status if it is sold out, expired, or inactive |
@@ -339,13 +339,13 @@ discard block |
||
339 | 339 | * @param bool $echo |
340 | 340 | * @return string |
341 | 341 | */ |
342 | - function espresso_event_status( $EVT_ID = 0, $echo = TRUE ) { |
|
343 | - return EEH_Event_View::event_active_status( $EVT_ID, $echo ); |
|
342 | + function espresso_event_status($EVT_ID = 0, $echo = TRUE) { |
|
343 | + return EEH_Event_View::event_active_status($EVT_ID, $echo); |
|
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
347 | 347 | |
348 | -if ( ! function_exists( 'espresso_event_categories' )) { |
|
348 | +if ( ! function_exists('espresso_event_categories')) { |
|
349 | 349 | /** |
350 | 350 | * espresso_event_categories |
351 | 351 | * returns the terms associated with an event |
@@ -355,17 +355,17 @@ discard block |
||
355 | 355 | * @param bool $echo |
356 | 356 | * @return string |
357 | 357 | */ |
358 | - function espresso_event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) { |
|
359 | - if ( $echo ) { |
|
360 | - echo EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized ); |
|
358 | + function espresso_event_categories($EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) { |
|
359 | + if ($echo) { |
|
360 | + echo EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); |
|
361 | 361 | return ''; |
362 | 362 | } |
363 | - return EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized ); |
|
363 | + return EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); |
|
364 | 364 | } |
365 | 365 | } |
366 | 366 | |
367 | 367 | |
368 | -if ( ! function_exists( 'espresso_event_tickets_available' )) { |
|
368 | +if ( ! function_exists('espresso_event_tickets_available')) { |
|
369 | 369 | /** |
370 | 370 | * espresso_event_tickets_available |
371 | 371 | * returns the ticket types available for purchase for an event |
@@ -375,26 +375,26 @@ discard block |
||
375 | 375 | * @param bool $format |
376 | 376 | * @return string |
377 | 377 | */ |
378 | - function espresso_event_tickets_available( $EVT_ID = 0, $echo = TRUE, $format = TRUE ) { |
|
379 | - $tickets = EEH_Event_View::event_tickets_available( $EVT_ID ); |
|
380 | - if ( is_array( $tickets ) && ! empty( $tickets )) { |
|
378 | + function espresso_event_tickets_available($EVT_ID = 0, $echo = TRUE, $format = TRUE) { |
|
379 | + $tickets = EEH_Event_View::event_tickets_available($EVT_ID); |
|
380 | + if (is_array($tickets) && ! empty($tickets)) { |
|
381 | 381 | // if formatting then $html will be a string, else it will be an array of ticket objects |
382 | - $html = $format ? '<ul id="ee-event-tickets-ul-' . $EVT_ID . '" class="ee-event-tickets-ul">' : array(); |
|
383 | - foreach ( $tickets as $ticket ) { |
|
384 | - if ( $ticket instanceof EE_Ticket ) { |
|
385 | - if ( $format ) { |
|
386 | - $html .= '<li id="ee-event-tickets-li-' . $ticket->ID() . '" class="ee-event-tickets-li">'; |
|
387 | - $html .= $ticket->name() . ' ' . EEH_Template::format_currency( $ticket->get_ticket_total_with_taxes() ); |
|
382 | + $html = $format ? '<ul id="ee-event-tickets-ul-'.$EVT_ID.'" class="ee-event-tickets-ul">' : array(); |
|
383 | + foreach ($tickets as $ticket) { |
|
384 | + if ($ticket instanceof EE_Ticket) { |
|
385 | + if ($format) { |
|
386 | + $html .= '<li id="ee-event-tickets-li-'.$ticket->ID().'" class="ee-event-tickets-li">'; |
|
387 | + $html .= $ticket->name().' '.EEH_Template::format_currency($ticket->get_ticket_total_with_taxes()); |
|
388 | 388 | $html .= '</li>'; |
389 | 389 | } else { |
390 | 390 | $html[] = $ticket; |
391 | 391 | } |
392 | 392 | } |
393 | 393 | } |
394 | - if ( $format ) { |
|
394 | + if ($format) { |
|
395 | 395 | $html .= '</ul>'; |
396 | 396 | } |
397 | - if ( $echo && $format ) { |
|
397 | + if ($echo && $format) { |
|
398 | 398 | echo $html; |
399 | 399 | return ''; |
400 | 400 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | } |
405 | 405 | } |
406 | 406 | |
407 | -if ( ! function_exists( 'espresso_event_date_obj' )) { |
|
407 | +if ( ! function_exists('espresso_event_date_obj')) { |
|
408 | 408 | /** |
409 | 409 | * espresso_event_date_obj |
410 | 410 | * returns the primary date object for an event |
@@ -412,13 +412,13 @@ discard block |
||
412 | 412 | * @param bool $EVT_ID |
413 | 413 | * @return object |
414 | 414 | */ |
415 | - function espresso_event_date_obj( $EVT_ID = FALSE ) { |
|
416 | - return EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
415 | + function espresso_event_date_obj($EVT_ID = FALSE) { |
|
416 | + return EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
417 | 417 | } |
418 | 418 | } |
419 | 419 | |
420 | 420 | |
421 | -if ( ! function_exists( 'espresso_event_date' )) { |
|
421 | +if ( ! function_exists('espresso_event_date')) { |
|
422 | 422 | /** |
423 | 423 | * espresso_event_date |
424 | 424 | * returns the primary date for an event |
@@ -429,22 +429,22 @@ discard block |
||
429 | 429 | * @param bool $echo |
430 | 430 | * @return string |
431 | 431 | */ |
432 | - function espresso_event_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
433 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
434 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
435 | - $date_format = apply_filters( 'FHEE__espresso_event_date__date_format', $date_format ); |
|
436 | - $time_format = apply_filters( 'FHEE__espresso_event_date__time_format', $time_format ); |
|
437 | - if($echo){ |
|
438 | - echo EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID ); |
|
432 | + function espresso_event_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
433 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
434 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
435 | + $date_format = apply_filters('FHEE__espresso_event_date__date_format', $date_format); |
|
436 | + $time_format = apply_filters('FHEE__espresso_event_date__time_format', $time_format); |
|
437 | + if ($echo) { |
|
438 | + echo EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); |
|
439 | 439 | return ''; |
440 | 440 | } |
441 | - return EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID ); |
|
441 | + return EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); |
|
442 | 442 | |
443 | 443 | } |
444 | 444 | } |
445 | 445 | |
446 | 446 | |
447 | -if ( ! function_exists( 'espresso_list_of_event_dates' )) { |
|
447 | +if ( ! function_exists('espresso_list_of_event_dates')) { |
|
448 | 448 | /** |
449 | 449 | * espresso_list_of_event_dates |
450 | 450 | * returns a unordered list of dates for an event |
@@ -459,55 +459,55 @@ discard block |
||
459 | 459 | * @param null $limit |
460 | 460 | * @return string |
461 | 461 | */ |
462 | - function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) { |
|
462 | + function espresso_list_of_event_dates($EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL) { |
|
463 | 463 | $arguments = apply_filters( |
464 | 464 | 'FHEE__espresso_list_of_event_dates__arguments', |
465 | - [ $EVT_ID, $date_format, $time_format, $echo, $show_expired, $format, $add_breaks, $limit ] |
|
465 | + [$EVT_ID, $date_format, $time_format, $echo, $show_expired, $format, $add_breaks, $limit] |
|
466 | 466 | ); |
467 | 467 | [$EVT_ID, $date_format, $time_format, $echo, $show_expired, $format, $add_breaks, $limit] = $arguments; |
468 | - $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit ); |
|
469 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
470 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
471 | - $date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format ); |
|
472 | - $time_format = apply_filters( 'FHEE__espresso_list_of_event_dates__time_format', $time_format ); |
|
473 | - if ( ! $format ) { |
|
474 | - return apply_filters( 'FHEE__espresso_list_of_event_dates__datetimes', $datetimes ); |
|
468 | + $datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, $show_expired, FALSE, $limit); |
|
469 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
470 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
471 | + $date_format = apply_filters('FHEE__espresso_list_of_event_dates__date_format', $date_format); |
|
472 | + $time_format = apply_filters('FHEE__espresso_list_of_event_dates__time_format', $time_format); |
|
473 | + if ( ! $format) { |
|
474 | + return apply_filters('FHEE__espresso_list_of_event_dates__datetimes', $datetimes); |
|
475 | 475 | } |
476 | - if ( is_array( $datetimes ) && ! empty( $datetimes )) { |
|
476 | + if (is_array($datetimes) && ! empty($datetimes)) { |
|
477 | 477 | global $post; |
478 | 478 | $cols = count($datetimes); |
479 | 479 | $cols = $cols >= 3 ? 'big' : 'small'; |
480 | 480 | $ul_class = "ee-event-datetimes-ul ee-event-datetimes-ul--{$cols}"; |
481 | - $html = '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="'. $ul_class.'">'; |
|
482 | - foreach ( $datetimes as $datetime ) { |
|
483 | - if ( $datetime instanceof EE_Datetime ) { |
|
481 | + $html = '<ul id="ee-event-datetimes-ul-'.$post->ID.'" class="'.$ul_class.'">'; |
|
482 | + foreach ($datetimes as $datetime) { |
|
483 | + if ($datetime instanceof EE_Datetime) { |
|
484 | 484 | $datetime_name = $datetime->name(); |
485 | 485 | $datetime_description = $datetime->description(); |
486 | - $html .= '<li id="ee-event-datetimes-li-' . $datetime->ID(); |
|
487 | - $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-' . $datetime->get_active_status() . '">'; |
|
486 | + $html .= '<li id="ee-event-datetimes-li-'.$datetime->ID(); |
|
487 | + $html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-'.$datetime->get_active_status().'">'; |
|
488 | 488 | $inner_html = ''; |
489 | - if (! empty( $datetime_name )) { |
|
490 | - $inner_html .= '<strong>' . $datetime_name . '</strong>'; |
|
489 | + if ( ! empty($datetime_name)) { |
|
490 | + $inner_html .= '<strong>'.$datetime_name.'</strong>'; |
|
491 | 491 | $inner_html .= $add_breaks ? '<br />' : ''; |
492 | 492 | } |
493 | 493 | // add date |
494 | 494 | $inner_html .= '<span class="ee-event-datetimes-li-daterange">'; |
495 | 495 | $inner_html .= '<span class="dashicons dashicons-calendar"></span> '; |
496 | - $inner_html .= $datetime->date_range( $date_format ) . '</span><br/>'; |
|
496 | + $inner_html .= $datetime->date_range($date_format).'</span><br/>'; |
|
497 | 497 | // add time |
498 | 498 | $inner_html .= '<span class="ee-event-datetimes-li-timerange">'; |
499 | 499 | $inner_html .= '<span class="dashicons dashicons-clock"></span> '; |
500 | - $inner_html .= $datetime->time_range( $time_format ) . '</span>'; |
|
500 | + $inner_html .= $datetime->time_range($time_format).'</span>'; |
|
501 | 501 | |
502 | 502 | $venue = $datetime->venue(); |
503 | 503 | if ($venue instanceof EE_Venue) { |
504 | 504 | $inner_html .= '<br /><span class="ee-event-datetimes-li-venue">'; |
505 | 505 | $inner_html .= '<span class="dashicons dashicons-admin-home"></span> '; |
506 | - $inner_html .= '<a href="'. $venue->get_permalink() .'" '; |
|
507 | - $inner_html .= 'alt="'. $venue->name() .'" target="_blank">'; |
|
508 | - $inner_html .= $venue->name() . '</a></span>'; |
|
506 | + $inner_html .= '<a href="'.$venue->get_permalink().'" '; |
|
507 | + $inner_html .= 'alt="'.$venue->name().'" target="_blank">'; |
|
508 | + $inner_html .= $venue->name().'</a></span>'; |
|
509 | 509 | } |
510 | - if (! empty( $datetime_description )) { |
|
510 | + if ( ! empty($datetime_description)) { |
|
511 | 511 | $inner_html .= $add_breaks ? '<br />' : ''; |
512 | 512 | $inner_html .= $datetime_description; |
513 | 513 | } |
@@ -517,17 +517,17 @@ discard block |
||
517 | 517 | $datetime, |
518 | 518 | $arguments |
519 | 519 | ); |
520 | - $html .= $inner_html . '</li>'; |
|
520 | + $html .= $inner_html.'</li>'; |
|
521 | 521 | } |
522 | 522 | } |
523 | 523 | $html .= '</ul>'; |
524 | 524 | $html = apply_filters('FHEE__espresso_list_of_event_dates__html', $html, $arguments, $datetime); |
525 | 525 | } else { |
526 | 526 | $html = '<p><span class="dashicons dashicons-marker pink-text"></span>'; |
527 | - $html .= esc_html__( 'There are no upcoming dates for this event.', 'event_espresso' ); |
|
527 | + $html .= esc_html__('There are no upcoming dates for this event.', 'event_espresso'); |
|
528 | 528 | $html .= '</p><br/>'; |
529 | 529 | } |
530 | - if ( $echo ) { |
|
530 | + if ($echo) { |
|
531 | 531 | echo $html; |
532 | 532 | return ''; |
533 | 533 | } |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | |
539 | -if ( ! function_exists( 'espresso_event_end_date' )) { |
|
539 | +if ( ! function_exists('espresso_event_end_date')) { |
|
540 | 540 | /** |
541 | 541 | * espresso_event_end_date |
542 | 542 | * returns the last date for an event |
@@ -547,20 +547,20 @@ discard block |
||
547 | 547 | * @param bool $echo |
548 | 548 | * @return string |
549 | 549 | */ |
550 | - function espresso_event_end_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
551 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
552 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
553 | - $date_format = apply_filters( 'FHEE__espresso_event_end_date__date_format', $date_format ); |
|
554 | - $time_format = apply_filters( 'FHEE__espresso_event_end_date__time_format', $time_format ); |
|
555 | - if($echo){ |
|
556 | - echo EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID ); |
|
550 | + function espresso_event_end_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
551 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
552 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
553 | + $date_format = apply_filters('FHEE__espresso_event_end_date__date_format', $date_format); |
|
554 | + $time_format = apply_filters('FHEE__espresso_event_end_date__time_format', $time_format); |
|
555 | + if ($echo) { |
|
556 | + echo EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); |
|
557 | 557 | return ''; |
558 | 558 | } |
559 | - return EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID ); |
|
559 | + return EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); |
|
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
563 | -if ( ! function_exists( 'espresso_event_date_range' )) { |
|
563 | +if ( ! function_exists('espresso_event_date_range')) { |
|
564 | 564 | /** |
565 | 565 | * espresso_event_date_range |
566 | 566 | * returns the first and last chronologically ordered dates for an event (if different) |
@@ -573,32 +573,32 @@ discard block |
||
573 | 573 | * @param bool $echo |
574 | 574 | * @return string |
575 | 575 | */ |
576 | - function espresso_event_date_range( $date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE ) { |
|
576 | + function espresso_event_date_range($date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE) { |
|
577 | 577 | // set and filter date and time formats when a range is returned |
578 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
579 | - $date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', $date_format ); |
|
578 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
579 | + $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', $date_format); |
|
580 | 580 | // get the start and end date with NO time portion |
581 | - $the_event_date = EEH_Event_View::the_earliest_event_date( $date_format, '', $EVT_ID ); |
|
582 | - $the_event_end_date = EEH_Event_View::the_latest_event_date( $date_format, '', $EVT_ID ); |
|
581 | + $the_event_date = EEH_Event_View::the_earliest_event_date($date_format, '', $EVT_ID); |
|
582 | + $the_event_end_date = EEH_Event_View::the_latest_event_date($date_format, '', $EVT_ID); |
|
583 | 583 | // now we can determine if date range spans more than one day |
584 | - if ( $the_event_date != $the_event_end_date ) { |
|
585 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
586 | - $time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', $time_format ); |
|
584 | + if ($the_event_date != $the_event_end_date) { |
|
585 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
586 | + $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', $time_format); |
|
587 | 587 | $html = sprintf( |
588 | 588 | /* translators: 1: first event date, 2: last event date */ |
589 | - esc_html__( '%1$s - %2$s', 'event_espresso' ), |
|
590 | - EEH_Event_View::the_earliest_event_date( $date_format, $time_format, $EVT_ID ), |
|
591 | - EEH_Event_View::the_latest_event_date( $date_format, $time_format, $EVT_ID ) |
|
589 | + esc_html__('%1$s - %2$s', 'event_espresso'), |
|
590 | + EEH_Event_View::the_earliest_event_date($date_format, $time_format, $EVT_ID), |
|
591 | + EEH_Event_View::the_latest_event_date($date_format, $time_format, $EVT_ID) |
|
592 | 592 | ); |
593 | 593 | } else { |
594 | 594 | // set and filter date and time formats when only a single datetime is returned |
595 | - $single_date_format = ! empty( $single_date_format ) ? $single_date_format : get_option( 'date_format' ); |
|
596 | - $single_time_format = ! empty( $single_time_format ) ? $single_time_format : get_option( 'time_format' ); |
|
597 | - $single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', $single_date_format ); |
|
598 | - $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', $single_time_format ); |
|
599 | - $html = EEH_Event_View::the_earliest_event_date( $single_date_format, $single_time_format, $EVT_ID ); |
|
595 | + $single_date_format = ! empty($single_date_format) ? $single_date_format : get_option('date_format'); |
|
596 | + $single_time_format = ! empty($single_time_format) ? $single_time_format : get_option('time_format'); |
|
597 | + $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', $single_date_format); |
|
598 | + $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', $single_time_format); |
|
599 | + $html = EEH_Event_View::the_earliest_event_date($single_date_format, $single_time_format, $EVT_ID); |
|
600 | 600 | } |
601 | - if ( $echo ) { |
|
601 | + if ($echo) { |
|
602 | 602 | echo $html; |
603 | 603 | return ''; |
604 | 604 | } |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | } |
607 | 607 | } |
608 | 608 | |
609 | -if ( ! function_exists( 'espresso_next_upcoming_datetime_obj' )) { |
|
609 | +if ( ! function_exists('espresso_next_upcoming_datetime_obj')) { |
|
610 | 610 | /** |
611 | 611 | * espresso_next_upcoming_datetime_obj |
612 | 612 | * returns the next upcoming datetime object for an event |
@@ -614,12 +614,12 @@ discard block |
||
614 | 614 | * @param int $EVT_ID |
615 | 615 | * @return EE_Datetime|null |
616 | 616 | */ |
617 | - function espresso_next_upcoming_datetime_obj( $EVT_ID = 0 ) { |
|
618 | - return EEH_Event_View::get_next_upcoming_date_obj( $EVT_ID ); |
|
617 | + function espresso_next_upcoming_datetime_obj($EVT_ID = 0) { |
|
618 | + return EEH_Event_View::get_next_upcoming_date_obj($EVT_ID); |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 | |
622 | -if ( ! function_exists( 'espresso_next_upcoming_datetime' ) ) { |
|
622 | +if ( ! function_exists('espresso_next_upcoming_datetime')) { |
|
623 | 623 | /** |
624 | 624 | * espresso_next_upcoming_datetime |
625 | 625 | * returns the start date and time for the next upcoming event. |
@@ -630,30 +630,30 @@ discard block |
||
630 | 630 | * @param bool $echo |
631 | 631 | * @return string |
632 | 632 | */ |
633 | - function espresso_next_upcoming_datetime( $date_format = '', $time_format = '', $EVT_ID = 0, $echo = true ) { |
|
633 | + function espresso_next_upcoming_datetime($date_format = '', $time_format = '', $EVT_ID = 0, $echo = true) { |
|
634 | 634 | |
635 | - $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); |
|
636 | - $date_format = apply_filters( 'FHEE__espresso_next_upcoming_datetime__date_format', $date_format ); |
|
635 | + $date_format = ! empty($date_format) ? $date_format : get_option('date_format'); |
|
636 | + $date_format = apply_filters('FHEE__espresso_next_upcoming_datetime__date_format', $date_format); |
|
637 | 637 | |
638 | - $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); |
|
639 | - $time_format = apply_filters( 'FHEE__espresso_next_upcoming_datetime__time_format', $time_format ); |
|
638 | + $time_format = ! empty($time_format) ? $time_format : get_option('time_format'); |
|
639 | + $time_format = apply_filters('FHEE__espresso_next_upcoming_datetime__time_format', $time_format); |
|
640 | 640 | |
641 | - $datetime_format = trim( $date_format . ' ' . $time_format); |
|
641 | + $datetime_format = trim($date_format.' '.$time_format); |
|
642 | 642 | |
643 | - $datetime = espresso_next_upcoming_datetime_obj( $EVT_ID ); |
|
643 | + $datetime = espresso_next_upcoming_datetime_obj($EVT_ID); |
|
644 | 644 | |
645 | - if( ! $datetime instanceof EE_Datetime ) { |
|
645 | + if ( ! $datetime instanceof EE_Datetime) { |
|
646 | 646 | return ''; |
647 | 647 | } |
648 | - if ( $echo ){ |
|
649 | - echo $datetime->get_i18n_datetime( 'DTT_EVT_start', $datetime_format ); |
|
648 | + if ($echo) { |
|
649 | + echo $datetime->get_i18n_datetime('DTT_EVT_start', $datetime_format); |
|
650 | 650 | return ''; |
651 | 651 | } |
652 | - return $datetime->get_i18n_datetime( 'DTT_EVT_start', $datetime_format ); |
|
652 | + return $datetime->get_i18n_datetime('DTT_EVT_start', $datetime_format); |
|
653 | 653 | } |
654 | 654 | } |
655 | 655 | |
656 | -if ( ! function_exists( 'espresso_event_date_as_calendar_page' )) { |
|
656 | +if ( ! function_exists('espresso_event_date_as_calendar_page')) { |
|
657 | 657 | /** |
658 | 658 | * espresso_event_date_as_calendar_page |
659 | 659 | * returns the primary date for an event, stylized to appear as the page of a calendar |
@@ -661,15 +661,15 @@ discard block |
||
661 | 661 | * @param bool $EVT_ID |
662 | 662 | * @return string |
663 | 663 | */ |
664 | - function espresso_event_date_as_calendar_page( $EVT_ID = FALSE ) { |
|
665 | - EEH_Event_View::event_date_as_calendar_page( $EVT_ID ); |
|
664 | + function espresso_event_date_as_calendar_page($EVT_ID = FALSE) { |
|
665 | + EEH_Event_View::event_date_as_calendar_page($EVT_ID); |
|
666 | 666 | } |
667 | 667 | } |
668 | 668 | |
669 | 669 | |
670 | 670 | |
671 | 671 | |
672 | -if ( ! function_exists( 'espresso_event_link_url' )) { |
|
672 | +if ( ! function_exists('espresso_event_link_url')) { |
|
673 | 673 | /** |
674 | 674 | * espresso_event_link_url |
675 | 675 | * |
@@ -677,18 +677,18 @@ discard block |
||
677 | 677 | * @param bool $echo |
678 | 678 | * @return string |
679 | 679 | */ |
680 | - function espresso_event_link_url( $EVT_ID = 0, $echo = TRUE ) { |
|
681 | - if ( $echo ) { |
|
682 | - echo EEH_Event_View::event_link_url( $EVT_ID ); |
|
680 | + function espresso_event_link_url($EVT_ID = 0, $echo = TRUE) { |
|
681 | + if ($echo) { |
|
682 | + echo EEH_Event_View::event_link_url($EVT_ID); |
|
683 | 683 | return ''; |
684 | 684 | } |
685 | - return EEH_Event_View::event_link_url( $EVT_ID ); |
|
685 | + return EEH_Event_View::event_link_url($EVT_ID); |
|
686 | 686 | } |
687 | 687 | } |
688 | 688 | |
689 | 689 | |
690 | 690 | |
691 | -if ( ! function_exists( 'espresso_event_has_content_or_excerpt' )) { |
|
691 | +if ( ! function_exists('espresso_event_has_content_or_excerpt')) { |
|
692 | 692 | /** |
693 | 693 | * espresso_event_has_content_or_excerpt |
694 | 694 | * |
@@ -696,15 +696,15 @@ discard block |
||
696 | 696 | * @param bool $EVT_ID |
697 | 697 | * @return boolean |
698 | 698 | */ |
699 | - function espresso_event_has_content_or_excerpt( $EVT_ID = FALSE ) { |
|
700 | - return EEH_Event_View::event_has_content_or_excerpt( $EVT_ID ); |
|
699 | + function espresso_event_has_content_or_excerpt($EVT_ID = FALSE) { |
|
700 | + return EEH_Event_View::event_has_content_or_excerpt($EVT_ID); |
|
701 | 701 | } |
702 | 702 | } |
703 | 703 | |
704 | 704 | |
705 | 705 | |
706 | 706 | |
707 | -if ( ! function_exists( 'espresso_event_content_or_excerpt' )) { |
|
707 | +if ( ! function_exists('espresso_event_content_or_excerpt')) { |
|
708 | 708 | /** |
709 | 709 | * espresso_event_content_or_excerpt |
710 | 710 | * |
@@ -713,18 +713,18 @@ discard block |
||
713 | 713 | * @param bool $echo |
714 | 714 | * @return string |
715 | 715 | */ |
716 | - function espresso_event_content_or_excerpt( $num_words = 55, $more = NULL, $echo = TRUE ) { |
|
717 | - if ( $echo ) { |
|
718 | - echo EEH_Event_View::event_content_or_excerpt( $num_words, $more ); |
|
716 | + function espresso_event_content_or_excerpt($num_words = 55, $more = NULL, $echo = TRUE) { |
|
717 | + if ($echo) { |
|
718 | + echo EEH_Event_View::event_content_or_excerpt($num_words, $more); |
|
719 | 719 | return ''; |
720 | 720 | } |
721 | - return EEH_Event_View::event_content_or_excerpt( $num_words, $more ); |
|
721 | + return EEH_Event_View::event_content_or_excerpt($num_words, $more); |
|
722 | 722 | } |
723 | 723 | } |
724 | 724 | |
725 | 725 | |
726 | 726 | |
727 | -if ( ! function_exists( 'espresso_event_phone' )) { |
|
727 | +if ( ! function_exists('espresso_event_phone')) { |
|
728 | 728 | /** |
729 | 729 | * espresso_event_phone |
730 | 730 | * |
@@ -732,18 +732,18 @@ discard block |
||
732 | 732 | * @param bool $echo |
733 | 733 | * @return string |
734 | 734 | */ |
735 | - function espresso_event_phone( $EVT_ID = 0, $echo = TRUE ) { |
|
736 | - if ( $echo ) { |
|
737 | - echo EEH_Event_View::event_phone( $EVT_ID ); |
|
735 | + function espresso_event_phone($EVT_ID = 0, $echo = TRUE) { |
|
736 | + if ($echo) { |
|
737 | + echo EEH_Event_View::event_phone($EVT_ID); |
|
738 | 738 | return ''; |
739 | 739 | } |
740 | - return EEH_Event_View::event_phone( $EVT_ID ); |
|
740 | + return EEH_Event_View::event_phone($EVT_ID); |
|
741 | 741 | } |
742 | 742 | } |
743 | 743 | |
744 | 744 | |
745 | 745 | |
746 | -if ( ! function_exists( 'espresso_edit_event_link' )) { |
|
746 | +if ( ! function_exists('espresso_edit_event_link')) { |
|
747 | 747 | /** |
748 | 748 | * espresso_edit_event_link |
749 | 749 | * returns a link to edit an event |
@@ -752,39 +752,39 @@ discard block |
||
752 | 752 | * @param bool $echo |
753 | 753 | * @return string |
754 | 754 | */ |
755 | - function espresso_edit_event_link( $EVT_ID = 0, $echo = TRUE ) { |
|
756 | - if ( $echo ) { |
|
757 | - echo EEH_Event_View::edit_event_link( $EVT_ID ); |
|
755 | + function espresso_edit_event_link($EVT_ID = 0, $echo = TRUE) { |
|
756 | + if ($echo) { |
|
757 | + echo EEH_Event_View::edit_event_link($EVT_ID); |
|
758 | 758 | return ''; |
759 | 759 | } |
760 | - return EEH_Event_View::edit_event_link( $EVT_ID ); |
|
760 | + return EEH_Event_View::edit_event_link($EVT_ID); |
|
761 | 761 | } |
762 | 762 | } |
763 | 763 | |
764 | 764 | |
765 | -if ( ! function_exists( 'espresso_organization_name' )) { |
|
765 | +if ( ! function_exists('espresso_organization_name')) { |
|
766 | 766 | /** |
767 | 767 | * espresso_organization_name |
768 | 768 | * @param bool $echo |
769 | 769 | * @return string |
770 | 770 | */ |
771 | 771 | function espresso_organization_name($echo = TRUE) { |
772 | - if($echo){ |
|
773 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
772 | + if ($echo) { |
|
773 | + echo EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
774 | 774 | return ''; |
775 | 775 | } |
776 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
776 | + return EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
777 | 777 | } |
778 | 778 | } |
779 | 779 | |
780 | -if ( ! function_exists( 'espresso_organization_address' )) { |
|
780 | +if ( ! function_exists('espresso_organization_address')) { |
|
781 | 781 | /** |
782 | 782 | * espresso_organization_address |
783 | 783 | * @param string $type |
784 | 784 | * @return string |
785 | 785 | */ |
786 | - function espresso_organization_address( $type = 'inline' ) { |
|
787 | - if ( EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ) { |
|
786 | + function espresso_organization_address($type = 'inline') { |
|
787 | + if (EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config) { |
|
788 | 788 | $address = new EventEspresso\core\domain\entities\GenericAddress( |
789 | 789 | EE_Registry::instance()->CFG->organization->address_1, |
790 | 790 | EE_Registry::instance()->CFG->organization->address_2, |
@@ -793,129 +793,129 @@ discard block |
||
793 | 793 | EE_Registry::instance()->CFG->organization->zip, |
794 | 794 | EE_Registry::instance()->CFG->organization->CNT_ISO |
795 | 795 | ); |
796 | - return EEH_Address::format( $address, $type ); |
|
796 | + return EEH_Address::format($address, $type); |
|
797 | 797 | } |
798 | 798 | return ''; |
799 | 799 | } |
800 | 800 | } |
801 | 801 | |
802 | -if ( ! function_exists( 'espresso_organization_email' )) { |
|
802 | +if ( ! function_exists('espresso_organization_email')) { |
|
803 | 803 | /** |
804 | 804 | * espresso_organization_email |
805 | 805 | * @param bool $echo |
806 | 806 | * @return string |
807 | 807 | */ |
808 | - function espresso_organization_email( $echo = TRUE ) { |
|
809 | - if($echo){ |
|
810 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
808 | + function espresso_organization_email($echo = TRUE) { |
|
809 | + if ($echo) { |
|
810 | + echo EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
811 | 811 | return ''; |
812 | 812 | } |
813 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
813 | + return EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
814 | 814 | } |
815 | 815 | } |
816 | 816 | |
817 | -if ( ! function_exists( 'espresso_organization_logo_url' )) { |
|
817 | +if ( ! function_exists('espresso_organization_logo_url')) { |
|
818 | 818 | /** |
819 | 819 | * espresso_organization_logo_url |
820 | 820 | * @param bool $echo |
821 | 821 | * @return string |
822 | 822 | */ |
823 | - function espresso_organization_logo_url( $echo = TRUE ) { |
|
824 | - if($echo){ |
|
825 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
823 | + function espresso_organization_logo_url($echo = TRUE) { |
|
824 | + if ($echo) { |
|
825 | + echo EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
826 | 826 | return ''; |
827 | 827 | } |
828 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
828 | + return EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
829 | 829 | } |
830 | 830 | } |
831 | 831 | |
832 | -if ( ! function_exists( 'espresso_organization_facebook' )) { |
|
832 | +if ( ! function_exists('espresso_organization_facebook')) { |
|
833 | 833 | /** |
834 | 834 | * espresso_organization_facebook |
835 | 835 | * @param bool $echo |
836 | 836 | * @return string |
837 | 837 | */ |
838 | - function espresso_organization_facebook( $echo = TRUE ) { |
|
839 | - if($echo){ |
|
840 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
838 | + function espresso_organization_facebook($echo = TRUE) { |
|
839 | + if ($echo) { |
|
840 | + echo EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
841 | 841 | return ''; |
842 | 842 | } |
843 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
843 | + return EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
844 | 844 | } |
845 | 845 | } |
846 | 846 | |
847 | -if ( ! function_exists( 'espresso_organization_twitter' )) { |
|
847 | +if ( ! function_exists('espresso_organization_twitter')) { |
|
848 | 848 | /** |
849 | 849 | * espresso_organization_twitter |
850 | 850 | * @param bool $echo |
851 | 851 | * @return string |
852 | 852 | */ |
853 | - function espresso_organization_twitter( $echo = TRUE ) { |
|
854 | - if($echo){ |
|
855 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
853 | + function espresso_organization_twitter($echo = TRUE) { |
|
854 | + if ($echo) { |
|
855 | + echo EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
856 | 856 | return ''; |
857 | 857 | } |
858 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
858 | + return EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
859 | 859 | } |
860 | 860 | } |
861 | 861 | |
862 | -if ( ! function_exists( 'espresso_organization_linkedin' )) { |
|
862 | +if ( ! function_exists('espresso_organization_linkedin')) { |
|
863 | 863 | /** |
864 | 864 | * espresso_organization_linkedin |
865 | 865 | * @param bool $echo |
866 | 866 | * @return string |
867 | 867 | */ |
868 | - function espresso_organization_linkedin( $echo = TRUE ) { |
|
869 | - if($echo){ |
|
870 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
868 | + function espresso_organization_linkedin($echo = TRUE) { |
|
869 | + if ($echo) { |
|
870 | + echo EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
871 | 871 | return ''; |
872 | 872 | } |
873 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
873 | + return EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
874 | 874 | } |
875 | 875 | } |
876 | 876 | |
877 | -if ( ! function_exists( 'espresso_organization_pinterest' )) { |
|
877 | +if ( ! function_exists('espresso_organization_pinterest')) { |
|
878 | 878 | /** |
879 | 879 | * espresso_organization_pinterest |
880 | 880 | * @param bool $echo |
881 | 881 | * @return string |
882 | 882 | */ |
883 | - function espresso_organization_pinterest( $echo = TRUE ) { |
|
884 | - if($echo){ |
|
885 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
883 | + function espresso_organization_pinterest($echo = TRUE) { |
|
884 | + if ($echo) { |
|
885 | + echo EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
886 | 886 | return ''; |
887 | 887 | } |
888 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
888 | + return EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
889 | 889 | } |
890 | 890 | } |
891 | 891 | |
892 | -if ( ! function_exists( 'espresso_organization_google' )) { |
|
892 | +if ( ! function_exists('espresso_organization_google')) { |
|
893 | 893 | /** |
894 | 894 | * espresso_organization_google |
895 | 895 | * @param bool $echo |
896 | 896 | * @return string |
897 | 897 | */ |
898 | - function espresso_organization_google( $echo = TRUE ) { |
|
899 | - if($echo){ |
|
900 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
898 | + function espresso_organization_google($echo = TRUE) { |
|
899 | + if ($echo) { |
|
900 | + echo EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
901 | 901 | return ''; |
902 | 902 | } |
903 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
903 | + return EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
904 | 904 | } |
905 | 905 | } |
906 | 906 | |
907 | -if ( ! function_exists( 'espresso_organization_instagram' )) { |
|
907 | +if ( ! function_exists('espresso_organization_instagram')) { |
|
908 | 908 | /** |
909 | 909 | * espresso_organization_instagram |
910 | 910 | * @param bool $echo |
911 | 911 | * @return string |
912 | 912 | */ |
913 | - function espresso_organization_instagram( $echo = TRUE ) { |
|
914 | - if($echo){ |
|
915 | - echo EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
913 | + function espresso_organization_instagram($echo = TRUE) { |
|
914 | + if ($echo) { |
|
915 | + echo EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
916 | 916 | return ''; |
917 | 917 | } |
918 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
918 | + return EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
919 | 919 | } |
920 | 920 | } |
921 | 921 | |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | |
926 | 926 | |
927 | 927 | |
928 | -if ( ! function_exists( 'espresso_event_venues' )) { |
|
928 | +if ( ! function_exists('espresso_event_venues')) { |
|
929 | 929 | /** |
930 | 930 | * espresso_event_venues |
931 | 931 | * |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | |
940 | 940 | |
941 | 941 | |
942 | -if ( ! function_exists( 'espresso_venue_id' )) { |
|
942 | +if ( ! function_exists('espresso_venue_id')) { |
|
943 | 943 | /** |
944 | 944 | * espresso_venue_name |
945 | 945 | * |
@@ -947,15 +947,15 @@ discard block |
||
947 | 947 | * @param int $EVT_ID |
948 | 948 | * @return string |
949 | 949 | */ |
950 | - function espresso_venue_id( $EVT_ID = 0 ) { |
|
951 | - $venue = EEH_Venue_View::get_venue( $EVT_ID ); |
|
950 | + function espresso_venue_id($EVT_ID = 0) { |
|
951 | + $venue = EEH_Venue_View::get_venue($EVT_ID); |
|
952 | 952 | return $venue instanceof EE_Venue ? $venue->ID() : 0; |
953 | 953 | } |
954 | 954 | } |
955 | 955 | |
956 | 956 | |
957 | 957 | |
958 | -if ( ! function_exists( 'espresso_is_venue_private' ) ) { |
|
958 | +if ( ! function_exists('espresso_is_venue_private')) { |
|
959 | 959 | /** |
960 | 960 | * Return whether a venue is private or not. |
961 | 961 | * @see EEH_Venue_View::get_venue() for more info on expected return results. |
@@ -964,45 +964,45 @@ discard block |
||
964 | 964 | * |
965 | 965 | * @return bool | null |
966 | 966 | */ |
967 | - function espresso_is_venue_private( $VNU_ID = 0 ) { |
|
968 | - return EEH_Venue_View::is_venue_private( $VNU_ID ); |
|
967 | + function espresso_is_venue_private($VNU_ID = 0) { |
|
968 | + return EEH_Venue_View::is_venue_private($VNU_ID); |
|
969 | 969 | } |
970 | 970 | } |
971 | 971 | |
972 | 972 | |
973 | 973 | |
974 | -if ( ! function_exists( 'espresso_venue_is_password_protected' ) ) { |
|
974 | +if ( ! function_exists('espresso_venue_is_password_protected')) { |
|
975 | 975 | /** |
976 | 976 | * returns true or false if a venue is password protected or not |
977 | 977 | * |
978 | 978 | * @param int $VNU_ID optional, the venue id to check. |
979 | 979 | * @return string |
980 | 980 | */ |
981 | - function espresso_venue_is_password_protected( $VNU_ID = 0 ) { |
|
982 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
983 | - return EEH_Venue_View::is_venue_password_protected( $VNU_ID ); |
|
981 | + function espresso_venue_is_password_protected($VNU_ID = 0) { |
|
982 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
983 | + return EEH_Venue_View::is_venue_password_protected($VNU_ID); |
|
984 | 984 | } |
985 | 985 | } |
986 | 986 | |
987 | 987 | |
988 | 988 | |
989 | -if ( ! function_exists( 'espresso_password_protected_venue_form' ) ) { |
|
989 | +if ( ! function_exists('espresso_password_protected_venue_form')) { |
|
990 | 990 | /** |
991 | 991 | * Returns a password form if venue is password protected. |
992 | 992 | * |
993 | 993 | * @param int $VNU_ID optional, the venue id to check. |
994 | 994 | * @return string |
995 | 995 | */ |
996 | - function espresso_password_protected_venue_form( $VNU_ID = 0 ) { |
|
997 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
998 | - return EEH_Venue_View::password_protected_venue_form( $VNU_ID ); |
|
996 | + function espresso_password_protected_venue_form($VNU_ID = 0) { |
|
997 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
998 | + return EEH_Venue_View::password_protected_venue_form($VNU_ID); |
|
999 | 999 | } |
1000 | 1000 | } |
1001 | 1001 | |
1002 | 1002 | |
1003 | 1003 | |
1004 | 1004 | |
1005 | -if ( ! function_exists( 'espresso_venue_name' )) { |
|
1005 | +if ( ! function_exists('espresso_venue_name')) { |
|
1006 | 1006 | /** |
1007 | 1007 | * espresso_venue_name |
1008 | 1008 | * |
@@ -1012,19 +1012,19 @@ discard block |
||
1012 | 1012 | * @param bool $echo |
1013 | 1013 | * @return string |
1014 | 1014 | */ |
1015 | - function espresso_venue_name( $VNU_ID = 0, $link_to = 'details', $echo = TRUE ) { |
|
1016 | - if($echo){ |
|
1017 | - echo EEH_Venue_View::venue_name( $link_to, $VNU_ID ); |
|
1015 | + function espresso_venue_name($VNU_ID = 0, $link_to = 'details', $echo = TRUE) { |
|
1016 | + if ($echo) { |
|
1017 | + echo EEH_Venue_View::venue_name($link_to, $VNU_ID); |
|
1018 | 1018 | return ''; |
1019 | 1019 | } |
1020 | - return EEH_Venue_View::venue_name( $link_to, $VNU_ID ); |
|
1020 | + return EEH_Venue_View::venue_name($link_to, $VNU_ID); |
|
1021 | 1021 | } |
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | |
1025 | 1025 | |
1026 | 1026 | |
1027 | -if ( ! function_exists( 'espresso_venue_link' )) { |
|
1027 | +if ( ! function_exists('espresso_venue_link')) { |
|
1028 | 1028 | /** |
1029 | 1029 | * espresso_venue_link |
1030 | 1030 | * |
@@ -1033,14 +1033,14 @@ discard block |
||
1033 | 1033 | * @param string $text |
1034 | 1034 | * @return string |
1035 | 1035 | */ |
1036 | - function espresso_venue_link( $VNU_ID = 0, $text = '' ) { |
|
1037 | - return EEH_Venue_View::venue_details_link( $VNU_ID, $text ); |
|
1036 | + function espresso_venue_link($VNU_ID = 0, $text = '') { |
|
1037 | + return EEH_Venue_View::venue_details_link($VNU_ID, $text); |
|
1038 | 1038 | } |
1039 | 1039 | } |
1040 | 1040 | |
1041 | 1041 | |
1042 | 1042 | |
1043 | -if ( ! function_exists( 'espresso_venue_description' )) { |
|
1043 | +if ( ! function_exists('espresso_venue_description')) { |
|
1044 | 1044 | /** |
1045 | 1045 | * espresso_venue_description |
1046 | 1046 | * |
@@ -1049,17 +1049,17 @@ discard block |
||
1049 | 1049 | * @param bool $echo |
1050 | 1050 | * @return string |
1051 | 1051 | */ |
1052 | - function espresso_venue_description( $VNU_ID = FALSE, $echo = TRUE ) { |
|
1053 | - if($echo){ |
|
1054 | - echo EEH_Venue_View::venue_description( $VNU_ID ); |
|
1052 | + function espresso_venue_description($VNU_ID = FALSE, $echo = TRUE) { |
|
1053 | + if ($echo) { |
|
1054 | + echo EEH_Venue_View::venue_description($VNU_ID); |
|
1055 | 1055 | return ''; |
1056 | 1056 | } |
1057 | - return EEH_Venue_View::venue_description( $VNU_ID ); |
|
1057 | + return EEH_Venue_View::venue_description($VNU_ID); |
|
1058 | 1058 | } |
1059 | 1059 | } |
1060 | 1060 | |
1061 | 1061 | |
1062 | -if ( ! function_exists( 'espresso_venue_excerpt' )) { |
|
1062 | +if ( ! function_exists('espresso_venue_excerpt')) { |
|
1063 | 1063 | /** |
1064 | 1064 | * espresso_venue_excerpt |
1065 | 1065 | * |
@@ -1068,18 +1068,18 @@ discard block |
||
1068 | 1068 | * @param bool $echo |
1069 | 1069 | * @return string |
1070 | 1070 | */ |
1071 | - function espresso_venue_excerpt( $VNU_ID = 0, $echo = TRUE ) { |
|
1072 | - if ( $echo ) { |
|
1073 | - echo EEH_Venue_View::venue_excerpt( $VNU_ID ); |
|
1071 | + function espresso_venue_excerpt($VNU_ID = 0, $echo = TRUE) { |
|
1072 | + if ($echo) { |
|
1073 | + echo EEH_Venue_View::venue_excerpt($VNU_ID); |
|
1074 | 1074 | return ''; |
1075 | 1075 | } |
1076 | - return EEH_Venue_View::venue_excerpt( $VNU_ID ); |
|
1076 | + return EEH_Venue_View::venue_excerpt($VNU_ID); |
|
1077 | 1077 | } |
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | |
1081 | 1081 | |
1082 | -if ( ! function_exists( 'espresso_venue_categories' )) { |
|
1082 | +if ( ! function_exists('espresso_venue_categories')) { |
|
1083 | 1083 | /** |
1084 | 1084 | * espresso_venue_categories |
1085 | 1085 | * returns the terms associated with a venue |
@@ -1089,17 +1089,17 @@ discard block |
||
1089 | 1089 | * @param bool $echo |
1090 | 1090 | * @return string |
1091 | 1091 | */ |
1092 | - function espresso_venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) { |
|
1093 | - if ( $echo ) { |
|
1094 | - echo EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized ); |
|
1092 | + function espresso_venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) { |
|
1093 | + if ($echo) { |
|
1094 | + echo EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); |
|
1095 | 1095 | return ''; |
1096 | 1096 | } |
1097 | - return EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized ); |
|
1097 | + return EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); |
|
1098 | 1098 | } |
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | |
1102 | -if ( ! function_exists( 'espresso_venue_address' )) { |
|
1102 | +if ( ! function_exists('espresso_venue_address')) { |
|
1103 | 1103 | /** |
1104 | 1104 | * espresso_venue_address |
1105 | 1105 | * returns a formatted block of html for displaying a venue's address |
@@ -1109,17 +1109,17 @@ discard block |
||
1109 | 1109 | * @param bool $echo |
1110 | 1110 | * @return string |
1111 | 1111 | */ |
1112 | - function espresso_venue_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) { |
|
1113 | - if ( $echo ) { |
|
1114 | - echo EEH_Venue_View::venue_address( $type, $VNU_ID ); |
|
1112 | + function espresso_venue_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) { |
|
1113 | + if ($echo) { |
|
1114 | + echo EEH_Venue_View::venue_address($type, $VNU_ID); |
|
1115 | 1115 | return ''; |
1116 | 1116 | } |
1117 | - return EEH_Venue_View::venue_address( $type, $VNU_ID ); |
|
1117 | + return EEH_Venue_View::venue_address($type, $VNU_ID); |
|
1118 | 1118 | } |
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | |
1122 | -if ( ! function_exists( 'espresso_venue_raw_address' )) { |
|
1122 | +if ( ! function_exists('espresso_venue_raw_address')) { |
|
1123 | 1123 | /** |
1124 | 1124 | * espresso_venue_address |
1125 | 1125 | * returns an UN-formatted string containing a venue's address |
@@ -1129,17 +1129,17 @@ discard block |
||
1129 | 1129 | * @param bool $echo |
1130 | 1130 | * @return string |
1131 | 1131 | */ |
1132 | - function espresso_venue_raw_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) { |
|
1133 | - if ( $echo ) { |
|
1134 | - echo EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE ); |
|
1132 | + function espresso_venue_raw_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) { |
|
1133 | + if ($echo) { |
|
1134 | + echo EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE); |
|
1135 | 1135 | return ''; |
1136 | 1136 | } |
1137 | - return EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE ); |
|
1137 | + return EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE); |
|
1138 | 1138 | } |
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | |
1142 | -if ( ! function_exists( 'espresso_venue_has_address' )) { |
|
1142 | +if ( ! function_exists('espresso_venue_has_address')) { |
|
1143 | 1143 | /** |
1144 | 1144 | * espresso_venue_has_address |
1145 | 1145 | * returns TRUE or FALSE if a Venue has address information |
@@ -1147,13 +1147,13 @@ discard block |
||
1147 | 1147 | * @param int $VNU_ID |
1148 | 1148 | * @return bool |
1149 | 1149 | */ |
1150 | - function espresso_venue_has_address( $VNU_ID = 0 ) { |
|
1151 | - return EEH_Venue_View::venue_has_address( $VNU_ID ); |
|
1150 | + function espresso_venue_has_address($VNU_ID = 0) { |
|
1151 | + return EEH_Venue_View::venue_has_address($VNU_ID); |
|
1152 | 1152 | } |
1153 | 1153 | } |
1154 | 1154 | |
1155 | 1155 | |
1156 | -if ( ! function_exists( 'espresso_venue_gmap' )) { |
|
1156 | +if ( ! function_exists('espresso_venue_gmap')) { |
|
1157 | 1157 | /** |
1158 | 1158 | * espresso_venue_gmap |
1159 | 1159 | * returns a google map for the venue address |
@@ -1164,17 +1164,17 @@ discard block |
||
1164 | 1164 | * @param bool $echo |
1165 | 1165 | * @return string |
1166 | 1166 | */ |
1167 | - function espresso_venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE ) { |
|
1168 | - if ( $echo ) { |
|
1169 | - echo EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap ); |
|
1167 | + function espresso_venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE) { |
|
1168 | + if ($echo) { |
|
1169 | + echo EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); |
|
1170 | 1170 | return ''; |
1171 | 1171 | } |
1172 | - return EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap ); |
|
1172 | + return EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); |
|
1173 | 1173 | } |
1174 | 1174 | } |
1175 | 1175 | |
1176 | 1176 | |
1177 | -if ( ! function_exists( 'espresso_venue_phone' )) { |
|
1177 | +if ( ! function_exists('espresso_venue_phone')) { |
|
1178 | 1178 | /** |
1179 | 1179 | * espresso_venue_phone |
1180 | 1180 | * |
@@ -1182,18 +1182,18 @@ discard block |
||
1182 | 1182 | * @param bool $echo |
1183 | 1183 | * @return string |
1184 | 1184 | */ |
1185 | - function espresso_venue_phone( $VNU_ID = 0, $echo = TRUE ) { |
|
1186 | - if ( $echo ) { |
|
1187 | - echo EEH_Venue_View::venue_phone( $VNU_ID ); |
|
1185 | + function espresso_venue_phone($VNU_ID = 0, $echo = TRUE) { |
|
1186 | + if ($echo) { |
|
1187 | + echo EEH_Venue_View::venue_phone($VNU_ID); |
|
1188 | 1188 | return ''; |
1189 | 1189 | } |
1190 | - return EEH_Venue_View::venue_phone( $VNU_ID ); |
|
1190 | + return EEH_Venue_View::venue_phone($VNU_ID); |
|
1191 | 1191 | } |
1192 | 1192 | } |
1193 | 1193 | |
1194 | 1194 | |
1195 | 1195 | |
1196 | -if ( ! function_exists( 'espresso_venue_website' )) { |
|
1196 | +if ( ! function_exists('espresso_venue_website')) { |
|
1197 | 1197 | /** |
1198 | 1198 | * espresso_venue_website |
1199 | 1199 | * |
@@ -1201,18 +1201,18 @@ discard block |
||
1201 | 1201 | * @param bool $echo |
1202 | 1202 | * @return string |
1203 | 1203 | */ |
1204 | - function espresso_venue_website( $VNU_ID = 0, $echo = TRUE ) { |
|
1205 | - if ( $echo ) { |
|
1206 | - echo EEH_Venue_View::venue_website_link( $VNU_ID ); |
|
1204 | + function espresso_venue_website($VNU_ID = 0, $echo = TRUE) { |
|
1205 | + if ($echo) { |
|
1206 | + echo EEH_Venue_View::venue_website_link($VNU_ID); |
|
1207 | 1207 | return ''; |
1208 | 1208 | } |
1209 | - return EEH_Venue_View::venue_website_link( $VNU_ID ); |
|
1209 | + return EEH_Venue_View::venue_website_link($VNU_ID); |
|
1210 | 1210 | } |
1211 | 1211 | } |
1212 | 1212 | |
1213 | 1213 | |
1214 | 1214 | |
1215 | -if ( ! function_exists( 'espresso_edit_venue_link' )) { |
|
1215 | +if ( ! function_exists('espresso_edit_venue_link')) { |
|
1216 | 1216 | /** |
1217 | 1217 | * espresso_edit_venue_link |
1218 | 1218 | * |
@@ -1220,12 +1220,12 @@ discard block |
||
1220 | 1220 | * @param bool $echo |
1221 | 1221 | * @return string |
1222 | 1222 | */ |
1223 | - function espresso_edit_venue_link( $VNU_ID = 0, $echo = TRUE ) { |
|
1224 | - if($echo){ |
|
1225 | - echo EEH_Venue_View::edit_venue_link( $VNU_ID ); |
|
1223 | + function espresso_edit_venue_link($VNU_ID = 0, $echo = TRUE) { |
|
1224 | + if ($echo) { |
|
1225 | + echo EEH_Venue_View::edit_venue_link($VNU_ID); |
|
1226 | 1226 | return ''; |
1227 | 1227 | } |
1228 | - return EEH_Venue_View::edit_venue_link( $VNU_ID ); |
|
1228 | + return EEH_Venue_View::edit_venue_link($VNU_ID); |
|
1229 | 1229 | } |
1230 | 1230 | } |
1231 | 1231 |
@@ -38,423 +38,423 @@ |
||
38 | 38 | class Datetime extends TypeBase |
39 | 39 | { |
40 | 40 | |
41 | - /** |
|
42 | - * EventDate constructor. |
|
43 | - * |
|
44 | - * @param EEM_Datetime $datetime_model |
|
45 | - */ |
|
46 | - public function __construct(EEM_Datetime $datetime_model) |
|
47 | - { |
|
48 | - $this->setName($this->namespace . 'Datetime'); |
|
49 | - $this->setDescription(__('An event date', 'event_espresso')); |
|
50 | - $this->setIsCustomPostType(false); |
|
51 | - parent::__construct($datetime_model); |
|
52 | - } |
|
41 | + /** |
|
42 | + * EventDate constructor. |
|
43 | + * |
|
44 | + * @param EEM_Datetime $datetime_model |
|
45 | + */ |
|
46 | + public function __construct(EEM_Datetime $datetime_model) |
|
47 | + { |
|
48 | + $this->setName($this->namespace . 'Datetime'); |
|
49 | + $this->setDescription(__('An event date', 'event_espresso')); |
|
50 | + $this->setIsCustomPostType(false); |
|
51 | + parent::__construct($datetime_model); |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | - /** |
|
56 | - * @return GraphQLFieldInterface[] |
|
57 | - */ |
|
58 | - public function getFields(): array |
|
59 | - { |
|
60 | - $fields = [ |
|
61 | - new GraphQLField( |
|
62 | - 'id', |
|
63 | - ['non_null' => 'ID'], |
|
64 | - null, |
|
65 | - esc_html__('The globally unique ID for the object.', 'event_espresso') |
|
66 | - ), |
|
67 | - new GraphQLOutputField( |
|
68 | - 'dbId', |
|
69 | - ['non_null' => 'Int'], |
|
70 | - 'ID', |
|
71 | - esc_html__('The datetime ID.', 'event_espresso') |
|
72 | - ), |
|
73 | - new GraphQLOutputField( |
|
74 | - 'cacheId', |
|
75 | - ['non_null' => 'String'], |
|
76 | - null, |
|
77 | - esc_html__('The cache ID of the object.', 'event_espresso') |
|
78 | - ), |
|
79 | - new GraphQLField( |
|
80 | - 'capacity', |
|
81 | - 'Int', |
|
82 | - 'reg_limit', |
|
83 | - esc_html__('Registration Limit for this time', 'event_espresso'), |
|
84 | - [$this, 'parseInfiniteValue'] |
|
85 | - ), |
|
86 | - new GraphQLField( |
|
87 | - 'description', |
|
88 | - 'String', |
|
89 | - 'description', |
|
90 | - esc_html__('Description for Datetime', 'event_espresso') |
|
91 | - ), |
|
92 | - new GraphQLField( |
|
93 | - 'endDate', |
|
94 | - 'String', |
|
95 | - 'end_date_and_time', |
|
96 | - esc_html__('End date and time of the Event', 'event_espresso'), |
|
97 | - [$this, 'formatDatetime'] |
|
98 | - ), |
|
99 | - new GraphQLOutputField( |
|
100 | - 'event', |
|
101 | - $this->namespace . 'Event', |
|
102 | - null, |
|
103 | - esc_html__('Event of the datetime.', 'event_espresso') |
|
104 | - ), |
|
105 | - new GraphQLInputField( |
|
106 | - 'event', |
|
107 | - 'ID', |
|
108 | - null, |
|
109 | - esc_html__('Globally unique event ID of the datetime.', 'event_espresso') |
|
110 | - ), |
|
111 | - new GraphQLInputField( |
|
112 | - 'eventId', |
|
113 | - 'Int', |
|
114 | - null, |
|
115 | - esc_html__('Event ID of the datetime.', 'event_espresso') |
|
116 | - ), |
|
117 | - new GraphQLOutputField( |
|
118 | - 'isActive', |
|
119 | - 'Boolean', |
|
120 | - 'is_active', |
|
121 | - esc_html__('Flag indicating datetime is active', 'event_espresso') |
|
122 | - ), |
|
123 | - new GraphQLOutputField( |
|
124 | - 'isExpired', |
|
125 | - 'Boolean', |
|
126 | - 'is_expired', |
|
127 | - esc_html__('Flag indicating datetime is expired or not', 'event_espresso') |
|
128 | - ), |
|
129 | - new GraphQLField( |
|
130 | - 'isPrimary', |
|
131 | - 'Boolean', |
|
132 | - 'is_primary', |
|
133 | - esc_html__('Flag indicating datetime is primary one for event', 'event_espresso') |
|
134 | - ), |
|
135 | - new GraphQLOutputField( |
|
136 | - 'isSoldOut', |
|
137 | - 'Boolean', |
|
138 | - 'sold_out', |
|
139 | - esc_html__( |
|
140 | - 'Flag indicating whether the tickets sold for this datetime, met or exceed the registration limit', |
|
141 | - 'event_espresso' |
|
142 | - ) |
|
143 | - ), |
|
144 | - new GraphQLField( |
|
145 | - 'isTrashed', |
|
146 | - 'Boolean', |
|
147 | - null, |
|
148 | - esc_html__('Flag indicating datetime has been trashed.', 'event_espresso'), |
|
149 | - null, |
|
150 | - [$this, 'getIsTrashed'] |
|
151 | - ), |
|
152 | - new GraphQLOutputField( |
|
153 | - 'isUpcoming', |
|
154 | - 'Boolean', |
|
155 | - 'is_upcoming', |
|
156 | - esc_html__('Whether the date is upcoming', 'event_espresso') |
|
157 | - ), |
|
158 | - new GraphQLOutputField( |
|
159 | - 'length', |
|
160 | - 'Int', |
|
161 | - 'length', |
|
162 | - esc_html__('The length of the event (start to end time) in seconds', 'event_espresso') |
|
163 | - ), |
|
164 | - new GraphQLField( |
|
165 | - 'name', |
|
166 | - 'String', |
|
167 | - 'name', |
|
168 | - esc_html__('Datetime Name', 'event_espresso') |
|
169 | - ), |
|
170 | - new GraphQLField( |
|
171 | - 'order', |
|
172 | - 'Int', |
|
173 | - 'order', |
|
174 | - esc_html__('The order in which the Datetime is displayed', 'event_espresso') |
|
175 | - ), |
|
176 | - new GraphQLOutputField( |
|
177 | - 'parent', |
|
178 | - $this->name(), |
|
179 | - null, |
|
180 | - esc_html__('The parent datetime of the current datetime', 'event_espresso') |
|
181 | - ), |
|
182 | - new GraphQLInputField( |
|
183 | - 'parent', |
|
184 | - 'ID', |
|
185 | - null, |
|
186 | - esc_html__('The parent datetime ID', 'event_espresso') |
|
187 | - ), |
|
188 | - new GraphQLField( |
|
189 | - 'reserved', |
|
190 | - 'Int', |
|
191 | - 'reserved', |
|
192 | - esc_html__('Quantity of tickets reserved, but not yet fully purchased', 'event_espresso') |
|
193 | - ), |
|
194 | - new GraphQLField( |
|
195 | - 'startDate', |
|
196 | - 'String', |
|
197 | - 'start_date_and_time', |
|
198 | - esc_html__('Start date and time of the Event', 'event_espresso'), |
|
199 | - [$this, 'formatDatetime'] |
|
200 | - ), |
|
201 | - new GraphQLField( |
|
202 | - 'sold', |
|
203 | - 'Int', |
|
204 | - 'sold', |
|
205 | - esc_html__('How many sales for this Datetime that have occurred', 'event_espresso') |
|
206 | - ), |
|
207 | - new GraphQLOutputField( |
|
208 | - 'status', |
|
209 | - $this->namespace . 'DatetimeStatusEnum', |
|
210 | - 'get_active_status', |
|
211 | - esc_html__('Datetime status', 'event_espresso') |
|
212 | - ), |
|
213 | - new GraphQLInputField( |
|
214 | - 'tickets', |
|
215 | - ['list_of' => 'ID'], |
|
216 | - null, |
|
217 | - sprintf( |
|
218 | - '%1$s %2$s', |
|
219 | - esc_html__('Globally unique IDs of the tickets related to the datetime.', 'event_espresso'), |
|
220 | - esc_html__('Ignored if empty.', 'event_espresso') |
|
221 | - ) |
|
222 | - ), |
|
223 | - new GraphQLField( |
|
224 | - 'venue', |
|
225 | - 'String', |
|
226 | - null, |
|
227 | - esc_html__('Datetime venue ID', 'event_espresso'), |
|
228 | - null, |
|
229 | - function (EE_Datetime $source) { |
|
230 | - $venue_ID = $source->venue_ID(); |
|
231 | - return $venue_ID |
|
232 | - // Since venue is a CPT, $type will be 'post' |
|
233 | - ? Relay::toGlobalId('post', $venue_ID) |
|
234 | - : null; |
|
235 | - } |
|
236 | - ), |
|
237 | - ]; |
|
55 | + /** |
|
56 | + * @return GraphQLFieldInterface[] |
|
57 | + */ |
|
58 | + public function getFields(): array |
|
59 | + { |
|
60 | + $fields = [ |
|
61 | + new GraphQLField( |
|
62 | + 'id', |
|
63 | + ['non_null' => 'ID'], |
|
64 | + null, |
|
65 | + esc_html__('The globally unique ID for the object.', 'event_espresso') |
|
66 | + ), |
|
67 | + new GraphQLOutputField( |
|
68 | + 'dbId', |
|
69 | + ['non_null' => 'Int'], |
|
70 | + 'ID', |
|
71 | + esc_html__('The datetime ID.', 'event_espresso') |
|
72 | + ), |
|
73 | + new GraphQLOutputField( |
|
74 | + 'cacheId', |
|
75 | + ['non_null' => 'String'], |
|
76 | + null, |
|
77 | + esc_html__('The cache ID of the object.', 'event_espresso') |
|
78 | + ), |
|
79 | + new GraphQLField( |
|
80 | + 'capacity', |
|
81 | + 'Int', |
|
82 | + 'reg_limit', |
|
83 | + esc_html__('Registration Limit for this time', 'event_espresso'), |
|
84 | + [$this, 'parseInfiniteValue'] |
|
85 | + ), |
|
86 | + new GraphQLField( |
|
87 | + 'description', |
|
88 | + 'String', |
|
89 | + 'description', |
|
90 | + esc_html__('Description for Datetime', 'event_espresso') |
|
91 | + ), |
|
92 | + new GraphQLField( |
|
93 | + 'endDate', |
|
94 | + 'String', |
|
95 | + 'end_date_and_time', |
|
96 | + esc_html__('End date and time of the Event', 'event_espresso'), |
|
97 | + [$this, 'formatDatetime'] |
|
98 | + ), |
|
99 | + new GraphQLOutputField( |
|
100 | + 'event', |
|
101 | + $this->namespace . 'Event', |
|
102 | + null, |
|
103 | + esc_html__('Event of the datetime.', 'event_espresso') |
|
104 | + ), |
|
105 | + new GraphQLInputField( |
|
106 | + 'event', |
|
107 | + 'ID', |
|
108 | + null, |
|
109 | + esc_html__('Globally unique event ID of the datetime.', 'event_espresso') |
|
110 | + ), |
|
111 | + new GraphQLInputField( |
|
112 | + 'eventId', |
|
113 | + 'Int', |
|
114 | + null, |
|
115 | + esc_html__('Event ID of the datetime.', 'event_espresso') |
|
116 | + ), |
|
117 | + new GraphQLOutputField( |
|
118 | + 'isActive', |
|
119 | + 'Boolean', |
|
120 | + 'is_active', |
|
121 | + esc_html__('Flag indicating datetime is active', 'event_espresso') |
|
122 | + ), |
|
123 | + new GraphQLOutputField( |
|
124 | + 'isExpired', |
|
125 | + 'Boolean', |
|
126 | + 'is_expired', |
|
127 | + esc_html__('Flag indicating datetime is expired or not', 'event_espresso') |
|
128 | + ), |
|
129 | + new GraphQLField( |
|
130 | + 'isPrimary', |
|
131 | + 'Boolean', |
|
132 | + 'is_primary', |
|
133 | + esc_html__('Flag indicating datetime is primary one for event', 'event_espresso') |
|
134 | + ), |
|
135 | + new GraphQLOutputField( |
|
136 | + 'isSoldOut', |
|
137 | + 'Boolean', |
|
138 | + 'sold_out', |
|
139 | + esc_html__( |
|
140 | + 'Flag indicating whether the tickets sold for this datetime, met or exceed the registration limit', |
|
141 | + 'event_espresso' |
|
142 | + ) |
|
143 | + ), |
|
144 | + new GraphQLField( |
|
145 | + 'isTrashed', |
|
146 | + 'Boolean', |
|
147 | + null, |
|
148 | + esc_html__('Flag indicating datetime has been trashed.', 'event_espresso'), |
|
149 | + null, |
|
150 | + [$this, 'getIsTrashed'] |
|
151 | + ), |
|
152 | + new GraphQLOutputField( |
|
153 | + 'isUpcoming', |
|
154 | + 'Boolean', |
|
155 | + 'is_upcoming', |
|
156 | + esc_html__('Whether the date is upcoming', 'event_espresso') |
|
157 | + ), |
|
158 | + new GraphQLOutputField( |
|
159 | + 'length', |
|
160 | + 'Int', |
|
161 | + 'length', |
|
162 | + esc_html__('The length of the event (start to end time) in seconds', 'event_espresso') |
|
163 | + ), |
|
164 | + new GraphQLField( |
|
165 | + 'name', |
|
166 | + 'String', |
|
167 | + 'name', |
|
168 | + esc_html__('Datetime Name', 'event_espresso') |
|
169 | + ), |
|
170 | + new GraphQLField( |
|
171 | + 'order', |
|
172 | + 'Int', |
|
173 | + 'order', |
|
174 | + esc_html__('The order in which the Datetime is displayed', 'event_espresso') |
|
175 | + ), |
|
176 | + new GraphQLOutputField( |
|
177 | + 'parent', |
|
178 | + $this->name(), |
|
179 | + null, |
|
180 | + esc_html__('The parent datetime of the current datetime', 'event_espresso') |
|
181 | + ), |
|
182 | + new GraphQLInputField( |
|
183 | + 'parent', |
|
184 | + 'ID', |
|
185 | + null, |
|
186 | + esc_html__('The parent datetime ID', 'event_espresso') |
|
187 | + ), |
|
188 | + new GraphQLField( |
|
189 | + 'reserved', |
|
190 | + 'Int', |
|
191 | + 'reserved', |
|
192 | + esc_html__('Quantity of tickets reserved, but not yet fully purchased', 'event_espresso') |
|
193 | + ), |
|
194 | + new GraphQLField( |
|
195 | + 'startDate', |
|
196 | + 'String', |
|
197 | + 'start_date_and_time', |
|
198 | + esc_html__('Start date and time of the Event', 'event_espresso'), |
|
199 | + [$this, 'formatDatetime'] |
|
200 | + ), |
|
201 | + new GraphQLField( |
|
202 | + 'sold', |
|
203 | + 'Int', |
|
204 | + 'sold', |
|
205 | + esc_html__('How many sales for this Datetime that have occurred', 'event_espresso') |
|
206 | + ), |
|
207 | + new GraphQLOutputField( |
|
208 | + 'status', |
|
209 | + $this->namespace . 'DatetimeStatusEnum', |
|
210 | + 'get_active_status', |
|
211 | + esc_html__('Datetime status', 'event_espresso') |
|
212 | + ), |
|
213 | + new GraphQLInputField( |
|
214 | + 'tickets', |
|
215 | + ['list_of' => 'ID'], |
|
216 | + null, |
|
217 | + sprintf( |
|
218 | + '%1$s %2$s', |
|
219 | + esc_html__('Globally unique IDs of the tickets related to the datetime.', 'event_espresso'), |
|
220 | + esc_html__('Ignored if empty.', 'event_espresso') |
|
221 | + ) |
|
222 | + ), |
|
223 | + new GraphQLField( |
|
224 | + 'venue', |
|
225 | + 'String', |
|
226 | + null, |
|
227 | + esc_html__('Datetime venue ID', 'event_espresso'), |
|
228 | + null, |
|
229 | + function (EE_Datetime $source) { |
|
230 | + $venue_ID = $source->venue_ID(); |
|
231 | + return $venue_ID |
|
232 | + // Since venue is a CPT, $type will be 'post' |
|
233 | + ? Relay::toGlobalId('post', $venue_ID) |
|
234 | + : null; |
|
235 | + } |
|
236 | + ), |
|
237 | + ]; |
|
238 | 238 | |
239 | - return apply_filters( |
|
240 | - 'FHEE__EventEspresso_core_domain_services_graphql_types__datetime_fields', |
|
241 | - $fields, |
|
242 | - $this->name, |
|
243 | - $this->model |
|
244 | - ); |
|
245 | - } |
|
239 | + return apply_filters( |
|
240 | + 'FHEE__EventEspresso_core_domain_services_graphql_types__datetime_fields', |
|
241 | + $fields, |
|
242 | + $this->name, |
|
243 | + $this->model |
|
244 | + ); |
|
245 | + } |
|
246 | 246 | |
247 | 247 | |
248 | - /** |
|
249 | - * @param EE_Datetime $source The source that's passed down the GraphQL queries |
|
250 | - * @param array $args The inputArgs on the field |
|
251 | - * @param AppContext $context The AppContext passed down the GraphQL tree |
|
252 | - * @param ResolveInfo $info The ResolveInfo passed down the GraphQL tree |
|
253 | - * @return bool |
|
254 | - * @throws Exception |
|
255 | - * @throws InvalidArgumentException |
|
256 | - * @throws InvalidDataTypeException |
|
257 | - * @throws InvalidInterfaceException |
|
258 | - * @throws ReflectionException |
|
259 | - * @throws UserError |
|
260 | - * @throws UnexpectedEntityException |
|
261 | - */ |
|
262 | - public function getIsTrashed(EE_Datetime $source, array $args, AppContext $context, ResolveInfo $info): bool |
|
263 | - { |
|
264 | - return (bool) $source->get('DTT_deleted'); |
|
265 | - } |
|
248 | + /** |
|
249 | + * @param EE_Datetime $source The source that's passed down the GraphQL queries |
|
250 | + * @param array $args The inputArgs on the field |
|
251 | + * @param AppContext $context The AppContext passed down the GraphQL tree |
|
252 | + * @param ResolveInfo $info The ResolveInfo passed down the GraphQL tree |
|
253 | + * @return bool |
|
254 | + * @throws Exception |
|
255 | + * @throws InvalidArgumentException |
|
256 | + * @throws InvalidDataTypeException |
|
257 | + * @throws InvalidInterfaceException |
|
258 | + * @throws ReflectionException |
|
259 | + * @throws UserError |
|
260 | + * @throws UnexpectedEntityException |
|
261 | + */ |
|
262 | + public function getIsTrashed(EE_Datetime $source, array $args, AppContext $context, ResolveInfo $info): bool |
|
263 | + { |
|
264 | + return (bool) $source->get('DTT_deleted'); |
|
265 | + } |
|
266 | 266 | |
267 | - /** |
|
268 | - * Return the base mutation config for bulk update. |
|
269 | - * |
|
270 | - * @param string $base_input |
|
271 | - * @return array |
|
272 | - */ |
|
273 | - public static function bulkUpdateBaseConfig(string $base_input): array |
|
274 | - { |
|
275 | - return [ |
|
276 | - 'inputFields' => [ |
|
277 | - /** |
|
278 | - * represents the input that is unique for each entity |
|
279 | - * e.g. dates may be unique for datetimes and tickets |
|
280 | - */ |
|
281 | - 'uniqueInputs' => [ |
|
282 | - 'type' => [ |
|
283 | - 'non_null' => ['list_of' => $base_input], |
|
284 | - ], |
|
285 | - 'description' => esc_html__( |
|
286 | - 'List of unique inputs for each entity in bulk update', |
|
287 | - 'event_espresso' |
|
288 | - ), |
|
289 | - ], |
|
290 | - /** |
|
291 | - * represents the common input for all entities |
|
292 | - * e.g. capacity or quantity may be same for all dates/tickets |
|
293 | - */ |
|
294 | - 'sharedInput' => [ |
|
295 | - 'type' => $base_input, |
|
296 | - 'description' => esc_html__( |
|
297 | - 'Shared input for all entities in bulk update', |
|
298 | - 'event_espresso' |
|
299 | - ), |
|
300 | - ], |
|
301 | - ], |
|
302 | - 'outputFields' => [ |
|
303 | - 'updated' => [ |
|
304 | - 'type' => ['list_of' => 'ID'], |
|
305 | - ], |
|
306 | - 'failed' => [ |
|
307 | - 'type' => ['list_of' => 'ID'], |
|
308 | - ], |
|
309 | - ], |
|
310 | - ]; |
|
311 | - } |
|
267 | + /** |
|
268 | + * Return the base mutation config for bulk update. |
|
269 | + * |
|
270 | + * @param string $base_input |
|
271 | + * @return array |
|
272 | + */ |
|
273 | + public static function bulkUpdateBaseConfig(string $base_input): array |
|
274 | + { |
|
275 | + return [ |
|
276 | + 'inputFields' => [ |
|
277 | + /** |
|
278 | + * represents the input that is unique for each entity |
|
279 | + * e.g. dates may be unique for datetimes and tickets |
|
280 | + */ |
|
281 | + 'uniqueInputs' => [ |
|
282 | + 'type' => [ |
|
283 | + 'non_null' => ['list_of' => $base_input], |
|
284 | + ], |
|
285 | + 'description' => esc_html__( |
|
286 | + 'List of unique inputs for each entity in bulk update', |
|
287 | + 'event_espresso' |
|
288 | + ), |
|
289 | + ], |
|
290 | + /** |
|
291 | + * represents the common input for all entities |
|
292 | + * e.g. capacity or quantity may be same for all dates/tickets |
|
293 | + */ |
|
294 | + 'sharedInput' => [ |
|
295 | + 'type' => $base_input, |
|
296 | + 'description' => esc_html__( |
|
297 | + 'Shared input for all entities in bulk update', |
|
298 | + 'event_espresso' |
|
299 | + ), |
|
300 | + ], |
|
301 | + ], |
|
302 | + 'outputFields' => [ |
|
303 | + 'updated' => [ |
|
304 | + 'type' => ['list_of' => 'ID'], |
|
305 | + ], |
|
306 | + 'failed' => [ |
|
307 | + 'type' => ['list_of' => 'ID'], |
|
308 | + ], |
|
309 | + ], |
|
310 | + ]; |
|
311 | + } |
|
312 | 312 | |
313 | 313 | |
314 | - /** |
|
315 | - * @param array $inputFields The mutation input fields. |
|
316 | - * @throws InvalidArgumentException |
|
317 | - * @throws ReflectionException |
|
318 | - * @throws Exception |
|
319 | - */ |
|
320 | - public function registerMutations(array $inputFields) |
|
321 | - { |
|
322 | - register_graphql_input_type( |
|
323 | - 'Update' . $this->name() . 'BaseInput', |
|
324 | - [ |
|
325 | - 'fields' => $inputFields, |
|
326 | - ] |
|
327 | - ); |
|
328 | - // Register mutation to update an entity. |
|
329 | - register_graphql_mutation( |
|
330 | - 'update' . $this->name(), |
|
331 | - [ |
|
332 | - 'inputFields' => $inputFields, |
|
333 | - 'outputFields' => [ |
|
334 | - lcfirst($this->name()) => [ |
|
335 | - 'type' => $this->name(), |
|
336 | - 'resolve' => [$this, 'resolveFromPayload'], |
|
337 | - ], |
|
338 | - ], |
|
339 | - 'mutateAndGetPayload' => DatetimeUpdate::mutateAndGetPayload($this->model, $this), |
|
340 | - ] |
|
341 | - ); |
|
342 | - $base_input = 'Update' . $this->name() . 'BaseInput'; |
|
343 | - // Register mutation to update an entity. |
|
344 | - register_graphql_mutation( |
|
345 | - 'bulkUpdate' . $this->name(), |
|
346 | - array_merge( |
|
347 | - Datetime::bulkUpdateBaseConfig($base_input), |
|
348 | - [ |
|
349 | - 'mutateAndGetPayload' => DatetimeBulkUpdate::mutateAndGetPayload($this->model, $this), |
|
350 | - ] |
|
351 | - ) |
|
352 | - ); |
|
314 | + /** |
|
315 | + * @param array $inputFields The mutation input fields. |
|
316 | + * @throws InvalidArgumentException |
|
317 | + * @throws ReflectionException |
|
318 | + * @throws Exception |
|
319 | + */ |
|
320 | + public function registerMutations(array $inputFields) |
|
321 | + { |
|
322 | + register_graphql_input_type( |
|
323 | + 'Update' . $this->name() . 'BaseInput', |
|
324 | + [ |
|
325 | + 'fields' => $inputFields, |
|
326 | + ] |
|
327 | + ); |
|
328 | + // Register mutation to update an entity. |
|
329 | + register_graphql_mutation( |
|
330 | + 'update' . $this->name(), |
|
331 | + [ |
|
332 | + 'inputFields' => $inputFields, |
|
333 | + 'outputFields' => [ |
|
334 | + lcfirst($this->name()) => [ |
|
335 | + 'type' => $this->name(), |
|
336 | + 'resolve' => [$this, 'resolveFromPayload'], |
|
337 | + ], |
|
338 | + ], |
|
339 | + 'mutateAndGetPayload' => DatetimeUpdate::mutateAndGetPayload($this->model, $this), |
|
340 | + ] |
|
341 | + ); |
|
342 | + $base_input = 'Update' . $this->name() . 'BaseInput'; |
|
343 | + // Register mutation to update an entity. |
|
344 | + register_graphql_mutation( |
|
345 | + 'bulkUpdate' . $this->name(), |
|
346 | + array_merge( |
|
347 | + Datetime::bulkUpdateBaseConfig($base_input), |
|
348 | + [ |
|
349 | + 'mutateAndGetPayload' => DatetimeBulkUpdate::mutateAndGetPayload($this->model, $this), |
|
350 | + ] |
|
351 | + ) |
|
352 | + ); |
|
353 | 353 | |
354 | - // Register mutation to update an entity. |
|
355 | - register_graphql_mutation( |
|
356 | - 'bulkDelete' . $this->namespace . 'Entities', |
|
357 | - [ |
|
358 | - 'inputFields' => [ |
|
359 | - 'entityIds' => [ |
|
360 | - 'type' => [ |
|
361 | - 'non_null' => ['list_of' => 'ID'], |
|
362 | - ], |
|
363 | - 'description' => esc_html__('The list of GUIDs of the entities to be deleted.', 'event_espresso'), |
|
364 | - ], |
|
365 | - 'entityType' => [ |
|
366 | - 'type' => [ |
|
367 | - 'non_null' => $this->namespace . 'ModelNameEnum', |
|
368 | - ], |
|
369 | - 'description' => esc_html__('The entity type for the IDs', 'event_espresso'), |
|
370 | - ], |
|
371 | - 'deletePermanently' => [ |
|
372 | - 'type' => 'Boolean', |
|
373 | - 'description' => esc_html__('Whether to delete the entities permanently.', 'event_espresso'), |
|
374 | - ], |
|
375 | - ], |
|
376 | - 'outputFields' => [ |
|
377 | - 'deleted' => [ |
|
378 | - 'type' => ['list_of' => 'ID'], |
|
379 | - ], |
|
380 | - 'failed' => [ |
|
381 | - 'type' => ['list_of' => 'ID'], |
|
382 | - ], |
|
383 | - ], |
|
384 | - 'mutateAndGetPayload' => BulkEntityDelete::mutateAndGetPayload(), |
|
385 | - ] |
|
386 | - ); |
|
387 | - // Register mutation to delete an entity. |
|
388 | - register_graphql_mutation( |
|
389 | - 'delete' . $this->name(), |
|
390 | - [ |
|
391 | - 'inputFields' => [ |
|
392 | - 'id' => $inputFields['id'], |
|
393 | - 'deletePermanently' => [ |
|
394 | - 'type' => 'Boolean', |
|
395 | - 'description' => esc_html__('Whether to delete the entity permanently.', 'event_espresso'), |
|
396 | - ], |
|
397 | - ], |
|
398 | - 'outputFields' => [ |
|
399 | - lcfirst($this->name()) => [ |
|
400 | - 'type' => $this->name(), |
|
401 | - 'description' => esc_html__('The object before it was deleted', 'event_espresso'), |
|
402 | - 'resolve' => static function ($payload) { |
|
403 | - $deleted = (object) $payload['deleted']; |
|
354 | + // Register mutation to update an entity. |
|
355 | + register_graphql_mutation( |
|
356 | + 'bulkDelete' . $this->namespace . 'Entities', |
|
357 | + [ |
|
358 | + 'inputFields' => [ |
|
359 | + 'entityIds' => [ |
|
360 | + 'type' => [ |
|
361 | + 'non_null' => ['list_of' => 'ID'], |
|
362 | + ], |
|
363 | + 'description' => esc_html__('The list of GUIDs of the entities to be deleted.', 'event_espresso'), |
|
364 | + ], |
|
365 | + 'entityType' => [ |
|
366 | + 'type' => [ |
|
367 | + 'non_null' => $this->namespace . 'ModelNameEnum', |
|
368 | + ], |
|
369 | + 'description' => esc_html__('The entity type for the IDs', 'event_espresso'), |
|
370 | + ], |
|
371 | + 'deletePermanently' => [ |
|
372 | + 'type' => 'Boolean', |
|
373 | + 'description' => esc_html__('Whether to delete the entities permanently.', 'event_espresso'), |
|
374 | + ], |
|
375 | + ], |
|
376 | + 'outputFields' => [ |
|
377 | + 'deleted' => [ |
|
378 | + 'type' => ['list_of' => 'ID'], |
|
379 | + ], |
|
380 | + 'failed' => [ |
|
381 | + 'type' => ['list_of' => 'ID'], |
|
382 | + ], |
|
383 | + ], |
|
384 | + 'mutateAndGetPayload' => BulkEntityDelete::mutateAndGetPayload(), |
|
385 | + ] |
|
386 | + ); |
|
387 | + // Register mutation to delete an entity. |
|
388 | + register_graphql_mutation( |
|
389 | + 'delete' . $this->name(), |
|
390 | + [ |
|
391 | + 'inputFields' => [ |
|
392 | + 'id' => $inputFields['id'], |
|
393 | + 'deletePermanently' => [ |
|
394 | + 'type' => 'Boolean', |
|
395 | + 'description' => esc_html__('Whether to delete the entity permanently.', 'event_espresso'), |
|
396 | + ], |
|
397 | + ], |
|
398 | + 'outputFields' => [ |
|
399 | + lcfirst($this->name()) => [ |
|
400 | + 'type' => $this->name(), |
|
401 | + 'description' => esc_html__('The object before it was deleted', 'event_espresso'), |
|
402 | + 'resolve' => static function ($payload) { |
|
403 | + $deleted = (object) $payload['deleted']; |
|
404 | 404 | |
405 | - return ! empty($deleted) ? $deleted : null; |
|
406 | - }, |
|
407 | - ], |
|
408 | - ], |
|
409 | - 'mutateAndGetPayload' => DatetimeDelete::mutateAndGetPayload($this->model, $this), |
|
410 | - ] |
|
411 | - ); |
|
405 | + return ! empty($deleted) ? $deleted : null; |
|
406 | + }, |
|
407 | + ], |
|
408 | + ], |
|
409 | + 'mutateAndGetPayload' => DatetimeDelete::mutateAndGetPayload($this->model, $this), |
|
410 | + ] |
|
411 | + ); |
|
412 | 412 | |
413 | - // remove primary key from input. |
|
414 | - unset($inputFields['id']); |
|
415 | - // Register mutation to update an entity. |
|
416 | - register_graphql_mutation( |
|
417 | - 'create' . $this->name(), |
|
418 | - [ |
|
419 | - 'inputFields' => $inputFields, |
|
420 | - 'outputFields' => [ |
|
421 | - lcfirst($this->name()) => [ |
|
422 | - 'type' => $this->name(), |
|
423 | - 'resolve' => [$this, 'resolveFromPayload'], |
|
424 | - ], |
|
425 | - ], |
|
426 | - 'mutateAndGetPayload' => DatetimeCreate::mutateAndGetPayload($this->model, $this), |
|
427 | - ] |
|
428 | - ); |
|
413 | + // remove primary key from input. |
|
414 | + unset($inputFields['id']); |
|
415 | + // Register mutation to update an entity. |
|
416 | + register_graphql_mutation( |
|
417 | + 'create' . $this->name(), |
|
418 | + [ |
|
419 | + 'inputFields' => $inputFields, |
|
420 | + 'outputFields' => [ |
|
421 | + lcfirst($this->name()) => [ |
|
422 | + 'type' => $this->name(), |
|
423 | + 'resolve' => [$this, 'resolveFromPayload'], |
|
424 | + ], |
|
425 | + ], |
|
426 | + 'mutateAndGetPayload' => DatetimeCreate::mutateAndGetPayload($this->model, $this), |
|
427 | + ] |
|
428 | + ); |
|
429 | 429 | |
430 | - // Register mutation to update an entity. |
|
431 | - register_graphql_mutation( |
|
432 | - 'reorder' . $this->namespace . 'Entities', |
|
433 | - [ |
|
434 | - 'inputFields' => [ |
|
435 | - 'entityIds' => [ |
|
436 | - 'type' => [ |
|
437 | - 'non_null' => ['list_of' => 'ID'], |
|
438 | - ], |
|
439 | - 'description' => esc_html__('The reordered list of entity GUIDs.', 'event_espresso'), |
|
440 | - ], |
|
441 | - 'entityType' => [ |
|
442 | - 'type' => [ |
|
443 | - 'non_null' => $this->namespace . 'ModelNameEnum', |
|
444 | - ], |
|
445 | - 'description' => esc_html__('The entity type for the IDs', 'event_espresso'), |
|
446 | - ], |
|
447 | - ], |
|
448 | - 'outputFields' => [ |
|
449 | - 'ok' => [ |
|
450 | - 'type' => 'Boolean', |
|
451 | - 'resolve' => function ($payload) { |
|
452 | - return (bool) $payload['ok']; |
|
453 | - }, |
|
454 | - ], |
|
455 | - ], |
|
456 | - 'mutateAndGetPayload' => EntityReorder::mutateAndGetPayload(), |
|
457 | - ] |
|
458 | - ); |
|
459 | - } |
|
430 | + // Register mutation to update an entity. |
|
431 | + register_graphql_mutation( |
|
432 | + 'reorder' . $this->namespace . 'Entities', |
|
433 | + [ |
|
434 | + 'inputFields' => [ |
|
435 | + 'entityIds' => [ |
|
436 | + 'type' => [ |
|
437 | + 'non_null' => ['list_of' => 'ID'], |
|
438 | + ], |
|
439 | + 'description' => esc_html__('The reordered list of entity GUIDs.', 'event_espresso'), |
|
440 | + ], |
|
441 | + 'entityType' => [ |
|
442 | + 'type' => [ |
|
443 | + 'non_null' => $this->namespace . 'ModelNameEnum', |
|
444 | + ], |
|
445 | + 'description' => esc_html__('The entity type for the IDs', 'event_espresso'), |
|
446 | + ], |
|
447 | + ], |
|
448 | + 'outputFields' => [ |
|
449 | + 'ok' => [ |
|
450 | + 'type' => 'Boolean', |
|
451 | + 'resolve' => function ($payload) { |
|
452 | + return (bool) $payload['ok']; |
|
453 | + }, |
|
454 | + ], |
|
455 | + ], |
|
456 | + 'mutateAndGetPayload' => EntityReorder::mutateAndGetPayload(), |
|
457 | + ] |
|
458 | + ); |
|
459 | + } |
|
460 | 460 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function __construct(EEM_Datetime $datetime_model) |
47 | 47 | { |
48 | - $this->setName($this->namespace . 'Datetime'); |
|
48 | + $this->setName($this->namespace.'Datetime'); |
|
49 | 49 | $this->setDescription(__('An event date', 'event_espresso')); |
50 | 50 | $this->setIsCustomPostType(false); |
51 | 51 | parent::__construct($datetime_model); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ), |
99 | 99 | new GraphQLOutputField( |
100 | 100 | 'event', |
101 | - $this->namespace . 'Event', |
|
101 | + $this->namespace.'Event', |
|
102 | 102 | null, |
103 | 103 | esc_html__('Event of the datetime.', 'event_espresso') |
104 | 104 | ), |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | ), |
207 | 207 | new GraphQLOutputField( |
208 | 208 | 'status', |
209 | - $this->namespace . 'DatetimeStatusEnum', |
|
209 | + $this->namespace.'DatetimeStatusEnum', |
|
210 | 210 | 'get_active_status', |
211 | 211 | esc_html__('Datetime status', 'event_espresso') |
212 | 212 | ), |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | null, |
227 | 227 | esc_html__('Datetime venue ID', 'event_espresso'), |
228 | 228 | null, |
229 | - function (EE_Datetime $source) { |
|
229 | + function(EE_Datetime $source) { |
|
230 | 230 | $venue_ID = $source->venue_ID(); |
231 | 231 | return $venue_ID |
232 | 232 | // Since venue is a CPT, $type will be 'post' |
@@ -320,14 +320,14 @@ discard block |
||
320 | 320 | public function registerMutations(array $inputFields) |
321 | 321 | { |
322 | 322 | register_graphql_input_type( |
323 | - 'Update' . $this->name() . 'BaseInput', |
|
323 | + 'Update'.$this->name().'BaseInput', |
|
324 | 324 | [ |
325 | 325 | 'fields' => $inputFields, |
326 | 326 | ] |
327 | 327 | ); |
328 | 328 | // Register mutation to update an entity. |
329 | 329 | register_graphql_mutation( |
330 | - 'update' . $this->name(), |
|
330 | + 'update'.$this->name(), |
|
331 | 331 | [ |
332 | 332 | 'inputFields' => $inputFields, |
333 | 333 | 'outputFields' => [ |
@@ -339,10 +339,10 @@ discard block |
||
339 | 339 | 'mutateAndGetPayload' => DatetimeUpdate::mutateAndGetPayload($this->model, $this), |
340 | 340 | ] |
341 | 341 | ); |
342 | - $base_input = 'Update' . $this->name() . 'BaseInput'; |
|
342 | + $base_input = 'Update'.$this->name().'BaseInput'; |
|
343 | 343 | // Register mutation to update an entity. |
344 | 344 | register_graphql_mutation( |
345 | - 'bulkUpdate' . $this->name(), |
|
345 | + 'bulkUpdate'.$this->name(), |
|
346 | 346 | array_merge( |
347 | 347 | Datetime::bulkUpdateBaseConfig($base_input), |
348 | 348 | [ |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | |
354 | 354 | // Register mutation to update an entity. |
355 | 355 | register_graphql_mutation( |
356 | - 'bulkDelete' . $this->namespace . 'Entities', |
|
356 | + 'bulkDelete'.$this->namespace.'Entities', |
|
357 | 357 | [ |
358 | 358 | 'inputFields' => [ |
359 | 359 | 'entityIds' => [ |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | ], |
365 | 365 | 'entityType' => [ |
366 | 366 | 'type' => [ |
367 | - 'non_null' => $this->namespace . 'ModelNameEnum', |
|
367 | + 'non_null' => $this->namespace.'ModelNameEnum', |
|
368 | 368 | ], |
369 | 369 | 'description' => esc_html__('The entity type for the IDs', 'event_espresso'), |
370 | 370 | ], |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | ); |
387 | 387 | // Register mutation to delete an entity. |
388 | 388 | register_graphql_mutation( |
389 | - 'delete' . $this->name(), |
|
389 | + 'delete'.$this->name(), |
|
390 | 390 | [ |
391 | 391 | 'inputFields' => [ |
392 | 392 | 'id' => $inputFields['id'], |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | lcfirst($this->name()) => [ |
400 | 400 | 'type' => $this->name(), |
401 | 401 | 'description' => esc_html__('The object before it was deleted', 'event_espresso'), |
402 | - 'resolve' => static function ($payload) { |
|
402 | + 'resolve' => static function($payload) { |
|
403 | 403 | $deleted = (object) $payload['deleted']; |
404 | 404 | |
405 | 405 | return ! empty($deleted) ? $deleted : null; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | unset($inputFields['id']); |
415 | 415 | // Register mutation to update an entity. |
416 | 416 | register_graphql_mutation( |
417 | - 'create' . $this->name(), |
|
417 | + 'create'.$this->name(), |
|
418 | 418 | [ |
419 | 419 | 'inputFields' => $inputFields, |
420 | 420 | 'outputFields' => [ |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | |
430 | 430 | // Register mutation to update an entity. |
431 | 431 | register_graphql_mutation( |
432 | - 'reorder' . $this->namespace . 'Entities', |
|
432 | + 'reorder'.$this->namespace.'Entities', |
|
433 | 433 | [ |
434 | 434 | 'inputFields' => [ |
435 | 435 | 'entityIds' => [ |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | ], |
441 | 441 | 'entityType' => [ |
442 | 442 | 'type' => [ |
443 | - 'non_null' => $this->namespace . 'ModelNameEnum', |
|
443 | + 'non_null' => $this->namespace.'ModelNameEnum', |
|
444 | 444 | ], |
445 | 445 | 'description' => esc_html__('The entity type for the IDs', 'event_espresso'), |
446 | 446 | ], |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | 'outputFields' => [ |
449 | 449 | 'ok' => [ |
450 | 450 | 'type' => 'Boolean', |
451 | - 'resolve' => function ($payload) { |
|
451 | + 'resolve' => function($payload) { |
|
452 | 452 | return (bool) $payload['ok']; |
453 | 453 | }, |
454 | 454 | ], |