@@ -35,211 +35,211 @@ |
||
35 | 35 | class Event extends TypeBase |
36 | 36 | { |
37 | 37 | |
38 | - /** |
|
39 | - * Event constructor. |
|
40 | - * |
|
41 | - * @param EEM_Event $event_model |
|
42 | - */ |
|
43 | - public function __construct(EEM_Event $event_model) |
|
44 | - { |
|
45 | - $this->model = $event_model; |
|
46 | - $this->setName('Event'); |
|
47 | - $this->setIsCustomPostType(true); |
|
38 | + /** |
|
39 | + * Event constructor. |
|
40 | + * |
|
41 | + * @param EEM_Event $event_model |
|
42 | + */ |
|
43 | + public function __construct(EEM_Event $event_model) |
|
44 | + { |
|
45 | + $this->model = $event_model; |
|
46 | + $this->setName('Event'); |
|
47 | + $this->setIsCustomPostType(true); |
|
48 | 48 | |
49 | - parent::__construct(); |
|
50 | - } |
|
49 | + parent::__construct(); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | - /** |
|
54 | - * @return array |
|
55 | - * @since $VID:$ |
|
56 | - */ |
|
57 | - public function getFields() |
|
58 | - { |
|
59 | - return [ |
|
60 | - new GraphQLField( |
|
61 | - 'name', |
|
62 | - [ |
|
63 | - 'key' => 'name', |
|
64 | - 'type' => 'String', |
|
65 | - 'description' => __('Event Name', 'event_espresso'), |
|
66 | - ] |
|
67 | - ), |
|
68 | - new GraphQLField( |
|
69 | - 'desc', |
|
70 | - [ |
|
71 | - 'key' => 'description', |
|
72 | - 'type' => 'String', |
|
73 | - 'description' => __('Event Description', 'event_espresso'), |
|
74 | - ] |
|
75 | - ), |
|
76 | - new GraphQLField( |
|
77 | - 'shortDesc', |
|
78 | - [ |
|
79 | - 'key' => 'short_description', |
|
80 | - 'type' => 'String', |
|
81 | - 'description' => __('Event Short Description', 'event_espresso'), |
|
82 | - ] |
|
83 | - ), |
|
84 | - new GraphQLField( |
|
85 | - 'created', |
|
86 | - [ |
|
87 | - 'key' => 'created', |
|
88 | - 'type' => 'String', |
|
89 | - 'description' => __('Date/Time Event Created', 'event_espresso'), |
|
90 | - ] |
|
91 | - ), |
|
92 | - new GraphQLField( |
|
93 | - 'wpUser', |
|
94 | - [ |
|
95 | - 'type' => 'User', |
|
96 | - 'description' => __('Event Creator', 'event_espresso'), |
|
97 | - ] |
|
98 | - ), |
|
99 | - new GraphQLField( |
|
100 | - 'order', |
|
101 | - [ |
|
102 | - 'key' => 'order', |
|
103 | - 'type' => 'Int', |
|
104 | - 'description' => __('Event Menu Order', 'event_espresso'), |
|
105 | - ] |
|
106 | - ), |
|
107 | - new GraphQLField( |
|
108 | - 'displayDesc', |
|
109 | - [ |
|
110 | - 'key' => 'display_description', |
|
111 | - 'type' => 'Boolean', |
|
112 | - 'description' => __('Display Description Flag', 'event_espresso'), |
|
113 | - ] |
|
114 | - ), |
|
115 | - new GraphQLField( |
|
116 | - 'displayTicketSelector', |
|
117 | - [ |
|
118 | - 'key' => 'display_ticket_selector', |
|
119 | - 'type' => 'Boolean', |
|
120 | - 'description' => __('Display Ticket Selector Flag', 'event_espresso'), |
|
121 | - ] |
|
122 | - ), |
|
123 | - new GraphQLField( |
|
124 | - 'visibleOn', |
|
125 | - [ |
|
126 | - 'key' => 'visible_on', |
|
127 | - 'type' => 'String', |
|
128 | - 'description' => __('Event Visible Date', 'event_espresso'), |
|
129 | - ] |
|
130 | - ), |
|
131 | - new GraphQLField( |
|
132 | - 'additionalLimit', |
|
133 | - [ |
|
134 | - 'key' => 'additional_limit', |
|
135 | - 'type' => 'String', |
|
136 | - 'description' => __('Limit of Additional Registrations on Same Transaction', 'event_espresso'), |
|
137 | - ] |
|
138 | - ), |
|
139 | - new GraphQLField( |
|
140 | - 'phone', |
|
141 | - [ |
|
142 | - 'key' => 'phone', |
|
143 | - 'type' => 'String', |
|
144 | - 'description' => __('Event Phone Number', 'event_espresso'), |
|
145 | - ] |
|
146 | - ), |
|
147 | - new GraphQLField( |
|
148 | - 'memberOnly', |
|
149 | - [ |
|
150 | - 'key' => 'member_only', |
|
151 | - 'type' => 'Boolean', |
|
152 | - 'description' => __('Member-Only Event Flag', 'event_espresso'), |
|
153 | - ] |
|
154 | - ), |
|
155 | - new GraphQLField( |
|
156 | - 'allowOverflow', |
|
157 | - [ |
|
158 | - 'key' => 'allow_overflow', |
|
159 | - 'type' => 'Boolean', |
|
160 | - 'description' => __('Allow Overflow on Event', 'event_espresso'), |
|
161 | - ] |
|
162 | - ), |
|
163 | - new GraphQLField( |
|
164 | - 'timezoneString', |
|
165 | - [ |
|
166 | - 'key' => 'timezone_string', |
|
167 | - 'type' => 'String', |
|
168 | - 'description' => __('Timezone (name) for Event times', 'event_espresso'), |
|
169 | - ] |
|
170 | - ), |
|
171 | - new GraphQLField( |
|
172 | - 'externalUrl', |
|
173 | - [ |
|
174 | - 'key' => 'external_url', |
|
175 | - 'type' => 'String', |
|
176 | - 'description' => __('URL of Event Page if hosted elsewhere', 'event_espresso'), |
|
177 | - ] |
|
178 | - ), |
|
179 | - new GraphQLField( |
|
180 | - 'donations', |
|
181 | - [ |
|
182 | - 'key' => 'donations', |
|
183 | - 'type' => 'Boolean', |
|
184 | - 'description' => __('Accept Donations?', 'event_espresso'), |
|
185 | - ] |
|
186 | - ), |
|
187 | - new GraphQLField( |
|
188 | - 'isSoldOut', |
|
189 | - [ |
|
190 | - 'key' => 'is_sold_out', |
|
191 | - 'type' => 'Boolean', |
|
192 | - 'description' => __('Flag indicating whether the tickets sold for the event, met or exceed the registration limit', 'event_espresso'), |
|
193 | - ] |
|
194 | - ), |
|
195 | - new GraphQLField( |
|
196 | - 'isPostponed', |
|
197 | - [ |
|
198 | - 'key' => 'is_postponed', |
|
199 | - 'type' => 'Boolean', |
|
200 | - 'description' => __('Flag indicating whether the event is marked as postponed', 'event_espresso'), |
|
201 | - ] |
|
202 | - ), |
|
203 | - new GraphQLField( |
|
204 | - 'isCancelled', |
|
205 | - [ |
|
206 | - 'key' => 'is_cancelled', |
|
207 | - 'type' => 'Boolean', |
|
208 | - 'description' => __('Flag indicating whether the event is marked as cancelled', 'event_espresso'), |
|
209 | - ] |
|
210 | - ), |
|
211 | - new GraphQLField( |
|
212 | - 'isUpcoming', |
|
213 | - [ |
|
214 | - 'key' => 'is_upcoming', |
|
215 | - 'type' => 'Boolean', |
|
216 | - 'description' => __('Whether the event is upcoming', 'event_espresso'), |
|
217 | - ] |
|
218 | - ), |
|
219 | - new GraphQLField( |
|
220 | - 'isActive', |
|
221 | - [ |
|
222 | - 'key' => 'is_active', |
|
223 | - 'type' => 'Boolean', |
|
224 | - 'description' => __('Flag indicating event is active', 'event_espresso'), |
|
225 | - ] |
|
226 | - ), |
|
227 | - new GraphQLField( |
|
228 | - 'isInactive', |
|
229 | - [ |
|
230 | - 'key' => 'is_inactive', |
|
231 | - 'type' => 'Boolean', |
|
232 | - 'description' => __('Flag indicating event is inactive', 'event_espresso'), |
|
233 | - ] |
|
234 | - ), |
|
235 | - new GraphQLField( |
|
236 | - 'isExpired', |
|
237 | - [ |
|
238 | - 'key' => 'is_expired', |
|
239 | - 'type' => 'Boolean', |
|
240 | - 'description' => __('Flag indicating event is expired or not', 'event_espresso'), |
|
241 | - ] |
|
242 | - ), |
|
243 | - ]; |
|
244 | - } |
|
53 | + /** |
|
54 | + * @return array |
|
55 | + * @since $VID:$ |
|
56 | + */ |
|
57 | + public function getFields() |
|
58 | + { |
|
59 | + return [ |
|
60 | + new GraphQLField( |
|
61 | + 'name', |
|
62 | + [ |
|
63 | + 'key' => 'name', |
|
64 | + 'type' => 'String', |
|
65 | + 'description' => __('Event Name', 'event_espresso'), |
|
66 | + ] |
|
67 | + ), |
|
68 | + new GraphQLField( |
|
69 | + 'desc', |
|
70 | + [ |
|
71 | + 'key' => 'description', |
|
72 | + 'type' => 'String', |
|
73 | + 'description' => __('Event Description', 'event_espresso'), |
|
74 | + ] |
|
75 | + ), |
|
76 | + new GraphQLField( |
|
77 | + 'shortDesc', |
|
78 | + [ |
|
79 | + 'key' => 'short_description', |
|
80 | + 'type' => 'String', |
|
81 | + 'description' => __('Event Short Description', 'event_espresso'), |
|
82 | + ] |
|
83 | + ), |
|
84 | + new GraphQLField( |
|
85 | + 'created', |
|
86 | + [ |
|
87 | + 'key' => 'created', |
|
88 | + 'type' => 'String', |
|
89 | + 'description' => __('Date/Time Event Created', 'event_espresso'), |
|
90 | + ] |
|
91 | + ), |
|
92 | + new GraphQLField( |
|
93 | + 'wpUser', |
|
94 | + [ |
|
95 | + 'type' => 'User', |
|
96 | + 'description' => __('Event Creator', 'event_espresso'), |
|
97 | + ] |
|
98 | + ), |
|
99 | + new GraphQLField( |
|
100 | + 'order', |
|
101 | + [ |
|
102 | + 'key' => 'order', |
|
103 | + 'type' => 'Int', |
|
104 | + 'description' => __('Event Menu Order', 'event_espresso'), |
|
105 | + ] |
|
106 | + ), |
|
107 | + new GraphQLField( |
|
108 | + 'displayDesc', |
|
109 | + [ |
|
110 | + 'key' => 'display_description', |
|
111 | + 'type' => 'Boolean', |
|
112 | + 'description' => __('Display Description Flag', 'event_espresso'), |
|
113 | + ] |
|
114 | + ), |
|
115 | + new GraphQLField( |
|
116 | + 'displayTicketSelector', |
|
117 | + [ |
|
118 | + 'key' => 'display_ticket_selector', |
|
119 | + 'type' => 'Boolean', |
|
120 | + 'description' => __('Display Ticket Selector Flag', 'event_espresso'), |
|
121 | + ] |
|
122 | + ), |
|
123 | + new GraphQLField( |
|
124 | + 'visibleOn', |
|
125 | + [ |
|
126 | + 'key' => 'visible_on', |
|
127 | + 'type' => 'String', |
|
128 | + 'description' => __('Event Visible Date', 'event_espresso'), |
|
129 | + ] |
|
130 | + ), |
|
131 | + new GraphQLField( |
|
132 | + 'additionalLimit', |
|
133 | + [ |
|
134 | + 'key' => 'additional_limit', |
|
135 | + 'type' => 'String', |
|
136 | + 'description' => __('Limit of Additional Registrations on Same Transaction', 'event_espresso'), |
|
137 | + ] |
|
138 | + ), |
|
139 | + new GraphQLField( |
|
140 | + 'phone', |
|
141 | + [ |
|
142 | + 'key' => 'phone', |
|
143 | + 'type' => 'String', |
|
144 | + 'description' => __('Event Phone Number', 'event_espresso'), |
|
145 | + ] |
|
146 | + ), |
|
147 | + new GraphQLField( |
|
148 | + 'memberOnly', |
|
149 | + [ |
|
150 | + 'key' => 'member_only', |
|
151 | + 'type' => 'Boolean', |
|
152 | + 'description' => __('Member-Only Event Flag', 'event_espresso'), |
|
153 | + ] |
|
154 | + ), |
|
155 | + new GraphQLField( |
|
156 | + 'allowOverflow', |
|
157 | + [ |
|
158 | + 'key' => 'allow_overflow', |
|
159 | + 'type' => 'Boolean', |
|
160 | + 'description' => __('Allow Overflow on Event', 'event_espresso'), |
|
161 | + ] |
|
162 | + ), |
|
163 | + new GraphQLField( |
|
164 | + 'timezoneString', |
|
165 | + [ |
|
166 | + 'key' => 'timezone_string', |
|
167 | + 'type' => 'String', |
|
168 | + 'description' => __('Timezone (name) for Event times', 'event_espresso'), |
|
169 | + ] |
|
170 | + ), |
|
171 | + new GraphQLField( |
|
172 | + 'externalUrl', |
|
173 | + [ |
|
174 | + 'key' => 'external_url', |
|
175 | + 'type' => 'String', |
|
176 | + 'description' => __('URL of Event Page if hosted elsewhere', 'event_espresso'), |
|
177 | + ] |
|
178 | + ), |
|
179 | + new GraphQLField( |
|
180 | + 'donations', |
|
181 | + [ |
|
182 | + 'key' => 'donations', |
|
183 | + 'type' => 'Boolean', |
|
184 | + 'description' => __('Accept Donations?', 'event_espresso'), |
|
185 | + ] |
|
186 | + ), |
|
187 | + new GraphQLField( |
|
188 | + 'isSoldOut', |
|
189 | + [ |
|
190 | + 'key' => 'is_sold_out', |
|
191 | + 'type' => 'Boolean', |
|
192 | + 'description' => __('Flag indicating whether the tickets sold for the event, met or exceed the registration limit', 'event_espresso'), |
|
193 | + ] |
|
194 | + ), |
|
195 | + new GraphQLField( |
|
196 | + 'isPostponed', |
|
197 | + [ |
|
198 | + 'key' => 'is_postponed', |
|
199 | + 'type' => 'Boolean', |
|
200 | + 'description' => __('Flag indicating whether the event is marked as postponed', 'event_espresso'), |
|
201 | + ] |
|
202 | + ), |
|
203 | + new GraphQLField( |
|
204 | + 'isCancelled', |
|
205 | + [ |
|
206 | + 'key' => 'is_cancelled', |
|
207 | + 'type' => 'Boolean', |
|
208 | + 'description' => __('Flag indicating whether the event is marked as cancelled', 'event_espresso'), |
|
209 | + ] |
|
210 | + ), |
|
211 | + new GraphQLField( |
|
212 | + 'isUpcoming', |
|
213 | + [ |
|
214 | + 'key' => 'is_upcoming', |
|
215 | + 'type' => 'Boolean', |
|
216 | + 'description' => __('Whether the event is upcoming', 'event_espresso'), |
|
217 | + ] |
|
218 | + ), |
|
219 | + new GraphQLField( |
|
220 | + 'isActive', |
|
221 | + [ |
|
222 | + 'key' => 'is_active', |
|
223 | + 'type' => 'Boolean', |
|
224 | + 'description' => __('Flag indicating event is active', 'event_espresso'), |
|
225 | + ] |
|
226 | + ), |
|
227 | + new GraphQLField( |
|
228 | + 'isInactive', |
|
229 | + [ |
|
230 | + 'key' => 'is_inactive', |
|
231 | + 'type' => 'Boolean', |
|
232 | + 'description' => __('Flag indicating event is inactive', 'event_espresso'), |
|
233 | + ] |
|
234 | + ), |
|
235 | + new GraphQLField( |
|
236 | + 'isExpired', |
|
237 | + [ |
|
238 | + 'key' => 'is_expired', |
|
239 | + 'type' => 'Boolean', |
|
240 | + 'description' => __('Flag indicating event is expired or not', 'event_espresso'), |
|
241 | + ] |
|
242 | + ), |
|
243 | + ]; |
|
244 | + } |
|
245 | 245 | } |
246 | 246 | \ No newline at end of file |