@@ -10,145 +10,145 @@ |
||
10 | 10 | class EE_Country extends EE_Base_Class |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * @param array $props_n_values |
|
15 | - * @return EE_Country|mixed |
|
16 | - */ |
|
17 | - public static function new_instance($props_n_values = array()) |
|
18 | - { |
|
19 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
20 | - return $has_object ? $has_object : new self($props_n_values); |
|
21 | - } |
|
22 | - |
|
23 | - |
|
24 | - /** |
|
25 | - * @param array $props_n_values |
|
26 | - * @return EE_Country |
|
27 | - */ |
|
28 | - public static function new_instance_from_db($props_n_values = array()) |
|
29 | - { |
|
30 | - return new self($props_n_values, true); |
|
31 | - } |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * Gets the country name |
|
36 | - * |
|
37 | - * @return string |
|
38 | - */ |
|
39 | - public function name() |
|
40 | - { |
|
41 | - return $this->get('CNT_name'); |
|
42 | - } |
|
43 | - |
|
44 | - |
|
45 | - /** |
|
46 | - * Whether the country is active/enabled |
|
47 | - * |
|
48 | - * @return bool |
|
49 | - */ |
|
50 | - public function is_active(): bool |
|
51 | - { |
|
52 | - return $this->get('CNT_active'); |
|
53 | - } |
|
54 | - |
|
55 | - |
|
56 | - /** |
|
57 | - * Gets the country ISO3 |
|
58 | - * |
|
59 | - * @return string |
|
60 | - */ |
|
61 | - public function ISO3(): string |
|
62 | - { |
|
63 | - return $this->get('CNT_ISO3'); |
|
64 | - } |
|
65 | - |
|
66 | - |
|
67 | - /** |
|
68 | - * gets the country's currency code |
|
69 | - * |
|
70 | - * @return string |
|
71 | - */ |
|
72 | - public function currency_code() |
|
73 | - { |
|
74 | - return $this->get('CNT_cur_code'); |
|
75 | - } |
|
76 | - |
|
77 | - |
|
78 | - /** |
|
79 | - * gets the country's currency sign/symbol |
|
80 | - * |
|
81 | - * @return string |
|
82 | - */ |
|
83 | - public function currency_sign() |
|
84 | - { |
|
85 | - $CNT_cur_sign = $this->get('CNT_cur_sign'); |
|
86 | - return $CNT_cur_sign ? $CNT_cur_sign : ''; |
|
87 | - } |
|
88 | - |
|
89 | - |
|
90 | - /** |
|
91 | - * Currency name singular |
|
92 | - * |
|
93 | - * @return string |
|
94 | - */ |
|
95 | - public function currency_name_single() |
|
96 | - { |
|
97 | - return $this->get('CNT_cur_single'); |
|
98 | - } |
|
99 | - |
|
100 | - |
|
101 | - /** |
|
102 | - * Currency name plural |
|
103 | - * |
|
104 | - * @return string |
|
105 | - */ |
|
106 | - public function currency_name_plural() |
|
107 | - { |
|
108 | - return $this->get('CNT_cur_plural'); |
|
109 | - } |
|
110 | - |
|
111 | - |
|
112 | - /** |
|
113 | - * currency_sign_before - ie: $TRUE or FALSE$ |
|
114 | - * |
|
115 | - * @return boolean |
|
116 | - */ |
|
117 | - public function currency_sign_before() |
|
118 | - { |
|
119 | - return $this->get('CNT_cur_sign_b4'); |
|
120 | - } |
|
121 | - |
|
122 | - |
|
123 | - /** |
|
124 | - * currency_decimal_places : 2 = 0.00 3 = 0.000 |
|
125 | - * |
|
126 | - * @return integer |
|
127 | - */ |
|
128 | - public function currency_decimal_places() |
|
129 | - { |
|
130 | - return $this->get('CNT_cur_dec_plc'); |
|
131 | - } |
|
132 | - |
|
133 | - |
|
134 | - /** |
|
135 | - * currency_decimal_mark : (comma) ',' = 0,01 or (decimal) '.' = 0.01 |
|
136 | - * |
|
137 | - * @return string |
|
138 | - */ |
|
139 | - public function currency_decimal_mark() |
|
140 | - { |
|
141 | - return $this->get('CNT_cur_dec_mrk'); |
|
142 | - } |
|
143 | - |
|
144 | - |
|
145 | - /** |
|
146 | - * currency thousands separator: (comma) ',' = 1,000 or (decimal) '.' = 1.000 |
|
147 | - * |
|
148 | - * @return string |
|
149 | - */ |
|
150 | - public function currency_thousands_separator() |
|
151 | - { |
|
152 | - return $this->get('CNT_cur_thsnds'); |
|
153 | - } |
|
13 | + /** |
|
14 | + * @param array $props_n_values |
|
15 | + * @return EE_Country|mixed |
|
16 | + */ |
|
17 | + public static function new_instance($props_n_values = array()) |
|
18 | + { |
|
19 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
20 | + return $has_object ? $has_object : new self($props_n_values); |
|
21 | + } |
|
22 | + |
|
23 | + |
|
24 | + /** |
|
25 | + * @param array $props_n_values |
|
26 | + * @return EE_Country |
|
27 | + */ |
|
28 | + public static function new_instance_from_db($props_n_values = array()) |
|
29 | + { |
|
30 | + return new self($props_n_values, true); |
|
31 | + } |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * Gets the country name |
|
36 | + * |
|
37 | + * @return string |
|
38 | + */ |
|
39 | + public function name() |
|
40 | + { |
|
41 | + return $this->get('CNT_name'); |
|
42 | + } |
|
43 | + |
|
44 | + |
|
45 | + /** |
|
46 | + * Whether the country is active/enabled |
|
47 | + * |
|
48 | + * @return bool |
|
49 | + */ |
|
50 | + public function is_active(): bool |
|
51 | + { |
|
52 | + return $this->get('CNT_active'); |
|
53 | + } |
|
54 | + |
|
55 | + |
|
56 | + /** |
|
57 | + * Gets the country ISO3 |
|
58 | + * |
|
59 | + * @return string |
|
60 | + */ |
|
61 | + public function ISO3(): string |
|
62 | + { |
|
63 | + return $this->get('CNT_ISO3'); |
|
64 | + } |
|
65 | + |
|
66 | + |
|
67 | + /** |
|
68 | + * gets the country's currency code |
|
69 | + * |
|
70 | + * @return string |
|
71 | + */ |
|
72 | + public function currency_code() |
|
73 | + { |
|
74 | + return $this->get('CNT_cur_code'); |
|
75 | + } |
|
76 | + |
|
77 | + |
|
78 | + /** |
|
79 | + * gets the country's currency sign/symbol |
|
80 | + * |
|
81 | + * @return string |
|
82 | + */ |
|
83 | + public function currency_sign() |
|
84 | + { |
|
85 | + $CNT_cur_sign = $this->get('CNT_cur_sign'); |
|
86 | + return $CNT_cur_sign ? $CNT_cur_sign : ''; |
|
87 | + } |
|
88 | + |
|
89 | + |
|
90 | + /** |
|
91 | + * Currency name singular |
|
92 | + * |
|
93 | + * @return string |
|
94 | + */ |
|
95 | + public function currency_name_single() |
|
96 | + { |
|
97 | + return $this->get('CNT_cur_single'); |
|
98 | + } |
|
99 | + |
|
100 | + |
|
101 | + /** |
|
102 | + * Currency name plural |
|
103 | + * |
|
104 | + * @return string |
|
105 | + */ |
|
106 | + public function currency_name_plural() |
|
107 | + { |
|
108 | + return $this->get('CNT_cur_plural'); |
|
109 | + } |
|
110 | + |
|
111 | + |
|
112 | + /** |
|
113 | + * currency_sign_before - ie: $TRUE or FALSE$ |
|
114 | + * |
|
115 | + * @return boolean |
|
116 | + */ |
|
117 | + public function currency_sign_before() |
|
118 | + { |
|
119 | + return $this->get('CNT_cur_sign_b4'); |
|
120 | + } |
|
121 | + |
|
122 | + |
|
123 | + /** |
|
124 | + * currency_decimal_places : 2 = 0.00 3 = 0.000 |
|
125 | + * |
|
126 | + * @return integer |
|
127 | + */ |
|
128 | + public function currency_decimal_places() |
|
129 | + { |
|
130 | + return $this->get('CNT_cur_dec_plc'); |
|
131 | + } |
|
132 | + |
|
133 | + |
|
134 | + /** |
|
135 | + * currency_decimal_mark : (comma) ',' = 0,01 or (decimal) '.' = 0.01 |
|
136 | + * |
|
137 | + * @return string |
|
138 | + */ |
|
139 | + public function currency_decimal_mark() |
|
140 | + { |
|
141 | + return $this->get('CNT_cur_dec_mrk'); |
|
142 | + } |
|
143 | + |
|
144 | + |
|
145 | + /** |
|
146 | + * currency thousands separator: (comma) ',' = 1,000 or (decimal) '.' = 1.000 |
|
147 | + * |
|
148 | + * @return string |
|
149 | + */ |
|
150 | + public function currency_thousands_separator() |
|
151 | + { |
|
152 | + return $this->get('CNT_cur_thsnds'); |
|
153 | + } |
|
154 | 154 | } |
@@ -20,95 +20,95 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * StateConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_State $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_State $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
23 | + /** |
|
24 | + * StateConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_State $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_State $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => 'RootQuery', |
|
41 | - 'toType' => $this->namespace . 'State', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'States', |
|
43 | - 'connectionTypeName' => "{$this->namespace}RootQueryStatesConnection", |
|
44 | - 'connectionArgs' => self::get_connection_args(), |
|
45 | - 'resolve' => [$this, 'resolveConnection'], |
|
46 | - ]; |
|
47 | - } |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => 'RootQuery', |
|
41 | + 'toType' => $this->namespace . 'State', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace) . 'States', |
|
43 | + 'connectionTypeName' => "{$this->namespace}RootQueryStatesConnection", |
|
44 | + 'connectionArgs' => self::get_connection_args(), |
|
45 | + 'resolve' => [$this, 'resolveConnection'], |
|
46 | + ]; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @param $entity |
|
52 | - * @param $args |
|
53 | - * @param $context |
|
54 | - * @param $info |
|
55 | - * @return StateConnectionResolver |
|
56 | - * @throws Exception |
|
57 | - */ |
|
58 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | - { |
|
60 | - return new StateConnectionResolver($entity, $args, $context, $info); |
|
61 | - } |
|
50 | + /** |
|
51 | + * @param $entity |
|
52 | + * @param $args |
|
53 | + * @param $context |
|
54 | + * @param $info |
|
55 | + * @return StateConnectionResolver |
|
56 | + * @throws Exception |
|
57 | + */ |
|
58 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | + { |
|
60 | + return new StateConnectionResolver($entity, $args, $context, $info); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Given an optional array of args, this returns the args to be used in the connection |
|
65 | - * |
|
66 | - * @param array $args The args to modify the defaults |
|
67 | - * @return array |
|
68 | - */ |
|
69 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | - public static function get_connection_args(array $args = []): array |
|
71 | - { |
|
72 | - $newArgs = [ |
|
73 | - 'orderby' => [ |
|
74 | - 'type' => ['list_of' => 'EspressoCountriesConnectionOrderbyInput'], |
|
75 | - 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
76 | - ], |
|
77 | - 'in' => [ |
|
78 | - 'type' => ['list_of' => 'ID'], |
|
79 | - 'description' => esc_html__( |
|
80 | - 'Limit the result to the set of given state IDs.', |
|
81 | - 'event_espresso' |
|
82 | - ), |
|
83 | - ], |
|
84 | - 'countryIsoIn' => [ |
|
85 | - 'type' => ['list_of' => 'String'], |
|
86 | - 'description' => esc_html__( |
|
87 | - 'Limit the result to the set of given country ISOs.', |
|
88 | - 'event_espresso' |
|
89 | - ), |
|
90 | - ], |
|
91 | - 'search' => [ |
|
92 | - 'type' => 'String', |
|
93 | - 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
94 | - ], |
|
95 | - 'activeOnly' => [ |
|
96 | - 'type' => 'Boolean', |
|
97 | - 'description' => esc_html__( |
|
98 | - 'Limit the result to the active states.', |
|
99 | - 'event_espresso' |
|
100 | - ), |
|
101 | - ], |
|
102 | - ]; |
|
63 | + /** |
|
64 | + * Given an optional array of args, this returns the args to be used in the connection |
|
65 | + * |
|
66 | + * @param array $args The args to modify the defaults |
|
67 | + * @return array |
|
68 | + */ |
|
69 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | + public static function get_connection_args(array $args = []): array |
|
71 | + { |
|
72 | + $newArgs = [ |
|
73 | + 'orderby' => [ |
|
74 | + 'type' => ['list_of' => 'EspressoCountriesConnectionOrderbyInput'], |
|
75 | + 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
76 | + ], |
|
77 | + 'in' => [ |
|
78 | + 'type' => ['list_of' => 'ID'], |
|
79 | + 'description' => esc_html__( |
|
80 | + 'Limit the result to the set of given state IDs.', |
|
81 | + 'event_espresso' |
|
82 | + ), |
|
83 | + ], |
|
84 | + 'countryIsoIn' => [ |
|
85 | + 'type' => ['list_of' => 'String'], |
|
86 | + 'description' => esc_html__( |
|
87 | + 'Limit the result to the set of given country ISOs.', |
|
88 | + 'event_espresso' |
|
89 | + ), |
|
90 | + ], |
|
91 | + 'search' => [ |
|
92 | + 'type' => 'String', |
|
93 | + 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
94 | + ], |
|
95 | + 'activeOnly' => [ |
|
96 | + 'type' => 'Boolean', |
|
97 | + 'description' => esc_html__( |
|
98 | + 'Limit the result to the active states.', |
|
99 | + 'event_espresso' |
|
100 | + ), |
|
101 | + ], |
|
102 | + ]; |
|
103 | 103 | |
104 | - $newArgs = apply_filters( |
|
105 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__state_args', |
|
106 | - $newArgs, |
|
107 | - $args |
|
108 | - ); |
|
109 | - return array_merge( |
|
110 | - $newArgs, |
|
111 | - $args |
|
112 | - ); |
|
113 | - } |
|
104 | + $newArgs = apply_filters( |
|
105 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__state_args', |
|
106 | + $newArgs, |
|
107 | + $args |
|
108 | + ); |
|
109 | + return array_merge( |
|
110 | + $newArgs, |
|
111 | + $args |
|
112 | + ); |
|
113 | + } |
|
114 | 114 | } |
@@ -38,8 +38,8 @@ |
||
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'fromType' => 'RootQuery', |
41 | - 'toType' => $this->namespace . 'State', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'States', |
|
41 | + 'toType' => $this->namespace.'State', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace).'States', |
|
43 | 43 | 'connectionTypeName' => "{$this->namespace}RootQueryStatesConnection", |
44 | 44 | 'connectionArgs' => self::get_connection_args(), |
45 | 45 | 'resolve' => [$this, 'resolveConnection'], |
@@ -20,105 +20,105 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * CountryConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_Country $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Country $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
23 | + /** |
|
24 | + * CountryConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_Country $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Country $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => 'RootQuery', |
|
41 | - 'toType' => $this->namespace . 'Country', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace . 'Countries'), |
|
43 | - 'connectionTypeName' => "{$this->namespace}RootQueryCountriesConnection", |
|
44 | - 'connectionArgs' => RootQueryCountriesConnection::get_connection_args(), |
|
45 | - 'resolve' => [$this, 'resolveConnection'], |
|
46 | - ]; |
|
47 | - } |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => 'RootQuery', |
|
41 | + 'toType' => $this->namespace . 'Country', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace . 'Countries'), |
|
43 | + 'connectionTypeName' => "{$this->namespace}RootQueryCountriesConnection", |
|
44 | + 'connectionArgs' => RootQueryCountriesConnection::get_connection_args(), |
|
45 | + 'resolve' => [$this, 'resolveConnection'], |
|
46 | + ]; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @param $entity |
|
52 | - * @param $args |
|
53 | - * @param $context |
|
54 | - * @param $info |
|
55 | - * @return CountryConnectionResolver |
|
56 | - * @throws Exception |
|
57 | - */ |
|
58 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | - { |
|
60 | - return new CountryConnectionResolver($entity, $args, $context, $info); |
|
61 | - } |
|
50 | + /** |
|
51 | + * @param $entity |
|
52 | + * @param $args |
|
53 | + * @param $context |
|
54 | + * @param $info |
|
55 | + * @return CountryConnectionResolver |
|
56 | + * @throws Exception |
|
57 | + */ |
|
58 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | + { |
|
60 | + return new CountryConnectionResolver($entity, $args, $context, $info); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Given an optional array of args, this returns the args to be used in the connection |
|
65 | - * |
|
66 | - * @param array $args The args to modify the defaults |
|
67 | - * @return array |
|
68 | - */ |
|
69 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | - public static function get_connection_args(array $args = []): array |
|
71 | - { |
|
72 | - $newArgs = [ |
|
73 | - 'orderby' => [ |
|
74 | - 'type' => ['list_of' => 'EspressoCountriesConnectionOrderbyInput'], |
|
75 | - 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
76 | - ], |
|
77 | - 'in' => [ |
|
78 | - 'type' => ['list_of' => 'ID'], |
|
79 | - 'description' => esc_html__( |
|
80 | - 'Limit the result to the set of given country IDs.', |
|
81 | - 'event_espresso' |
|
82 | - ), |
|
83 | - ], |
|
84 | - 'isoIn' => [ |
|
85 | - 'type' => ['list_of' => 'String'], |
|
86 | - 'description' => esc_html__( |
|
87 | - 'Limit the result to the set of given country ISOs.', |
|
88 | - 'event_espresso' |
|
89 | - ), |
|
90 | - ], |
|
91 | - 'iso3In' => [ |
|
92 | - 'type' => ['list_of' => 'String'], |
|
93 | - 'description' => esc_html__( |
|
94 | - 'Limit the result to the set of given country ISO3s.', |
|
95 | - 'event_espresso' |
|
96 | - ), |
|
97 | - ], |
|
98 | - 'search' => [ |
|
99 | - 'type' => 'String', |
|
100 | - 'description' => esc_html__( |
|
101 | - 'Limit the result to the given search query.', |
|
102 | - 'event_espresso' |
|
103 | - ), |
|
104 | - ], |
|
105 | - 'activeOnly' => [ |
|
106 | - 'type' => 'Boolean', |
|
107 | - 'description' => esc_html__( |
|
108 | - 'Limit the result to the active countries.', |
|
109 | - 'event_espresso' |
|
110 | - ), |
|
111 | - ], |
|
112 | - ]; |
|
63 | + /** |
|
64 | + * Given an optional array of args, this returns the args to be used in the connection |
|
65 | + * |
|
66 | + * @param array $args The args to modify the defaults |
|
67 | + * @return array |
|
68 | + */ |
|
69 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | + public static function get_connection_args(array $args = []): array |
|
71 | + { |
|
72 | + $newArgs = [ |
|
73 | + 'orderby' => [ |
|
74 | + 'type' => ['list_of' => 'EspressoCountriesConnectionOrderbyInput'], |
|
75 | + 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
76 | + ], |
|
77 | + 'in' => [ |
|
78 | + 'type' => ['list_of' => 'ID'], |
|
79 | + 'description' => esc_html__( |
|
80 | + 'Limit the result to the set of given country IDs.', |
|
81 | + 'event_espresso' |
|
82 | + ), |
|
83 | + ], |
|
84 | + 'isoIn' => [ |
|
85 | + 'type' => ['list_of' => 'String'], |
|
86 | + 'description' => esc_html__( |
|
87 | + 'Limit the result to the set of given country ISOs.', |
|
88 | + 'event_espresso' |
|
89 | + ), |
|
90 | + ], |
|
91 | + 'iso3In' => [ |
|
92 | + 'type' => ['list_of' => 'String'], |
|
93 | + 'description' => esc_html__( |
|
94 | + 'Limit the result to the set of given country ISO3s.', |
|
95 | + 'event_espresso' |
|
96 | + ), |
|
97 | + ], |
|
98 | + 'search' => [ |
|
99 | + 'type' => 'String', |
|
100 | + 'description' => esc_html__( |
|
101 | + 'Limit the result to the given search query.', |
|
102 | + 'event_espresso' |
|
103 | + ), |
|
104 | + ], |
|
105 | + 'activeOnly' => [ |
|
106 | + 'type' => 'Boolean', |
|
107 | + 'description' => esc_html__( |
|
108 | + 'Limit the result to the active countries.', |
|
109 | + 'event_espresso' |
|
110 | + ), |
|
111 | + ], |
|
112 | + ]; |
|
113 | 113 | |
114 | - $newArgs = apply_filters( |
|
115 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__country_args', |
|
116 | - $newArgs, |
|
117 | - $args |
|
118 | - ); |
|
119 | - return array_merge( |
|
120 | - $newArgs, |
|
121 | - $args |
|
122 | - ); |
|
123 | - } |
|
114 | + $newArgs = apply_filters( |
|
115 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__country_args', |
|
116 | + $newArgs, |
|
117 | + $args |
|
118 | + ); |
|
119 | + return array_merge( |
|
120 | + $newArgs, |
|
121 | + $args |
|
122 | + ); |
|
123 | + } |
|
124 | 124 | } |
@@ -38,8 +38,8 @@ |
||
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'fromType' => 'RootQuery', |
41 | - 'toType' => $this->namespace . 'Country', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace . 'Countries'), |
|
41 | + 'toType' => $this->namespace.'Country', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace.'Countries'), |
|
43 | 43 | 'connectionTypeName' => "{$this->namespace}RootQueryCountriesConnection", |
44 | 44 | 'connectionArgs' => RootQueryCountriesConnection::get_connection_args(), |
45 | 45 | 'resolve' => [$this, 'resolveConnection'], |
@@ -17,31 +17,31 @@ |
||
17 | 17 | class StatesConnectionOrderbyInput extends InputBase |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * StatesConnectionOrderbyInput constructor. |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
25 | - $this->setName($this->namespace . 'StatesConnectionOrderbyInput'); |
|
26 | - $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
|
27 | - parent::__construct(); |
|
28 | - } |
|
20 | + /** |
|
21 | + * StatesConnectionOrderbyInput constructor. |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | + $this->setName($this->namespace . 'StatesConnectionOrderbyInput'); |
|
26 | + $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
|
27 | + parent::__construct(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * @return GraphQLFieldInterface[] |
|
33 | - */ |
|
34 | - protected function getFields(): array |
|
35 | - { |
|
36 | - return [ |
|
37 | - new GraphQLField( |
|
38 | - 'field', |
|
39 | - ['non_null' => $this->namespace . 'StatesConnectionOrderbyEnum'] |
|
40 | - ), |
|
41 | - new GraphQLField( |
|
42 | - 'order', |
|
43 | - 'OrderEnum' |
|
44 | - ), |
|
45 | - ]; |
|
46 | - } |
|
31 | + /** |
|
32 | + * @return GraphQLFieldInterface[] |
|
33 | + */ |
|
34 | + protected function getFields(): array |
|
35 | + { |
|
36 | + return [ |
|
37 | + new GraphQLField( |
|
38 | + 'field', |
|
39 | + ['non_null' => $this->namespace . 'StatesConnectionOrderbyEnum'] |
|
40 | + ), |
|
41 | + new GraphQLField( |
|
42 | + 'order', |
|
43 | + 'OrderEnum' |
|
44 | + ), |
|
45 | + ]; |
|
46 | + } |
|
47 | 47 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function __construct() |
24 | 24 | { |
25 | - $this->setName($this->namespace . 'StatesConnectionOrderbyInput'); |
|
25 | + $this->setName($this->namespace.'StatesConnectionOrderbyInput'); |
|
26 | 26 | $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
27 | 27 | parent::__construct(); |
28 | 28 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | return [ |
37 | 37 | new GraphQLField( |
38 | 38 | 'field', |
39 | - ['non_null' => $this->namespace . 'StatesConnectionOrderbyEnum'] |
|
39 | + ['non_null' => $this->namespace.'StatesConnectionOrderbyEnum'] |
|
40 | 40 | ), |
41 | 41 | new GraphQLField( |
42 | 42 | 'order', |
@@ -17,31 +17,31 @@ |
||
17 | 17 | class CountriesConnectionOrderbyInput extends InputBase |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * CountriesConnectionOrderbyInput constructor. |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
25 | - $this->setName($this->namespace . 'CountriesConnectionOrderbyInput'); |
|
26 | - $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
|
27 | - parent::__construct(); |
|
28 | - } |
|
20 | + /** |
|
21 | + * CountriesConnectionOrderbyInput constructor. |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | + $this->setName($this->namespace . 'CountriesConnectionOrderbyInput'); |
|
26 | + $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
|
27 | + parent::__construct(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * @return GraphQLFieldInterface[] |
|
33 | - */ |
|
34 | - protected function getFields(): array |
|
35 | - { |
|
36 | - return [ |
|
37 | - new GraphQLField( |
|
38 | - 'field', |
|
39 | - ['non_null' => $this->namespace . 'CountriesConnectionOrderbyEnum'] |
|
40 | - ), |
|
41 | - new GraphQLField( |
|
42 | - 'order', |
|
43 | - 'OrderEnum' |
|
44 | - ), |
|
45 | - ]; |
|
46 | - } |
|
31 | + /** |
|
32 | + * @return GraphQLFieldInterface[] |
|
33 | + */ |
|
34 | + protected function getFields(): array |
|
35 | + { |
|
36 | + return [ |
|
37 | + new GraphQLField( |
|
38 | + 'field', |
|
39 | + ['non_null' => $this->namespace . 'CountriesConnectionOrderbyEnum'] |
|
40 | + ), |
|
41 | + new GraphQLField( |
|
42 | + 'order', |
|
43 | + 'OrderEnum' |
|
44 | + ), |
|
45 | + ]; |
|
46 | + } |
|
47 | 47 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function __construct() |
24 | 24 | { |
25 | - $this->setName($this->namespace . 'CountriesConnectionOrderbyInput'); |
|
25 | + $this->setName($this->namespace.'CountriesConnectionOrderbyInput'); |
|
26 | 26 | $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso')); |
27 | 27 | parent::__construct(); |
28 | 28 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | return [ |
37 | 37 | new GraphQLField( |
38 | 38 | 'field', |
39 | - ['non_null' => $this->namespace . 'CountriesConnectionOrderbyEnum'] |
|
39 | + ['non_null' => $this->namespace.'CountriesConnectionOrderbyEnum'] |
|
40 | 40 | ), |
41 | 41 | new GraphQLField( |
42 | 42 | 'order', |
@@ -15,28 +15,28 @@ |
||
15 | 15 | */ |
16 | 16 | class CountryLoader extends AbstractLoader |
17 | 17 | { |
18 | - /** |
|
19 | - * @return EEM_Base|EEM_Country |
|
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_Country::instance(); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @return EEM_Base|EEM_Country |
|
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_Country::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 | - 'CNT_ISO' => ['IN', $keys], |
|
40 | - ]; |
|
41 | - } |
|
32 | + /** |
|
33 | + * @param array $keys |
|
34 | + * @return array |
|
35 | + */ |
|
36 | + protected function getWhereParams(array $keys): array |
|
37 | + { |
|
38 | + return [ |
|
39 | + 'CNT_ISO' => ['IN', $keys], |
|
40 | + ]; |
|
41 | + } |
|
42 | 42 | } |
@@ -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 | } |
@@ -20,120 +20,120 @@ |
||
20 | 20 | class Country extends TypeBase |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * Country constructor. |
|
25 | - * |
|
26 | - * @param EEM_Country $country_model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Country $country_model) |
|
29 | - { |
|
30 | - $this->setName($this->namespace . 'Country'); |
|
31 | - $this->setDescription(__('A country', 'event_espresso')); |
|
32 | - $this->setIsCustomPostType(false); |
|
33 | - parent::__construct($country_model); |
|
34 | - } |
|
23 | + /** |
|
24 | + * Country constructor. |
|
25 | + * |
|
26 | + * @param EEM_Country $country_model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Country $country_model) |
|
29 | + { |
|
30 | + $this->setName($this->namespace . 'Country'); |
|
31 | + $this->setDescription(__('A country', 'event_espresso')); |
|
32 | + $this->setIsCustomPostType(false); |
|
33 | + parent::__construct($country_model); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * @return GraphQLFieldInterface[] |
|
39 | - */ |
|
40 | - public function getFields(): array |
|
41 | - { |
|
42 | - $fields = [ |
|
43 | - new GraphQLField( |
|
44 | - 'id', |
|
45 | - ['non_null' => 'ID'], |
|
46 | - null, |
|
47 | - esc_html__('The globally unique ID for the object.', 'event_espresso') |
|
48 | - ), |
|
49 | - new GraphQLOutputField( |
|
50 | - 'cacheId', |
|
51 | - ['non_null' => 'String'], |
|
52 | - null, |
|
53 | - esc_html__('The cache ID of the object.', 'event_espresso') |
|
54 | - ), |
|
55 | - new GraphQLField( |
|
56 | - 'isActive', |
|
57 | - 'Boolean', |
|
58 | - 'is_active', |
|
59 | - esc_html__( |
|
60 | - 'Flag that indicates if the country should appear in dropdown select lists', |
|
61 | - 'event_espresso' |
|
62 | - ) |
|
63 | - ), |
|
64 | - new GraphQLField( |
|
65 | - 'ISO', |
|
66 | - 'String', |
|
67 | - 'ID', |
|
68 | - esc_html__('Country ISO Code', 'event_espresso') |
|
69 | - ), |
|
70 | - new GraphQLField( |
|
71 | - 'ISO3', |
|
72 | - 'String', |
|
73 | - 'ISO3', |
|
74 | - esc_html__('Country ISO3 Code', 'event_espresso') |
|
75 | - ), |
|
76 | - new GraphQLField( |
|
77 | - 'name', |
|
78 | - 'String', |
|
79 | - 'name', |
|
80 | - esc_html__('Country Name', 'event_espresso') |
|
81 | - ), |
|
82 | - new GraphQLField( |
|
83 | - 'currencyCode', |
|
84 | - 'String', |
|
85 | - 'currency_code', |
|
86 | - esc_html__('Country Currency Code', 'event_espresso') |
|
87 | - ), |
|
88 | - new GraphQLField( |
|
89 | - 'currencySingular', |
|
90 | - 'String', |
|
91 | - 'currency_name_single', |
|
92 | - esc_html__('Currency Name Singular', 'event_espresso') |
|
93 | - ), |
|
94 | - new GraphQLField( |
|
95 | - 'currencyPlural', |
|
96 | - 'String', |
|
97 | - 'currency_name_plural', |
|
98 | - esc_html__('Currency Name Plural', 'event_espresso') |
|
99 | - ), |
|
100 | - new GraphQLField( |
|
101 | - 'currencySign', |
|
102 | - 'String', |
|
103 | - 'currency_sign', |
|
104 | - __('Currency Sign', 'event_espresso') |
|
105 | - ), |
|
106 | - new GraphQLField( |
|
107 | - 'currencySignBeforeNumber', |
|
108 | - 'String', |
|
109 | - 'currency_sign_before', |
|
110 | - esc_html__('Currency Sign Before Number', 'event_espresso') |
|
111 | - ), |
|
112 | - new GraphQLField( |
|
113 | - 'currencyDecimalPlaces', |
|
114 | - 'String', |
|
115 | - 'currency_decimal_places', |
|
116 | - esc_html__('Currency Decimal Places', 'event_espresso') |
|
117 | - ), |
|
118 | - new GraphQLField( |
|
119 | - 'currencyDecimalMark', |
|
120 | - 'String', |
|
121 | - 'currency_decimal_mark', |
|
122 | - esc_html__('Currency Decimal Mark', 'event_espresso') |
|
123 | - ), |
|
124 | - new GraphQLField( |
|
125 | - 'currencyThousandsSeparator', |
|
126 | - 'String', |
|
127 | - 'currency_thousands_separator', |
|
128 | - esc_html__('Currency Thousands Separator', 'event_espresso') |
|
129 | - ), |
|
130 | - ]; |
|
37 | + /** |
|
38 | + * @return GraphQLFieldInterface[] |
|
39 | + */ |
|
40 | + public function getFields(): array |
|
41 | + { |
|
42 | + $fields = [ |
|
43 | + new GraphQLField( |
|
44 | + 'id', |
|
45 | + ['non_null' => 'ID'], |
|
46 | + null, |
|
47 | + esc_html__('The globally unique ID for the object.', 'event_espresso') |
|
48 | + ), |
|
49 | + new GraphQLOutputField( |
|
50 | + 'cacheId', |
|
51 | + ['non_null' => 'String'], |
|
52 | + null, |
|
53 | + esc_html__('The cache ID of the object.', 'event_espresso') |
|
54 | + ), |
|
55 | + new GraphQLField( |
|
56 | + 'isActive', |
|
57 | + 'Boolean', |
|
58 | + 'is_active', |
|
59 | + esc_html__( |
|
60 | + 'Flag that indicates if the country should appear in dropdown select lists', |
|
61 | + 'event_espresso' |
|
62 | + ) |
|
63 | + ), |
|
64 | + new GraphQLField( |
|
65 | + 'ISO', |
|
66 | + 'String', |
|
67 | + 'ID', |
|
68 | + esc_html__('Country ISO Code', 'event_espresso') |
|
69 | + ), |
|
70 | + new GraphQLField( |
|
71 | + 'ISO3', |
|
72 | + 'String', |
|
73 | + 'ISO3', |
|
74 | + esc_html__('Country ISO3 Code', 'event_espresso') |
|
75 | + ), |
|
76 | + new GraphQLField( |
|
77 | + 'name', |
|
78 | + 'String', |
|
79 | + 'name', |
|
80 | + esc_html__('Country Name', 'event_espresso') |
|
81 | + ), |
|
82 | + new GraphQLField( |
|
83 | + 'currencyCode', |
|
84 | + 'String', |
|
85 | + 'currency_code', |
|
86 | + esc_html__('Country Currency Code', 'event_espresso') |
|
87 | + ), |
|
88 | + new GraphQLField( |
|
89 | + 'currencySingular', |
|
90 | + 'String', |
|
91 | + 'currency_name_single', |
|
92 | + esc_html__('Currency Name Singular', 'event_espresso') |
|
93 | + ), |
|
94 | + new GraphQLField( |
|
95 | + 'currencyPlural', |
|
96 | + 'String', |
|
97 | + 'currency_name_plural', |
|
98 | + esc_html__('Currency Name Plural', 'event_espresso') |
|
99 | + ), |
|
100 | + new GraphQLField( |
|
101 | + 'currencySign', |
|
102 | + 'String', |
|
103 | + 'currency_sign', |
|
104 | + __('Currency Sign', 'event_espresso') |
|
105 | + ), |
|
106 | + new GraphQLField( |
|
107 | + 'currencySignBeforeNumber', |
|
108 | + 'String', |
|
109 | + 'currency_sign_before', |
|
110 | + esc_html__('Currency Sign Before Number', 'event_espresso') |
|
111 | + ), |
|
112 | + new GraphQLField( |
|
113 | + 'currencyDecimalPlaces', |
|
114 | + 'String', |
|
115 | + 'currency_decimal_places', |
|
116 | + esc_html__('Currency Decimal Places', 'event_espresso') |
|
117 | + ), |
|
118 | + new GraphQLField( |
|
119 | + 'currencyDecimalMark', |
|
120 | + 'String', |
|
121 | + 'currency_decimal_mark', |
|
122 | + esc_html__('Currency Decimal Mark', 'event_espresso') |
|
123 | + ), |
|
124 | + new GraphQLField( |
|
125 | + 'currencyThousandsSeparator', |
|
126 | + 'String', |
|
127 | + 'currency_thousands_separator', |
|
128 | + esc_html__('Currency Thousands Separator', 'event_espresso') |
|
129 | + ), |
|
130 | + ]; |
|
131 | 131 | |
132 | - return apply_filters( |
|
133 | - 'FHEE__EventEspresso_core_domain_services_graphql_types__country_fields', |
|
134 | - $fields, |
|
135 | - $this->name, |
|
136 | - $this->model |
|
137 | - ); |
|
138 | - } |
|
132 | + return apply_filters( |
|
133 | + 'FHEE__EventEspresso_core_domain_services_graphql_types__country_fields', |
|
134 | + $fields, |
|
135 | + $this->name, |
|
136 | + $this->model |
|
137 | + ); |
|
138 | + } |
|
139 | 139 | } |