@@ -281,8 +281,7 @@ discard block |
||
281 | 281 | $short_desc = $this->get( 'EVT_short_desc' ); |
282 | 282 | if ( !empty( $short_desc ) || $not_full_desc ) { |
283 | 283 | return $short_desc; |
284 | - } |
|
285 | - else { |
|
284 | + } else { |
|
286 | 285 | $full_desc = $this->get( 'EVT_desc' ); |
287 | 286 | return wp_trim_words( $full_desc, $num_words, $more ); |
288 | 287 | } |
@@ -665,8 +664,7 @@ discard block |
||
665 | 664 | // if datetime has unlimited reg limit then the event can never be sold out |
666 | 665 | if ( $dtt_spaces_remaining === INF ) { |
667 | 666 | return FALSE; |
668 | - } |
|
669 | - else { |
|
667 | + } else { |
|
670 | 668 | $spaces_remaining = max( $dtt_spaces_remaining, $spaces_remaining ); |
671 | 669 | } |
672 | 670 | } |
@@ -677,8 +675,7 @@ discard block |
||
677 | 675 | $this->save(); |
678 | 676 | } |
679 | 677 | $sold_out = TRUE; |
680 | - } |
|
681 | - else { |
|
678 | + } else { |
|
682 | 679 | $sold_out = FALSE; |
683 | 680 | } |
684 | 681 | //note: I considered changing the EEM_Event status away from sold_out if this status check reveals that it's no longer sold out (yet the status is still set as sold out) but the problem is... what do we change the status BACK to? We can't always assume that the previous event status was 'published' because this status check is always done in the admin and its entirely possible the event admin manually changes to sold_out status from some other status. We also don't want a draft event to become a "publish event" because the sold out check reveals its NOT sold out. |
@@ -876,8 +873,7 @@ discard block |
||
876 | 873 | public function is_sold_out( $actual = FALSE ) { |
877 | 874 | if ( !$actual ) { |
878 | 875 | return $this->status() == EEM_Event::sold_out; |
879 | - } |
|
880 | - else { |
|
876 | + } else { |
|
881 | 877 | return $this->perform_sold_out_status_check(); |
882 | 878 | } |
883 | 879 | } |
@@ -1067,8 +1063,7 @@ discard block |
||
1067 | 1063 | public function get_permalink() { |
1068 | 1064 | if ( $this->external_url() ) { |
1069 | 1065 | return $this->external_url(); |
1070 | - } |
|
1071 | - else { |
|
1066 | + } else { |
|
1072 | 1067 | return parent::get_permalink(); |
1073 | 1068 | } |
1074 | 1069 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | /** |
115 | 115 | * Gets all the tickets available for purchase of this event |
116 | 116 | * @param array $query_params like EEM_Base::get_all |
117 | - * @return EE_Ticket |
|
117 | + * @return EE_Base_Class[] |
|
118 | 118 | */ |
119 | 119 | public function tickets( $query_params = array() ) { |
120 | 120 | return $this->get_many_related( 'Ticket', $query_params ); |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | * |
774 | 774 | * @access public |
775 | 775 | * @param boolean $echo whether to return (FALSE), or echo out the result (TRUE) |
776 | - * @return mixed void|string |
|
776 | + * @return null|string void|string |
|
777 | 777 | */ |
778 | 778 | public function pretty_active_status( $echo = TRUE ) { |
779 | 779 | $active_status = $this->get_active_status(); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | * @param array $props_n_values |
47 | 47 | * @return EE_Event |
48 | 48 | */ |
49 | - public static function new_instance( $props_n_values = array() ) { |
|
50 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
51 | - $obj = $has_object ? $has_object : new self( $props_n_values ); |
|
49 | + public static function new_instance($props_n_values = array()) { |
|
50 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
51 | + $obj = $has_object ? $has_object : new self($props_n_values); |
|
52 | 52 | //we need to set the _timezone property to whatever is set in the db for the event initially. |
53 | - $obj->set_timezone( $obj->timezone_string() ); |
|
53 | + $obj->set_timezone($obj->timezone_string()); |
|
54 | 54 | return $obj; |
55 | 55 | } |
56 | 56 | |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | * @param array $props_n_values |
62 | 62 | * @return EE_Event |
63 | 63 | */ |
64 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
65 | - $obj = new self( $props_n_values, TRUE ); |
|
64 | + public static function new_instance_from_db($props_n_values = array()) { |
|
65 | + $obj = new self($props_n_values, TRUE); |
|
66 | 66 | //we need to set the _timezone property to whatever is set in the db for the event initially. |
67 | - $obj->set_timezone( $obj->timezone_string() ); |
|
67 | + $obj->set_timezone($obj->timezone_string()); |
|
68 | 68 | return $obj; |
69 | 69 | } |
70 | 70 | |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | * @param boolean $show_deleted whether or not to include deleted events |
80 | 80 | * @return EE_Datetime[] |
81 | 81 | */ |
82 | - public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE, $limit = NULL ) { |
|
83 | - return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_event_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted, $limit ); |
|
82 | + public function datetimes_ordered($show_expired = TRUE, $show_deleted = FALSE, $limit = NULL) { |
|
83 | + return EEM_Datetime::instance($this->_timezone)->get_datetimes_for_event_ordered_by_DTT_order($this->ID(), $show_expired, $show_deleted, $limit); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @return EE_Datetime |
91 | 91 | */ |
92 | 92 | public function first_datetime() { |
93 | - return $this->get_first_related( 'Datetime' ); |
|
93 | + return $this->get_first_related('Datetime'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | * @param bool $try_to_exclude_deleted |
102 | 102 | * @return EE_Datetime |
103 | 103 | */ |
104 | - public function primary_datetime( $try_to_exclude_expired = TRUE, $try_to_exclude_deleted = TRUE ) { |
|
105 | - if ( !empty ( $this->_Primary_Datetime ) ) { |
|
104 | + public function primary_datetime($try_to_exclude_expired = TRUE, $try_to_exclude_deleted = TRUE) { |
|
105 | + if ( ! empty ($this->_Primary_Datetime)) { |
|
106 | 106 | return $this->_Primary_Datetime; |
107 | 107 | } |
108 | - $this->_Primary_Datetime = EEM_Datetime::instance( $this->_timezone )->get_primary_datetime_for_event( $this->ID(), $try_to_exclude_expired, $try_to_exclude_deleted ); |
|
108 | + $this->_Primary_Datetime = EEM_Datetime::instance($this->_timezone)->get_primary_datetime_for_event($this->ID(), $try_to_exclude_expired, $try_to_exclude_deleted); |
|
109 | 109 | return $this->_Primary_Datetime; |
110 | 110 | } |
111 | 111 | |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | * @param array $query_params like EEM_Base::get_all |
117 | 117 | * @return EE_Ticket |
118 | 118 | */ |
119 | - public function tickets( $query_params = array() ) { |
|
120 | - return $this->get_many_related( 'Ticket', $query_params ); |
|
119 | + public function tickets($query_params = array()) { |
|
120 | + return $this->get_many_related('Ticket', $query_params); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @return bool |
127 | 127 | */ |
128 | 128 | function additional_limit() { |
129 | - return $this->get( 'EVT_additional_limit' ); |
|
129 | + return $this->get('EVT_additional_limit'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @return bool |
136 | 136 | */ |
137 | 137 | function allow_overflow() { |
138 | - return $this->get( 'EVT_allow_overflow' ); |
|
138 | + return $this->get('EVT_allow_overflow'); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @return bool |
145 | 145 | */ |
146 | 146 | function created() { |
147 | - return $this->get( 'EVT_created' ); |
|
147 | + return $this->get('EVT_created'); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @return bool |
154 | 154 | */ |
155 | 155 | function description() { |
156 | - return $this->get( 'EVT_desc' ); |
|
156 | + return $this->get('EVT_desc'); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * @return string of html |
164 | 164 | */ |
165 | 165 | function description_filtered() { |
166 | - return $this->get_pretty( 'EVT_desc' ); |
|
166 | + return $this->get_pretty('EVT_desc'); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @return bool |
173 | 173 | */ |
174 | 174 | function display_description() { |
175 | - return $this->get( 'EVT_display_desc' ); |
|
175 | + return $this->get('EVT_display_desc'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * @return bool |
182 | 182 | */ |
183 | 183 | function display_ticket_selector() { |
184 | - return (bool)$this->get( 'EVT_display_ticket_selector' ); |
|
184 | + return (bool) $this->get('EVT_display_ticket_selector'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @return bool |
191 | 191 | */ |
192 | 192 | function external_url() { |
193 | - return $this->get( 'EVT_external_URL' ); |
|
193 | + return $this->get('EVT_external_URL'); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @return bool |
200 | 200 | */ |
201 | 201 | function member_only() { |
202 | - return $this->get( 'EVT_member_only' ); |
|
202 | + return $this->get('EVT_member_only'); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * @return bool |
209 | 209 | */ |
210 | 210 | function phone() { |
211 | - return $this->get( 'EVT_phone' ); |
|
211 | + return $this->get('EVT_phone'); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @return bool |
218 | 218 | */ |
219 | 219 | function modified() { |
220 | - return $this->get( 'EVT_modified' ); |
|
220 | + return $this->get('EVT_modified'); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @return bool |
227 | 227 | */ |
228 | 228 | function name() { |
229 | - return $this->get( 'EVT_name' ); |
|
229 | + return $this->get('EVT_name'); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * @return bool |
236 | 236 | */ |
237 | 237 | function order() { |
238 | - return $this->get( 'EVT_order' ); |
|
238 | + return $this->get('EVT_order'); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | * @return bool|string |
245 | 245 | */ |
246 | 246 | function default_registration_status() { |
247 | - $event_default_registration_status = $this->get( 'EVT_default_registration_status' ); |
|
248 | - return !empty( $event_default_registration_status ) ? $event_default_registration_status : EE_Registry::instance()->CFG->registration->default_STS_ID; |
|
247 | + $event_default_registration_status = $this->get('EVT_default_registration_status'); |
|
248 | + return ! empty($event_default_registration_status) ? $event_default_registration_status : EE_Registry::instance()->CFG->registration->default_STS_ID; |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -256,14 +256,14 @@ discard block |
||
256 | 256 | * @param bool $not_full_desc |
257 | 257 | * @return bool|string |
258 | 258 | */ |
259 | - function short_description( $num_words = 55, $more = NULL, $not_full_desc = FALSE ) { |
|
260 | - $short_desc = $this->get( 'EVT_short_desc' ); |
|
261 | - if ( !empty( $short_desc ) || $not_full_desc ) { |
|
259 | + function short_description($num_words = 55, $more = NULL, $not_full_desc = FALSE) { |
|
260 | + $short_desc = $this->get('EVT_short_desc'); |
|
261 | + if ( ! empty($short_desc) || $not_full_desc) { |
|
262 | 262 | return $short_desc; |
263 | 263 | } |
264 | 264 | else { |
265 | - $full_desc = $this->get( 'EVT_desc' ); |
|
266 | - return wp_trim_words( $full_desc, $num_words, $more ); |
|
265 | + $full_desc = $this->get('EVT_desc'); |
|
266 | + return wp_trim_words($full_desc, $num_words, $more); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * @return bool |
274 | 274 | */ |
275 | 275 | function slug() { |
276 | - return $this->get( 'EVT_slug' ); |
|
276 | + return $this->get('EVT_slug'); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * @return bool |
283 | 283 | */ |
284 | 284 | function timezone_string() { |
285 | - return $this->get( 'EVT_timezone_string' ); |
|
285 | + return $this->get('EVT_timezone_string'); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * @return bool |
292 | 292 | */ |
293 | 293 | function visible_on() { |
294 | - return $this->get( 'EVT_visible_on' ); |
|
294 | + return $this->get('EVT_visible_on'); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | * @return bool |
301 | 301 | */ |
302 | 302 | function wp_user() { |
303 | - return $this->get( 'EVT_wp_user' ); |
|
303 | + return $this->get('EVT_wp_user'); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * @return bool |
310 | 310 | */ |
311 | 311 | function donations() { |
312 | - return $this->get( 'EVT_donations' ); |
|
312 | + return $this->get('EVT_donations'); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | |
@@ -317,8 +317,8 @@ discard block |
||
317 | 317 | /** |
318 | 318 | * @param $limit |
319 | 319 | */ |
320 | - function set_additional_limit( $limit ) { |
|
321 | - $this->set( 'EVT_additional_limit', $limit ); |
|
320 | + function set_additional_limit($limit) { |
|
321 | + $this->set('EVT_additional_limit', $limit); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -326,8 +326,8 @@ discard block |
||
326 | 326 | /** |
327 | 327 | * @param $created |
328 | 328 | */ |
329 | - function set_created( $created ) { |
|
330 | - $this->set( 'EVT_created', $created ); |
|
329 | + function set_created($created) { |
|
330 | + $this->set('EVT_created', $created); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | /** |
336 | 336 | * @param $desc |
337 | 337 | */ |
338 | - function set_description( $desc ) { |
|
339 | - $this->set( 'EVT_desc', $desc ); |
|
338 | + function set_description($desc) { |
|
339 | + $this->set('EVT_desc', $desc); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | /** |
345 | 345 | * @param $display_desc |
346 | 346 | */ |
347 | - function set_display_description( $display_desc ) { |
|
348 | - $this->set( 'EVT_display_desc', $display_desc ); |
|
347 | + function set_display_description($display_desc) { |
|
348 | + $this->set('EVT_display_desc', $display_desc); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
@@ -353,8 +353,8 @@ discard block |
||
353 | 353 | /** |
354 | 354 | * @param $display_ticket_selector |
355 | 355 | */ |
356 | - function set_display_ticket_selector( $display_ticket_selector ) { |
|
357 | - $this->set( 'EVT_display_ticket_selector', $display_ticket_selector ); |
|
356 | + function set_display_ticket_selector($display_ticket_selector) { |
|
357 | + $this->set('EVT_display_ticket_selector', $display_ticket_selector); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | |
@@ -362,8 +362,8 @@ discard block |
||
362 | 362 | /** |
363 | 363 | * @param $external_url |
364 | 364 | */ |
365 | - function set_external_url( $external_url ) { |
|
366 | - $this->set( 'EVT_external_URL', $external_url ); |
|
365 | + function set_external_url($external_url) { |
|
366 | + $this->set('EVT_external_URL', $external_url); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | |
@@ -371,8 +371,8 @@ discard block |
||
371 | 371 | /** |
372 | 372 | * @param $member_only |
373 | 373 | */ |
374 | - function set_member_only( $member_only ) { |
|
375 | - $this->set( 'EVT_member_only', $member_only ); |
|
374 | + function set_member_only($member_only) { |
|
375 | + $this->set('EVT_member_only', $member_only); |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | |
@@ -380,8 +380,8 @@ discard block |
||
380 | 380 | /** |
381 | 381 | * @param $event_phone |
382 | 382 | */ |
383 | - function set_event_phone( $event_phone ) { |
|
384 | - $this->set( 'EVT_phone', $event_phone ); |
|
383 | + function set_event_phone($event_phone) { |
|
384 | + $this->set('EVT_phone', $event_phone); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | |
@@ -389,8 +389,8 @@ discard block |
||
389 | 389 | /** |
390 | 390 | * @param $modified |
391 | 391 | */ |
392 | - function set_modified( $modified ) { |
|
393 | - $this->set( 'EVT_modified', $modified ); |
|
392 | + function set_modified($modified) { |
|
393 | + $this->set('EVT_modified', $modified); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | /** |
399 | 399 | * @param $name |
400 | 400 | */ |
401 | - function set_name( $name ) { |
|
402 | - $this->set( 'EVT_name', $name ); |
|
401 | + function set_name($name) { |
|
402 | + $this->set('EVT_name', $name); |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | |
@@ -407,8 +407,8 @@ discard block |
||
407 | 407 | /** |
408 | 408 | * @param $order |
409 | 409 | */ |
410 | - function set_order( $order ) { |
|
411 | - $this->set( 'EVT_order', $order ); |
|
410 | + function set_order($order) { |
|
411 | + $this->set('EVT_order', $order); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | |
@@ -416,8 +416,8 @@ discard block |
||
416 | 416 | /** |
417 | 417 | * @param $short_desc |
418 | 418 | */ |
419 | - function set_short_description( $short_desc ) { |
|
420 | - $this->set( 'EVT_short_desc', $short_desc ); |
|
419 | + function set_short_description($short_desc) { |
|
420 | + $this->set('EVT_short_desc', $short_desc); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | /** |
426 | 426 | * @param $slug |
427 | 427 | */ |
428 | - function set_slug( $slug ) { |
|
429 | - $this->set( 'EVT_slug', $slug ); |
|
428 | + function set_slug($slug) { |
|
429 | + $this->set('EVT_slug', $slug); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | /** |
435 | 435 | * @param $timezone_string |
436 | 436 | */ |
437 | - function set_timezone_string( $timezone_string ) { |
|
438 | - $this->set( 'EVT_timezone_string', $timezone_string ); |
|
437 | + function set_timezone_string($timezone_string) { |
|
438 | + $this->set('EVT_timezone_string', $timezone_string); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | /** |
444 | 444 | * @param $visible_on |
445 | 445 | */ |
446 | - function set_visible_on( $visible_on ) { |
|
447 | - $this->set( 'EVT_visible_on', $visible_on ); |
|
446 | + function set_visible_on($visible_on) { |
|
447 | + $this->set('EVT_visible_on', $visible_on); |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | |
@@ -452,8 +452,8 @@ discard block |
||
452 | 452 | /** |
453 | 453 | * @param $wp_user |
454 | 454 | */ |
455 | - function set_wp_user( $wp_user ) { |
|
456 | - $this->set( 'EVT_wp_user', $wp_user ); |
|
455 | + function set_wp_user($wp_user) { |
|
456 | + $this->set('EVT_wp_user', $wp_user); |
|
457 | 457 | } |
458 | 458 | |
459 | 459 | |
@@ -461,8 +461,8 @@ discard block |
||
461 | 461 | /** |
462 | 462 | * @param $default_registration_status |
463 | 463 | */ |
464 | - function set_default_registration_status( $default_registration_status ) { |
|
465 | - $this->set( 'EVT_default_registration_status', $default_registration_status ); |
|
464 | + function set_default_registration_status($default_registration_status) { |
|
465 | + $this->set('EVT_default_registration_status', $default_registration_status); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | |
@@ -470,8 +470,8 @@ discard block |
||
470 | 470 | /** |
471 | 471 | * @param $donations |
472 | 472 | */ |
473 | - function set_donations( $donations ) { |
|
474 | - $this->set( 'EVT_donations', $donations ); |
|
473 | + function set_donations($donations) { |
|
474 | + $this->set('EVT_donations', $donations); |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | * @param EE_Venue /int $venue_id_or_obj |
482 | 482 | * @return EE_Venue |
483 | 483 | */ |
484 | - function add_venue( $venue_id_or_obj ) { |
|
485 | - return $this->_add_relation_to( $venue_id_or_obj, 'Venue' ); |
|
484 | + function add_venue($venue_id_or_obj) { |
|
485 | + return $this->_add_relation_to($venue_id_or_obj, 'Venue'); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | |
@@ -492,8 +492,8 @@ discard block |
||
492 | 492 | * @param EE_Venue /int $venue_id_or_obj |
493 | 493 | * @return EE_Venue |
494 | 494 | */ |
495 | - function remove_venue( $venue_id_or_obj ) { |
|
496 | - return $this->_remove_relation_to( $venue_id_or_obj, 'Venue' ); |
|
495 | + function remove_venue($venue_id_or_obj) { |
|
496 | + return $this->_remove_relation_to($venue_id_or_obj, 'Venue'); |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | |
@@ -503,8 +503,8 @@ discard block |
||
503 | 503 | * @param array $query_params like EEM_Base::get_all's $query_params |
504 | 504 | * @return EE_Venue[] |
505 | 505 | */ |
506 | - function venues( $query_params = array() ) { |
|
507 | - return $this->get_many_related( 'Venue', $query_params ); |
|
506 | + function venues($query_params = array()) { |
|
507 | + return $this->get_many_related('Venue', $query_params); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | */ |
517 | 517 | private function _has_ID_and_is_published() { |
518 | 518 | // first check if event id is present and not NULL, then check if this event is published (or any of the equivalent "published" statuses) |
519 | - return ( $this->ID() && $this->ID() !== NULL && ( $this->status() == 'publish' || $this->status() == EEM_Event::sold_out || $this->status() == EEM_Event::postponed || $this->status() == EEM_Event::cancelled ) ) ? TRUE : FALSE; |
|
519 | + return ($this->ID() && $this->ID() !== NULL && ($this->status() == 'publish' || $this->status() == EEM_Event::sold_out || $this->status() == EEM_Event::postponed || $this->status() == EEM_Event::cancelled)) ? TRUE : FALSE; |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | |
@@ -528,21 +528,21 @@ discard block |
||
528 | 528 | */ |
529 | 529 | public function is_upcoming() { |
530 | 530 | // check if event id is present and if this event is published |
531 | - if ( $this->is_inactive() ) { |
|
531 | + if ($this->is_inactive()) { |
|
532 | 532 | return FALSE; |
533 | 533 | } |
534 | 534 | // set initial value |
535 | 535 | $upcoming = FALSE; |
536 | 536 | //next let's get all datetimes and loop through them |
537 | - $datetimes = $this->get_many_related( 'Datetime', array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) ) ); |
|
538 | - foreach ( $datetimes as $datetime ) { |
|
539 | - if ( $datetime instanceof EE_Datetime ) { |
|
537 | + $datetimes = $this->get_many_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))); |
|
538 | + foreach ($datetimes as $datetime) { |
|
539 | + if ($datetime instanceof EE_Datetime) { |
|
540 | 540 | //if this dtt is expired then we continue cause one of the other datetimes might be upcoming. |
541 | - if ( $datetime->is_expired() ) { |
|
541 | + if ($datetime->is_expired()) { |
|
542 | 542 | continue; |
543 | 543 | } |
544 | 544 | //if this dtt is active then we return false. |
545 | - if ( $datetime->is_active() ) { |
|
545 | + if ($datetime->is_active()) { |
|
546 | 546 | return FALSE; |
547 | 547 | } |
548 | 548 | //otherwise let's check upcoming status |
@@ -559,21 +559,21 @@ discard block |
||
559 | 559 | */ |
560 | 560 | public function is_active() { |
561 | 561 | // check if event id is present and if this event is published |
562 | - if ( $this->is_inactive() ) { |
|
562 | + if ($this->is_inactive()) { |
|
563 | 563 | return FALSE; |
564 | 564 | } |
565 | 565 | // set initial value |
566 | 566 | $active = FALSE; |
567 | 567 | //next let's get all datetimes and loop through them |
568 | - $datetimes = $this->get_many_related( 'Datetime', array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) ) ); |
|
569 | - foreach ( $datetimes as $datetime ) { |
|
570 | - if ( $datetime instanceof EE_Datetime ) { |
|
568 | + $datetimes = $this->get_many_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))); |
|
569 | + foreach ($datetimes as $datetime) { |
|
570 | + if ($datetime instanceof EE_Datetime) { |
|
571 | 571 | //if this dtt is expired then we continue cause one of the other datetimes might be active. |
572 | - if ( $datetime->is_expired() ) { |
|
572 | + if ($datetime->is_expired()) { |
|
573 | 573 | continue; |
574 | 574 | } |
575 | 575 | //if this dtt is upcoming then we return false. |
576 | - if ( $datetime->is_upcoming() ) { |
|
576 | + if ($datetime->is_upcoming()) { |
|
577 | 577 | return FALSE; |
578 | 578 | } |
579 | 579 | //otherwise let's check active status |
@@ -590,17 +590,17 @@ discard block |
||
590 | 590 | */ |
591 | 591 | public function is_expired() { |
592 | 592 | // check if event id is present and if this event is published |
593 | - if ( $this->is_inactive() ) { |
|
593 | + if ($this->is_inactive()) { |
|
594 | 594 | return FALSE; |
595 | 595 | } |
596 | 596 | // set initial value |
597 | 597 | $expired = FALSE; |
598 | 598 | //first let's get all datetimes and loop through them |
599 | - $datetimes = $this->get_many_related( 'Datetime', array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) ) ); |
|
600 | - foreach ( $datetimes as $datetime ) { |
|
601 | - if ( $datetime instanceof EE_Datetime ) { |
|
599 | + $datetimes = $this->get_many_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))); |
|
600 | + foreach ($datetimes as $datetime) { |
|
601 | + if ($datetime instanceof EE_Datetime) { |
|
602 | 602 | //if this dtt is upcoming or active then we return false. |
603 | - if ( $datetime->is_upcoming() || $datetime->is_active() ) { |
|
603 | + if ($datetime->is_upcoming() || $datetime->is_active()) { |
|
604 | 604 | return FALSE; |
605 | 605 | } |
606 | 606 | //otherwise let's check active status |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | */ |
618 | 618 | public function is_inactive() { |
619 | 619 | // check if event id is present and if this event is published |
620 | - if ( $this->_has_ID_and_is_published() ) { |
|
620 | + if ($this->_has_ID_and_is_published()) { |
|
621 | 621 | return FALSE; |
622 | 622 | } |
623 | 623 | return TRUE; |
@@ -637,22 +637,22 @@ discard block |
||
637 | 637 | // set initial value |
638 | 638 | $spaces_remaining = 0; |
639 | 639 | //next let's get all datetimes and loop through them |
640 | - $datetimes = $this->get_many_related( 'Datetime', array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) ) ); |
|
641 | - foreach ( $datetimes as $datetime ) { |
|
642 | - if ( $datetime instanceof EE_Datetime ) { |
|
643 | - $dtt_spaces_remaining = $datetime->spaces_remaining( TRUE ); |
|
640 | + $datetimes = $this->get_many_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))); |
|
641 | + foreach ($datetimes as $datetime) { |
|
642 | + if ($datetime instanceof EE_Datetime) { |
|
643 | + $dtt_spaces_remaining = $datetime->spaces_remaining(TRUE); |
|
644 | 644 | // if datetime has unlimited reg limit then the event can never be sold out |
645 | - if ( $dtt_spaces_remaining === INF ) { |
|
645 | + if ($dtt_spaces_remaining === INF) { |
|
646 | 646 | return FALSE; |
647 | 647 | } |
648 | 648 | else { |
649 | - $spaces_remaining = max( $dtt_spaces_remaining, $spaces_remaining ); |
|
649 | + $spaces_remaining = max($dtt_spaces_remaining, $spaces_remaining); |
|
650 | 650 | } |
651 | 651 | } |
652 | 652 | } |
653 | - if ( $spaces_remaining === 0 ) { |
|
654 | - $this->set_status( EEM_Event::sold_out ); |
|
655 | - if ( !is_admin() || ( is_admin() && defined( 'DOING_AJAX' ) ) ) { |
|
653 | + if ($spaces_remaining === 0) { |
|
654 | + $this->set_status(EEM_Event::sold_out); |
|
655 | + if ( ! is_admin() || (is_admin() && defined('DOING_AJAX'))) { |
|
656 | 656 | $this->save(); |
657 | 657 | } |
658 | 658 | $sold_out = TRUE; |
@@ -672,8 +672,8 @@ discard block |
||
672 | 672 | * @param bool $actual whether or not to perform calculations to not only figure the actual status but also to flip the status if necessary to sold out If false, we just check the existing status of the event |
673 | 673 | * @return boolean |
674 | 674 | */ |
675 | - public function is_sold_out( $actual = FALSE ) { |
|
676 | - if ( !$actual ) { |
|
675 | + public function is_sold_out($actual = FALSE) { |
|
676 | + if ( ! $actual) { |
|
677 | 677 | return $this->status() == EEM_Event::sold_out; |
678 | 678 | } |
679 | 679 | else { |
@@ -711,36 +711,36 @@ discard block |
||
711 | 711 | * @param bool $reset |
712 | 712 | * @return bool | string - based on EE_Datetime active constants or FALSE if error. |
713 | 713 | */ |
714 | - public function get_active_status( $reset = FALSE ) { |
|
714 | + public function get_active_status($reset = FALSE) { |
|
715 | 715 | // if the active status has already been set, then just use that value (unless we are resetting it) |
716 | - if ( ! empty( $this->_active_status ) && ! $reset ) { |
|
716 | + if ( ! empty($this->_active_status) && ! $reset) { |
|
717 | 717 | return $this->_active_status; |
718 | 718 | } |
719 | 719 | //first check if event id is present on this object |
720 | - if ( ! $this->ID() ) { |
|
720 | + if ( ! $this->ID()) { |
|
721 | 721 | return FALSE; |
722 | 722 | } |
723 | 723 | //first get all datetimes ordered by date |
724 | - $datetimes = $this->get_many_related( 'Datetime', array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) ) ); |
|
724 | + $datetimes = $this->get_many_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))); |
|
725 | 725 | //next loop through $datetimes and setup status array |
726 | 726 | $status_array = array(); |
727 | - foreach ( $datetimes as $datetime ) { |
|
728 | - if ( $datetime instanceof EE_Datetime ) { |
|
727 | + foreach ($datetimes as $datetime) { |
|
728 | + if ($datetime instanceof EE_Datetime) { |
|
729 | 729 | $status_array[] = $datetime->get_active_status(); |
730 | 730 | } |
731 | 731 | } |
732 | 732 | //now we can conditionally determine status |
733 | - if ( $this->status() == 'publish' ) { |
|
734 | - if ( in_array( EE_Datetime::active, $status_array ) ) { |
|
733 | + if ($this->status() == 'publish') { |
|
734 | + if (in_array(EE_Datetime::active, $status_array)) { |
|
735 | 735 | $this->_active_status = EE_Datetime::active; |
736 | 736 | } else { |
737 | - if ( in_array( EE_Datetime::upcoming, $status_array ) ) { |
|
737 | + if (in_array(EE_Datetime::upcoming, $status_array)) { |
|
738 | 738 | $this->_active_status = EE_Datetime::upcoming; |
739 | 739 | } else { |
740 | - if ( in_array( EE_Datetime::expired, $status_array ) ) { |
|
740 | + if (in_array(EE_Datetime::expired, $status_array)) { |
|
741 | 741 | $this->_active_status = EE_Datetime::expired; |
742 | 742 | } else { |
743 | - if ( in_array( EE_Datetime::sold_out, $status_array ) ) { |
|
743 | + if (in_array(EE_Datetime::sold_out, $status_array)) { |
|
744 | 744 | $this->_active_status = EE_Datetime::sold_out; |
745 | 745 | } else { |
746 | 746 | $this->_active_status = EE_Datetime::expired; //catchall |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | } |
750 | 750 | } |
751 | 751 | } else { |
752 | - switch ( $this->status() ) { |
|
752 | + switch ($this->status()) { |
|
753 | 753 | case EEM_Event::sold_out : |
754 | 754 | $this->_active_status = EE_Datetime::sold_out; |
755 | 755 | break; |
@@ -775,10 +775,10 @@ discard block |
||
775 | 775 | * @param boolean $echo whether to return (FALSE), or echo out the result (TRUE) |
776 | 776 | * @return mixed void|string |
777 | 777 | */ |
778 | - public function pretty_active_status( $echo = TRUE ) { |
|
778 | + public function pretty_active_status($echo = TRUE) { |
|
779 | 779 | $active_status = $this->get_active_status(); |
780 | - $status = '<span class="ee-status event-active-status-' . $active_status . '">' . EEH_Template::pretty_status( $active_status, FALSE, 'sentence' ) . '</span>'; |
|
781 | - if ( $echo ) { |
|
780 | + $status = '<span class="ee-status event-active-status-'.$active_status.'">'.EEH_Template::pretty_status($active_status, FALSE, 'sentence').'</span>'; |
|
781 | + if ($echo) { |
|
782 | 782 | echo $status; |
783 | 783 | } else { |
784 | 784 | return $status; |
@@ -792,12 +792,12 @@ discard block |
||
792 | 792 | */ |
793 | 793 | public function get_number_of_tickets_sold() { |
794 | 794 | $tkt_sold = 0; |
795 | - if ( !$this->ID() ) { |
|
795 | + if ( ! $this->ID()) { |
|
796 | 796 | return 0; |
797 | 797 | } |
798 | - $datetimes = $this->get_many_related( 'Datetime' ); |
|
799 | - foreach ( $datetimes as $datetime ) { |
|
800 | - $tkt_sold += $datetime->get( 'DTT_sold' ); |
|
798 | + $datetimes = $this->get_many_related('Datetime'); |
|
799 | + foreach ($datetimes as $datetime) { |
|
800 | + $tkt_sold += $datetime->get('DTT_sold'); |
|
801 | 801 | } |
802 | 802 | return $tkt_sold; |
803 | 803 | } |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | * @return int |
811 | 811 | */ |
812 | 812 | public function get_count_of_all_registrations() { |
813 | - return EEM_Event::instance()->count_related( $this, 'Registration' ); |
|
813 | + return EEM_Event::instance()->count_related($this, 'Registration'); |
|
814 | 814 | } |
815 | 815 | |
816 | 816 | |
@@ -820,9 +820,9 @@ discard block |
||
820 | 820 | * @return EE_Ticket |
821 | 821 | */ |
822 | 822 | public function get_ticket_with_earliest_start_time() { |
823 | - $where[ 'Datetime.EVT_ID' ] = $this->ID(); |
|
824 | - $query_params = array( $where, 'order_by' => array( 'TKT_start_date' => 'ASC' ) ); |
|
825 | - return EE_Registry::instance()->load_model( 'Ticket' )->get_one( $query_params ); |
|
823 | + $where['Datetime.EVT_ID'] = $this->ID(); |
|
824 | + $query_params = array($where, 'order_by' => array('TKT_start_date' => 'ASC')); |
|
825 | + return EE_Registry::instance()->load_model('Ticket')->get_one($query_params); |
|
826 | 826 | } |
827 | 827 | |
828 | 828 | |
@@ -832,9 +832,9 @@ discard block |
||
832 | 832 | * @return EE_Ticket |
833 | 833 | */ |
834 | 834 | public function get_ticket_with_latest_end_time() { |
835 | - $where[ 'Datetime.EVT_ID' ] = $this->ID(); |
|
836 | - $query_params = array( $where, 'order_by' => array( 'TKT_end_date' => 'DESC' ) ); |
|
837 | - return EE_Registry::instance()->load_model( 'Ticket' )->get_one( $query_params ); |
|
835 | + $where['Datetime.EVT_ID'] = $this->ID(); |
|
836 | + $query_params = array($where, 'order_by' => array('TKT_end_date' => 'DESC')); |
|
837 | + return EE_Registry::instance()->load_model('Ticket')->get_one($query_params); |
|
838 | 838 | } |
839 | 839 | |
840 | 840 | |
@@ -846,11 +846,11 @@ discard block |
||
846 | 846 | public function tickets_on_sale() { |
847 | 847 | $earliest_ticket = $this->get_ticket_with_earliest_start_time(); |
848 | 848 | $latest_ticket = $this->get_ticket_with_latest_end_time(); |
849 | - if ( !$latest_ticket instanceof EE_Ticket && !$earliest_ticket instanceof EE_Ticket ) { |
|
849 | + if ( ! $latest_ticket instanceof EE_Ticket && ! $earliest_ticket instanceof EE_Ticket) { |
|
850 | 850 | return FALSE; |
851 | 851 | } |
852 | 852 | //check on sale for these two tickets. |
853 | - if ( $latest_ticket->is_on_sale() || $earliest_ticket->is_on_sale() ) { |
|
853 | + if ($latest_ticket->is_on_sale() || $earliest_ticket->is_on_sale()) { |
|
854 | 854 | return TRUE; |
855 | 855 | } |
856 | 856 | return FALSE; |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | * @return string |
865 | 865 | */ |
866 | 866 | public function get_permalink() { |
867 | - if ( $this->external_url() ) { |
|
867 | + if ($this->external_url()) { |
|
868 | 868 | return $this->external_url(); |
869 | 869 | } |
870 | 870 | else { |
@@ -879,10 +879,10 @@ discard block |
||
879 | 879 | * @param array $query_params like EEM_Base::get_all |
880 | 880 | * @return EE_Term |
881 | 881 | */ |
882 | - public function first_event_category( $query_params = array() ) { |
|
883 | - $query_params[ 0 ][ 'Term_Taxonomy.taxonomy' ] = 'espresso_event_categories'; |
|
884 | - $query_params[ 0 ][ 'Term_Taxonomy.Event.EVT_ID' ] = $this->ID(); |
|
885 | - return EEM_Term::instance()->get_one( $query_params ); |
|
882 | + public function first_event_category($query_params = array()) { |
|
883 | + $query_params[0]['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
|
884 | + $query_params[0]['Term_Taxonomy.Event.EVT_ID'] = $this->ID(); |
|
885 | + return EEM_Term::instance()->get_one($query_params); |
|
886 | 886 | } |
887 | 887 | |
888 | 888 | |
@@ -892,10 +892,10 @@ discard block |
||
892 | 892 | * @param array $query_params |
893 | 893 | * @return EE_Term[] |
894 | 894 | */ |
895 | - public function get_all_event_categories( $query_params = array() ) { |
|
896 | - $query_params[ 0 ][ 'Term_Taxonomy.taxonomy' ] = 'espresso_event_categories'; |
|
897 | - $query_params[ 0 ][ 'Term_Taxonomy.Event.EVT_ID' ] = $this->ID(); |
|
898 | - return EEM_Term::instance()->get_all( $query_params ); |
|
895 | + public function get_all_event_categories($query_params = array()) { |
|
896 | + $query_params[0]['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
|
897 | + $query_params[0]['Term_Taxonomy.Event.EVT_ID'] = $this->ID(); |
|
898 | + return EEM_Term::instance()->get_all($query_params); |
|
899 | 899 | } |
900 | 900 | |
901 | 901 | /** |
@@ -903,8 +903,8 @@ discard block |
||
903 | 903 | * @param array $query_params @see EEM_Base::get_all |
904 | 904 | * @return EE_Question_Group[] |
905 | 905 | */ |
906 | - public function question_groups($query_params = array()){ |
|
907 | - $query_params = ! empty( $query_params ) ? $query_params : array( 'order_by' => array( 'QSG_order' => 'ASC' )); |
|
906 | + public function question_groups($query_params = array()) { |
|
907 | + $query_params = ! empty($query_params) ? $query_params : array('order_by' => array('QSG_order' => 'ASC')); |
|
908 | 908 | return $this->get_many_related('Question_Group', $query_params); |
909 | 909 | } |
910 | 910 |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * @param null $timezone |
23 | 23 | * @return EE_Event_Message_Template|mixed |
24 | 24 | */ |
25 | - public static function new_instance( $props_n_values = array(), $timezone = NULL ) { |
|
26 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
27 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
25 | + public static function new_instance($props_n_values = array(), $timezone = NULL) { |
|
26 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
27 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | * @param null $timezone |
35 | 35 | * @return EE_Event_Message_Template |
36 | 36 | */ |
37 | - public static function new_instance_from_db ( $props_n_values = array(), $timezone = NULL ) { |
|
38 | - return new self( $props_n_values, TRUE, $timezone ); |
|
37 | + public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) { |
|
38 | + return new self($props_n_values, TRUE, $timezone); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | } |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -1,18 +1,18 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Required by EEM_Event_Question_Group in case someone queries for all its model objects |
6 | 6 | */ |
7 | -class EE_Event_Question_Group extends EE_Base_Class{ |
|
7 | +class EE_Event_Question_Group extends EE_Base_Class { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * @param array $props_n_values |
11 | 11 | * @return EE_Event_Question_Group|mixed |
12 | 12 | */ |
13 | - public static function new_instance( $props_n_values = array() ) { |
|
14 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
15 | - return $has_object ? $has_object : new self( $props_n_values); |
|
13 | + public static function new_instance($props_n_values = array()) { |
|
14 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
15 | + return $has_object ? $has_object : new self($props_n_values); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @param array $props_n_values |
22 | 22 | * @return EE_Event_Question_Group |
23 | 23 | */ |
24 | - public static function new_instance_from_db ( $props_n_values = array() ) { |
|
25 | - return new self( $props_n_values, TRUE ); |
|
24 | + public static function new_instance_from_db($props_n_values = array()) { |
|
25 | + return new self($props_n_values, TRUE); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Required by EEM_Event_Question_Group in case someone queries for all its model objects |
4 | 4 | */ |
5 | -class EE_Event_Venue extends EE_Base_Class{ |
|
5 | +class EE_Event_Venue extends EE_Base_Class { |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * @param array $props_n_values |
9 | 9 | * @return EE_Event_Venue|mixed |
10 | 10 | */ |
11 | - public static function new_instance( $props_n_values = array() ) { |
|
12 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
13 | - return $has_object ? $has_object : new self( $props_n_values); |
|
11 | + public static function new_instance($props_n_values = array()) { |
|
12 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
13 | + return $has_object ? $has_object : new self($props_n_values); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | * @param array $props_n_values |
20 | 20 | * @return EE_Event_Venue |
21 | 21 | */ |
22 | - public static function new_instance_from_db ( $props_n_values = array() ) { |
|
23 | - return new self( $props_n_values, TRUE ); |
|
22 | + public static function new_instance_from_db($props_n_values = array()) { |
|
23 | + return new self($props_n_values, TRUE); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | EE_Error::doing_it_wrong('EE_Payment::gateway', __( 'The method EE_Payment::gateway() has been deprecated. Consider instead using EE_Payment::payment_method()->name()', 'event_espresso' ), '4.6.0' ); |
143 | 143 | if( $this->payment_method() ){ |
144 | 144 | return $this->payment_method()->name(); |
145 | - }else{ |
|
145 | + } else{ |
|
146 | 146 | return __( 'Unknown', 'event_espresso' ); |
147 | 147 | } |
148 | 148 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | public function set_payment_made_via_admin( $via_admin = FALSE ) { |
195 | 195 | if($via_admin){ |
196 | 196 | $this->set('PAY_source', EEM_Payment_Method::scope_admin); |
197 | - }else{ |
|
197 | + } else{ |
|
198 | 198 | $this->set('PAY_source', EEM_Payment_Method::scope_cart); |
199 | 199 | } |
200 | 200 | |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | } |
619 | 619 | if( is_array( $item ) ){ |
620 | 620 | array_walk_recursive( $item, array( $this, '_strip_all_tags_within_array' ) ); |
621 | - }else{ |
|
621 | + } else{ |
|
622 | 622 | $item = wp_strip_all_tags( $item ); |
623 | 623 | } |
624 | 624 | } |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | $current_status = $this->status(); |
635 | 635 | if( $original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved ){ |
636 | 636 | return TRUE; |
637 | - }else{ |
|
637 | + } else{ |
|
638 | 638 | return FALSE; |
639 | 639 | } |
640 | 640 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | * @subpackage includes/classes/EE_Payment.class.php |
23 | 23 | * @author Brent Christensen |
24 | 24 | */ |
25 | -class EE_Payment extends EE_Base_Class implements EEI_Payment{ |
|
25 | +class EE_Payment extends EE_Base_Class implements EEI_Payment { |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * |
29 | 29 | * @param array $props_n_values |
30 | 30 | * @return EE_Payment |
31 | 31 | */ |
32 | - public static function new_instance( $props_n_values = array() ) { |
|
33 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
34 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
32 | + public static function new_instance($props_n_values = array()) { |
|
33 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
34 | + return $has_object ? $has_object : new self($props_n_values); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * @param null $timezone |
42 | 42 | * @return EE_Payment |
43 | 43 | */ |
44 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = NULL ) { |
|
45 | - return new self( $props_n_values, TRUE, $timezone ); |
|
44 | + public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) { |
|
45 | + return new self($props_n_values, TRUE, $timezone); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | * @access public |
54 | 54 | * @param int $TXN_ID |
55 | 55 | */ |
56 | - public function set_transaction_id( $TXN_ID = 0 ) { |
|
57 | - $this->set( 'TXN_ID', $TXN_ID ); |
|
56 | + public function set_transaction_id($TXN_ID = 0) { |
|
57 | + $this->set('TXN_ID', $TXN_ID); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @return EE_Transaction |
65 | 65 | */ |
66 | 66 | public function transaction() { |
67 | - return $this->get_first_related( 'Transaction' ); |
|
67 | + return $this->get_first_related('Transaction'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @access public |
76 | 76 | * @param string $STS_ID |
77 | 77 | */ |
78 | - public function set_status( $STS_ID = '' ) { |
|
79 | - $this->set( 'STS_ID', $STS_ID ); |
|
78 | + public function set_status($STS_ID = '') { |
|
79 | + $this->set('STS_ID', $STS_ID); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | * @access public |
88 | 88 | * @param int $timestamp |
89 | 89 | */ |
90 | - public function set_timestamp( $timestamp = 0 ) { |
|
91 | - $this->set( 'PAY_timestamp', $timestamp ); |
|
90 | + public function set_timestamp($timestamp = 0) { |
|
91 | + $this->set('PAY_timestamp', $timestamp); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | * @access public |
100 | 100 | * @param string $PAY_source |
101 | 101 | */ |
102 | - public function set_source( $PAY_source = '' ) { |
|
103 | - $this->set('PAY_source',$PAY_source); |
|
102 | + public function set_source($PAY_source = '') { |
|
103 | + $this->set('PAY_source', $PAY_source); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * @access public |
112 | 112 | * @param float $amount |
113 | 113 | */ |
114 | - public function set_amount( $amount = 0.00 ) { |
|
115 | - $this->set( 'PAY_amount', $amount ); |
|
114 | + public function set_amount($amount = 0.00) { |
|
115 | + $this->set('PAY_amount', $amount); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | * @access public |
124 | 124 | * @param string $gateway_response |
125 | 125 | */ |
126 | - public function set_gateway_response( $gateway_response = '' ) { |
|
127 | - $this->set( 'PAY_gateway_response', $gateway_response ); |
|
126 | + public function set_gateway_response($gateway_response = '') { |
|
127 | + $this->set('PAY_gateway_response', $gateway_response); |
|
128 | 128 | } |
129 | 129 | /** |
130 | 130 | * Returns the name of the paymetn method used on this payment (previously known merely as 'gateway') |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | * @deprecated |
134 | 134 | * @return string |
135 | 135 | */ |
136 | - public function gateway(){ |
|
137 | - EE_Error::doing_it_wrong('EE_Payment::gateway', __( 'The method EE_Payment::gateway() has been deprecated. Consider instead using EE_Payment::payment_method()->name()', 'event_espresso' ), '4.6.0' ); |
|
138 | - if( $this->payment_method() ){ |
|
136 | + public function gateway() { |
|
137 | + EE_Error::doing_it_wrong('EE_Payment::gateway', __('The method EE_Payment::gateway() has been deprecated. Consider instead using EE_Payment::payment_method()->name()', 'event_espresso'), '4.6.0'); |
|
138 | + if ($this->payment_method()) { |
|
139 | 139 | return $this->payment_method()->name(); |
140 | - }else{ |
|
141 | - return __( 'Unknown', 'event_espresso' ); |
|
140 | + } else { |
|
141 | + return __('Unknown', 'event_espresso'); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | * @access public |
151 | 151 | * @param string $txn_id_chq_nmbr |
152 | 152 | */ |
153 | - public function set_txn_id_chq_nmbr( $txn_id_chq_nmbr = '' ) { |
|
154 | - $this->set( 'PAY_txn_id_chq_nmbr', $txn_id_chq_nmbr ); |
|
153 | + public function set_txn_id_chq_nmbr($txn_id_chq_nmbr = '') { |
|
154 | + $this->set('PAY_txn_id_chq_nmbr', $txn_id_chq_nmbr); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | * @access public |
163 | 163 | * @param string $po_number |
164 | 164 | */ |
165 | - public function set_po_number( $po_number = '' ) { |
|
166 | - $this->set( 'PAY_po_number', $po_number ); |
|
165 | + public function set_po_number($po_number = '') { |
|
166 | + $this->set('PAY_po_number', $po_number); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | * @access public |
175 | 175 | * @param string $extra_accntng |
176 | 176 | */ |
177 | - public function set_extra_accntng( $extra_accntng = '' ) { |
|
178 | - $this->set( 'PAY_extra_accntng', $extra_accntng ); |
|
177 | + public function set_extra_accntng($extra_accntng = '') { |
|
178 | + $this->set('PAY_extra_accntng', $extra_accntng); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | * @access public |
187 | 187 | * @param bool $via_admin |
188 | 188 | */ |
189 | - public function set_payment_made_via_admin( $via_admin = FALSE ) { |
|
190 | - if($via_admin){ |
|
191 | - $this->set('PAY_source', EEM_Payment_Method::scope_admin); |
|
192 | - }else{ |
|
189 | + public function set_payment_made_via_admin($via_admin = FALSE) { |
|
190 | + if ($via_admin) { |
|
191 | + $this->set('PAY_source', EEM_Payment_Method::scope_admin); |
|
192 | + } else { |
|
193 | 193 | $this->set('PAY_source', EEM_Payment_Method::scope_cart); |
194 | 194 | } |
195 | 195 | |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | * @access public |
204 | 204 | * @param string $details |
205 | 205 | */ |
206 | - public function set_details( $details = '' ) { |
|
207 | - if ( is_array( $details ) ) { |
|
208 | - array_walk_recursive( $details, array( $this, '_strip_all_tags_within_array' )); |
|
206 | + public function set_details($details = '') { |
|
207 | + if (is_array($details)) { |
|
208 | + array_walk_recursive($details, array($this, '_strip_all_tags_within_array')); |
|
209 | 209 | } else { |
210 | - $details = wp_strip_all_tags( $details ); |
|
210 | + $details = wp_strip_all_tags($details); |
|
211 | 211 | } |
212 | - $this->set( 'PAY_details', $details ); |
|
212 | + $this->set('PAY_details', $details); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * @access public |
236 | 236 | */ |
237 | 237 | public function TXN_ID() { |
238 | - return $this->get( 'TXN_ID' ); |
|
238 | + return $this->get('TXN_ID'); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | |
@@ -266,8 +266,8 @@ discard block |
||
266 | 266 | * @param null $date_or_time |
267 | 267 | * @return string |
268 | 268 | */ |
269 | - public function timestamp( $dt_frmt = '', $tm_frmt = '', $date_or_time = NULL ) { |
|
270 | - return $this->get_datetime('PAY_timestamp', $dt_frmt, $tm_frmt, $date_or_time ); |
|
269 | + public function timestamp($dt_frmt = '', $tm_frmt = '', $date_or_time = NULL) { |
|
270 | + return $this->get_datetime('PAY_timestamp', $dt_frmt, $tm_frmt, $date_or_time); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | * @return float |
289 | 289 | */ |
290 | 290 | public function amount() { |
291 | - return $this->get( 'PAY_amount' ); |
|
291 | + return $this->get('PAY_amount'); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @return mixed |
298 | 298 | */ |
299 | 299 | public function amount_no_code() { |
300 | - return $this->get_pretty( 'PAY_amount', 'no_currency_code' ); |
|
300 | + return $this->get_pretty('PAY_amount', 'no_currency_code'); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @access public |
308 | 308 | */ |
309 | 309 | public function gateway_response() { |
310 | - return $this->get( 'PAY_gateway_response' ); |
|
310 | + return $this->get('PAY_gateway_response'); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @access public |
318 | 318 | */ |
319 | 319 | public function txn_id_chq_nmbr() { |
320 | - return $this->get( 'PAY_txn_id_chq_nmbr' ); |
|
320 | + return $this->get('PAY_txn_id_chq_nmbr'); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * @access public |
328 | 328 | */ |
329 | 329 | public function po_number() { |
330 | - return $this->get( 'PAY_po_number' ); |
|
330 | + return $this->get('PAY_po_number'); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @access public |
338 | 338 | */ |
339 | 339 | public function extra_accntng() { |
340 | - return $this->get( 'PAY_extra_accntng' ); |
|
340 | + return $this->get('PAY_extra_accntng'); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | * @access public |
358 | 358 | */ |
359 | 359 | public function details() { |
360 | - return $this->get( 'PAY_details' ); |
|
360 | + return $this->get('PAY_details'); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
@@ -386,8 +386,8 @@ discard block |
||
386 | 386 | * @param bool $show_icons |
387 | 387 | * @return void |
388 | 388 | */ |
389 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
390 | - echo $this->pretty_status( $show_icons ); |
|
389 | + public function e_pretty_status($show_icons = FALSE) { |
|
390 | + echo $this->pretty_status($show_icons); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | |
@@ -397,10 +397,10 @@ discard block |
||
397 | 397 | * @param bool $show_icons |
398 | 398 | * @return string |
399 | 399 | */ |
400 | - public function pretty_status( $show_icons = FALSE ) { |
|
401 | - $status = EEM_Status::instance()->localized_status( array( $this->STS_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
400 | + public function pretty_status($show_icons = FALSE) { |
|
401 | + $status = EEM_Status::instance()->localized_status(array($this->STS_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
402 | 402 | $icon = ''; |
403 | - switch ( $this->STS_ID() ) { |
|
403 | + switch ($this->STS_ID()) { |
|
404 | 404 | case EEM_Payment::status_id_approved: |
405 | 405 | $icon = $show_icons ? '<span class="dashicons dashicons-yes ee-icon-size-24 green-text"></span>' : ''; |
406 | 406 | break; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : ''; |
415 | 415 | break; |
416 | 416 | } |
417 | - return $icon . $status[ $this->STS_ID() ]; |
|
417 | + return $icon.$status[$this->STS_ID()]; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | * @return boolean whether the payment is approved or not |
426 | 426 | */ |
427 | 427 | public function is_approved() { |
428 | - return $this->status_is( EEM_Payment::status_id_approved ); |
|
428 | + return $this->status_is(EEM_Payment::status_id_approved); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | |
@@ -437,8 +437,8 @@ discard block |
||
437 | 437 | * one of the status_id_* on the EEM_Payment model |
438 | 438 | * @return boolean whether the status of this payment equals the status id |
439 | 439 | */ |
440 | - protected function status_is( $STS_ID ) { |
|
441 | - if ( $STS_ID == $this->STS_ID() ) { |
|
440 | + protected function status_is($STS_ID) { |
|
441 | + if ($STS_ID == $this->STS_ID()) { |
|
442 | 442 | return TRUE; |
443 | 443 | } else { |
444 | 444 | return FALSE; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | * @return boolean whether the payment is pending or not |
453 | 453 | */ |
454 | 454 | public function is_pending() { |
455 | - return $this->status_is( EEM_Payment::status_id_pending ); |
|
455 | + return $this->status_is(EEM_Payment::status_id_pending); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | * @return boolean |
463 | 463 | */ |
464 | 464 | public function is_cancelled() { |
465 | - return $this->status_is( EEM_Payment::status_id_cancelled ); |
|
465 | + return $this->status_is(EEM_Payment::status_id_cancelled); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | * @return boolean |
473 | 473 | */ |
474 | 474 | public function is_declined() { |
475 | - return $this->status_is( EEM_Payment::status_id_declined ); |
|
475 | + return $this->status_is(EEM_Payment::status_id_declined); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | * @return boolean |
483 | 483 | */ |
484 | 484 | public function is_failed() { |
485 | - return $this->status_is( EEM_Payment::status_id_failed ); |
|
485 | + return $this->status_is(EEM_Payment::status_id_failed); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * @return EE_Status |
503 | 503 | */ |
504 | 504 | public function status_obj() { |
505 | - return $this->get_first_related( 'Status' ); |
|
505 | + return $this->get_first_related('Status'); |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | |
@@ -512,8 +512,8 @@ discard block |
||
512 | 512 | * @param array $query_params like EEM_Base::get_all |
513 | 513 | * @return EE_Extra_Meta |
514 | 514 | */ |
515 | - public function extra_meta( $query_params = array() ) { |
|
516 | - return $this->get_many_related( 'Extra_Meta', $query_params ); |
|
515 | + public function extra_meta($query_params = array()) { |
|
516 | + return $this->get_many_related('Extra_Meta', $query_params); |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | * offline ones, dont' create payments) |
525 | 525 | * @return EE_Payment_Method |
526 | 526 | */ |
527 | - function payment_method(){ |
|
527 | + function payment_method() { |
|
528 | 528 | return $this->get_first_related('Payment_Method'); |
529 | 529 | } |
530 | 530 | |
@@ -539,12 +539,12 @@ discard block |
||
539 | 539 | * @param string $inside_form_html |
540 | 540 | * @return string html |
541 | 541 | */ |
542 | - function redirect_form( $inside_form_html = NULL ) { |
|
542 | + function redirect_form($inside_form_html = NULL) { |
|
543 | 543 | $redirect_url = $this->redirect_url(); |
544 | - if ( ! empty( $redirect_url )) { |
|
544 | + if ( ! empty($redirect_url)) { |
|
545 | 545 | EE_Registry::instance()->load_helper('HTML'); |
546 | 546 | // what ? no inner form content? |
547 | - if( $inside_form_html === NULL ) { |
|
547 | + if ($inside_form_html === NULL) { |
|
548 | 548 | $inside_form_html = EEH_HTML::p( |
549 | 549 | sprintf( |
550 | 550 | __('If you are not automatically redirected to the payment website within 10 seconds... %1$s %2$s Click Here %3$s', 'event_espresso'), |
@@ -556,10 +556,10 @@ discard block |
||
556 | 556 | ); |
557 | 557 | } |
558 | 558 | $method = $this->redirect_args() ? 'POST' : 'GET'; |
559 | - $form = EEH_HTML::nl(1) . '<form method="' . $method . '" name="gateway_form" action="' . $redirect_url . '">'; |
|
560 | - $form .= EEH_HTML::nl(1) . $this->redirect_args_as_inputs(); |
|
559 | + $form = EEH_HTML::nl(1).'<form method="'.$method.'" name="gateway_form" action="'.$redirect_url.'">'; |
|
560 | + $form .= EEH_HTML::nl(1).$this->redirect_args_as_inputs(); |
|
561 | 561 | $form .= $inside_form_html; |
562 | - $form .= EEH_HTML::nl(-1) . '</form>' . EEH_HTML::nl(-1); |
|
562 | + $form .= EEH_HTML::nl(-1).'</form>'.EEH_HTML::nl(-1); |
|
563 | 563 | return $form; |
564 | 564 | } else { |
565 | 565 | return NULL; |
@@ -573,12 +573,12 @@ discard block |
||
573 | 573 | * Changes all the name-value pairs of |
574 | 574 | * @return string |
575 | 575 | */ |
576 | - function redirect_args_as_inputs(){ |
|
576 | + function redirect_args_as_inputs() { |
|
577 | 577 | $html = ''; |
578 | - if( $this->redirect_args() !== NULL && is_array( $this->redirect_args() )) { |
|
578 | + if ($this->redirect_args() !== NULL && is_array($this->redirect_args())) { |
|
579 | 579 | EE_Registry::instance()->load_helper('HTML'); |
580 | - foreach($this->redirect_args() as $name => $value){ |
|
581 | - $html .= EEH_HTML::nl(0) . '<input type="hidden" name="' . $name . '" value="' . esc_attr( $value ) . '"/>'; |
|
580 | + foreach ($this->redirect_args() as $name => $value) { |
|
581 | + $html .= EEH_HTML::nl(0).'<input type="hidden" name="'.$name.'" value="'.esc_attr($value).'"/>'; |
|
582 | 582 | } |
583 | 583 | } |
584 | 584 | return $html; |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | * object itself) |
594 | 594 | * @return string for the currency code |
595 | 595 | */ |
596 | - public function currency_code(){ |
|
596 | + public function currency_code() { |
|
597 | 597 | return EE_Config::instance()->currency->code; |
598 | 598 | } |
599 | 599 | |
@@ -607,14 +607,14 @@ discard block |
||
607 | 607 | * @access private |
608 | 608 | * @param mixed $item |
609 | 609 | */ |
610 | - private function _strip_all_tags_within_array( &$item ) { |
|
611 | - if( is_object( $item ) ) { |
|
610 | + private function _strip_all_tags_within_array(&$item) { |
|
611 | + if (is_object($item)) { |
|
612 | 612 | $item = (array) $item; |
613 | 613 | } |
614 | - if( is_array( $item ) ){ |
|
615 | - array_walk_recursive( $item, array( $this, '_strip_all_tags_within_array' ) ); |
|
616 | - }else{ |
|
617 | - $item = wp_strip_all_tags( $item ); |
|
614 | + if (is_array($item)) { |
|
615 | + array_walk_recursive($item, array($this, '_strip_all_tags_within_array')); |
|
616 | + } else { |
|
617 | + $item = wp_strip_all_tags($item); |
|
618 | 618 | } |
619 | 619 | } |
620 | 620 | |
@@ -623,13 +623,13 @@ discard block |
||
623 | 623 | * is approved and was created during this request). False otherwise. |
624 | 624 | * @return boolean |
625 | 625 | */ |
626 | - public function just_approved(){ |
|
627 | - EE_Registry::instance()->load_helper( 'Array' ); |
|
628 | - $original_status =EEH_Array::is_set( $this->_props_n_values_provided_in_constructor, 'STS_ID', $this->get_model()->field_settings_for( 'STS_ID' )->get_default_value() ); |
|
626 | + public function just_approved() { |
|
627 | + EE_Registry::instance()->load_helper('Array'); |
|
628 | + $original_status = EEH_Array::is_set($this->_props_n_values_provided_in_constructor, 'STS_ID', $this->get_model()->field_settings_for('STS_ID')->get_default_value()); |
|
629 | 629 | $current_status = $this->status(); |
630 | - if( $original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved ){ |
|
630 | + if ($original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved) { |
|
631 | 631 | return TRUE; |
632 | - }else{ |
|
632 | + } else { |
|
633 | 633 | return FALSE; |
634 | 634 | } |
635 | 635 | } |
@@ -641,11 +641,11 @@ discard block |
||
641 | 641 | * @param string $extra_cache_ref This allows the user to specify an extra cache ref for the given property (in cases where the same property may be used for different outputs - i.e. datetime, money etc.) |
642 | 642 | * @return mixed |
643 | 643 | */ |
644 | - public function get_pretty($field_name, $extra_cache_ref = NULL){ |
|
645 | - if( $field_name == 'PAY_gateway' ){ |
|
644 | + public function get_pretty($field_name, $extra_cache_ref = NULL) { |
|
645 | + if ($field_name == 'PAY_gateway') { |
|
646 | 646 | return $this->gateway(); |
647 | 647 | } |
648 | - return $this->_get_cached_property( $field_name, TRUE, $extra_cache_ref ); |
|
648 | + return $this->_get_cached_property($field_name, TRUE, $extra_cache_ref); |
|
649 | 649 | } |
650 | 650 | } |
651 | 651 |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | |
363 | 363 | /** |
364 | 364 | * Gets redirect_url |
365 | - * @return string |
|
365 | + * @return boolean |
|
366 | 366 | */ |
367 | 367 | function redirect_url() { |
368 | 368 | return $this->get('PAY_redirect_url'); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | |
373 | 373 | /** |
374 | 374 | * Gets redirect_args |
375 | - * @return array |
|
375 | + * @return boolean |
|
376 | 376 | */ |
377 | 377 | function redirect_args() { |
378 | 378 | return $this->get('PAY_redirect_args'); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | /** |
500 | 500 | * Gets all the extra meta info on this payment |
501 | 501 | * @param array $query_params like EEM_Base::get_all |
502 | - * @return EE_Extra_Meta |
|
502 | + * @return EE_Base_Class[] |
|
503 | 503 | */ |
504 | 504 | public function extra_meta( $query_params = array() ) { |
505 | 505 | return $this->get_many_related( 'Extra_Meta', $query_params ); |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | |
100 | 100 | |
101 | 101 | /** |
102 | - * Set Payment Method |
|
103 | - * |
|
104 | - * @access public |
|
105 | - * @param string $PAY_source |
|
106 | - */ |
|
102 | + * Set Payment Method |
|
103 | + * |
|
104 | + * @access public |
|
105 | + * @param string $PAY_source |
|
106 | + */ |
|
107 | 107 | public function set_source( $PAY_source = '' ) { |
108 | 108 | $this->set('PAY_source',$PAY_source); |
109 | 109 | } |
@@ -246,16 +246,16 @@ discard block |
||
246 | 246 | |
247 | 247 | |
248 | 248 | /** |
249 | - * get Payment Status |
|
250 | - * @access public |
|
251 | - */ |
|
249 | + * get Payment Status |
|
250 | + * @access public |
|
251 | + */ |
|
252 | 252 | public function status() { |
253 | 253 | return $this->get('STS_ID'); |
254 | 254 | } |
255 | 255 | /** |
256 | - * get Payment Status |
|
257 | - * @access public |
|
258 | - */ |
|
256 | + * get Payment Status |
|
257 | + * @access public |
|
258 | + */ |
|
259 | 259 | public function STS_ID() { |
260 | 260 | return $this->get('STS_ID'); |
261 | 261 | } |
@@ -278,9 +278,9 @@ discard block |
||
278 | 278 | |
279 | 279 | |
280 | 280 | /** |
281 | - * get Payment Source |
|
282 | - * @access public |
|
283 | - */ |
|
281 | + * get Payment Source |
|
282 | + * @access public |
|
283 | + */ |
|
284 | 284 | public function source() { |
285 | 285 | return $this->get('PAY_source'); |
286 | 286 | } |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | |
349 | 349 | |
350 | 350 | /** |
351 | - * get Payment made via admin source |
|
352 | - * @access public |
|
353 | - */ |
|
351 | + * get Payment made via admin source |
|
352 | + * @access public |
|
353 | + */ |
|
354 | 354 | public function payment_made_via_admin() { |
355 | 355 | return ($this->get('PAY_source') == EEM_Payment_Method::scope_admin); |
356 | 356 | } |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Required by EEM_Question_Group_Question in case someone queries for all its model objects |
4 | 4 | */ |
5 | -class EE_Question_Group_Question extends EE_Base_Class{ |
|
5 | +class EE_Question_Group_Question extends EE_Base_Class { |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * @param array $props_n_values |
9 | 9 | * @return EE_Question_Group_Question|mixed |
10 | 10 | */ |
11 | - public static function new_instance( $props_n_values = array() ) { |
|
12 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
13 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
11 | + public static function new_instance($props_n_values = array()) { |
|
12 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
13 | + return $has_object ? $has_object : new self($props_n_values); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @param array $props_n_values |
20 | 20 | * @return EE_Question_Group_Question |
21 | 21 | */ |
22 | - public static function new_instance_from_db ( $props_n_values = array() ) { |
|
23 | - return new self( $props_n_values, TRUE ); |
|
22 | + public static function new_instance_from_db($props_n_values = array()) { |
|
23 | + return new self($props_n_values, TRUE); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
127 | 127 | do_action( 'AHEE__EE_Registration__set_status__after_update', $this ); |
128 | 128 | return TRUE; |
129 | - }else{ |
|
129 | + } else{ |
|
130 | 130 | //even though the old value matches the new value, it's still good to |
131 | 131 | //allow the parent set method to have a say |
132 | 132 | parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
@@ -625,8 +625,9 @@ discard block |
||
625 | 625 | * @return EE_Registration |
626 | 626 | */ |
627 | 627 | public function get_primary_registration() { |
628 | - if ( $this->is_primary_registrant() ) |
|
629 | - return $this; |
|
628 | + if ( $this->is_primary_registrant() ) { |
|
629 | + return $this; |
|
630 | + } |
|
630 | 631 | |
631 | 632 | //k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1 |
632 | 633 | $primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * EE_Registration class |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | * @param string $timezone |
17 | 17 | * @return EE_Registration |
18 | 18 | */ |
19 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
20 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
21 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
19 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
20 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
21 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | * @param string $timezone |
29 | 29 | * @return EE_Registration |
30 | 30 | */ |
31 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
32 | - return new self( $props_n_values, TRUE, $timezone ); |
|
31 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
32 | + return new self($props_n_values, TRUE, $timezone); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | * @access public |
41 | 41 | * @param int $EVT_ID Event ID |
42 | 42 | */ |
43 | - public function set_event( $EVT_ID = 0 ) { |
|
44 | - $this->set( 'EVT_ID', $EVT_ID ); |
|
43 | + public function set_event($EVT_ID = 0) { |
|
44 | + $this->set('EVT_ID', $EVT_ID); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -52,18 +52,18 @@ discard block |
||
52 | 52 | * @param mixed $field_value |
53 | 53 | * @param bool $use_default |
54 | 54 | */ |
55 | - public function set( $field_name, $field_value, $use_default = FALSE ) { |
|
56 | - switch( $field_name ) { |
|
55 | + public function set($field_name, $field_value, $use_default = FALSE) { |
|
56 | + switch ($field_name) { |
|
57 | 57 | case 'REG_code' : |
58 | - if ( ! empty( $field_value ) && $this->reg_code() == '' ) { |
|
59 | - $this->set_reg_code( $field_value, $use_default ); |
|
58 | + if ( ! empty($field_value) && $this->reg_code() == '') { |
|
59 | + $this->set_reg_code($field_value, $use_default); |
|
60 | 60 | } |
61 | 61 | break; |
62 | 62 | case 'STS_ID' : |
63 | - $this->set_status( $field_value, $use_default ); |
|
63 | + $this->set_status($field_value, $use_default); |
|
64 | 64 | break; |
65 | 65 | default : |
66 | - parent::set( $field_name, $field_value, $use_default ); |
|
66 | + parent::set($field_name, $field_value, $use_default); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
@@ -80,30 +80,30 @@ discard block |
||
80 | 80 | * @param boolean $use_default |
81 | 81 | * @return bool |
82 | 82 | */ |
83 | - public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) { |
|
83 | + public function set_status($new_STS_ID = NULL, $use_default = FALSE) { |
|
84 | 84 | // get current REG_Status |
85 | 85 | $old_STS_ID = $this->status_ID(); |
86 | 86 | // if status has changed |
87 | - if ( $old_STS_ID != $new_STS_ID ) { |
|
87 | + if ($old_STS_ID != $new_STS_ID) { |
|
88 | 88 | // TO approved |
89 | - if ( $new_STS_ID == EEM_Registration::status_id_approved ) { |
|
89 | + if ($new_STS_ID == EEM_Registration::status_id_approved) { |
|
90 | 90 | // reserve a space by incrementing ticket and datetime sold values |
91 | 91 | $this->_reserve_registration_space(); |
92 | - do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
92 | + do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID); |
|
93 | 93 | // OR FROM approved |
94 | - } else if ( $old_STS_ID == EEM_Registration::status_id_approved ) { |
|
94 | + } else if ($old_STS_ID == EEM_Registration::status_id_approved) { |
|
95 | 95 | // release a space by decrementing ticket and datetime sold values |
96 | 96 | $this->_release_registration_space(); |
97 | - do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
97 | + do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID); |
|
98 | 98 | } |
99 | 99 | // update status |
100 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
101 | - do_action( 'AHEE__EE_Registration__set_status__after_update', $this ); |
|
100 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
101 | + do_action('AHEE__EE_Registration__set_status__after_update', $this); |
|
102 | 102 | return TRUE; |
103 | - }else{ |
|
103 | + } else { |
|
104 | 104 | //even though the old value matches the new value, it's still good to |
105 | 105 | //allow the parent set method to have a say |
106 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
106 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
107 | 107 | return TRUE; |
108 | 108 | } |
109 | 109 | return FALSE; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @access public |
117 | 117 | */ |
118 | 118 | public function status_ID() { |
119 | - return $this->get( 'STS_ID' ); |
|
119 | + return $this->get('STS_ID'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | $ticket->increase_sold(); |
131 | 131 | $ticket->save(); |
132 | 132 | $datetimes = $ticket->datetimes(); |
133 | - if ( is_array( $datetimes ) ) { |
|
134 | - foreach ( $datetimes as $datetime ) { |
|
135 | - if ( $datetime instanceof EE_Datetime ) { |
|
133 | + if (is_array($datetimes)) { |
|
134 | + foreach ($datetimes as $datetime) { |
|
135 | + if ($datetime instanceof EE_Datetime) { |
|
136 | 136 | $datetime->increase_sold(); |
137 | 137 | $datetime->save(); |
138 | 138 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | * @param boolean $include_archived whether to include archived tickets or not. |
151 | 151 | * @return EE_Ticket |
152 | 152 | */ |
153 | - public function ticket( $include_archived = TRUE ) { |
|
153 | + public function ticket($include_archived = TRUE) { |
|
154 | 154 | $query_params = array(); |
155 | - if ( $include_archived ) { |
|
156 | - $query_params[ 'default_where_conditions' ] = 'none'; |
|
155 | + if ($include_archived) { |
|
156 | + $query_params['default_where_conditions'] = 'none'; |
|
157 | 157 | } |
158 | - return $this->get_first_related( 'Ticket', $query_params ); |
|
158 | + return $this->get_first_related('Ticket', $query_params); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @return EE_Event |
166 | 166 | */ |
167 | 167 | public function event() { |
168 | - return $this->get_first_related( 'Event' ); |
|
168 | + return $this->get_first_related('Event'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function wp_user() { |
181 | 181 | $event = $this->event(); |
182 | - if ( $event instanceof EE_Event ) { |
|
182 | + if ($event instanceof EE_Event) { |
|
183 | 183 | return $event->wp_user(); |
184 | 184 | } |
185 | 185 | return 0; |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | $ticket->decrease_sold(); |
197 | 197 | $ticket->save(); |
198 | 198 | $datetimes = $ticket->datetimes(); |
199 | - if ( is_array( $datetimes ) ) { |
|
200 | - foreach ( $datetimes as $datetime ) { |
|
201 | - if ( $datetime instanceof EE_Datetime ) { |
|
199 | + if (is_array($datetimes)) { |
|
200 | + foreach ($datetimes as $datetime) { |
|
201 | + if ($datetime instanceof EE_Datetime) { |
|
202 | 202 | $datetime->decrease_sold(); |
203 | 203 | $datetime->save(); |
204 | 204 | } |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | * @access public |
215 | 215 | * @param int $ATT_ID Attendee ID |
216 | 216 | */ |
217 | - public function set_attendee_id( $ATT_ID = 0 ) { |
|
218 | - $this->set( 'ATT_ID', $ATT_ID ); |
|
217 | + public function set_attendee_id($ATT_ID = 0) { |
|
218 | + $this->set('ATT_ID', $ATT_ID); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | * @access public |
227 | 227 | * @param int $TXN_ID Transaction ID |
228 | 228 | */ |
229 | - public function set_transaction_id( $TXN_ID = 0 ) { |
|
230 | - $this->set( 'TXN_ID', $TXN_ID ); |
|
229 | + public function set_transaction_id($TXN_ID = 0) { |
|
230 | + $this->set('TXN_ID', $TXN_ID); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | * @access public |
239 | 239 | * @param string $REG_session PHP Session ID |
240 | 240 | */ |
241 | - public function set_session( $REG_session = '' ) { |
|
242 | - $this->set( 'REG_session', $REG_session ); |
|
241 | + public function set_session($REG_session = '') { |
|
242 | + $this->set('REG_session', $REG_session); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | |
@@ -250,8 +250,8 @@ discard block |
||
250 | 250 | * @access public |
251 | 251 | * @param string $REG_url_link Registration URL Link |
252 | 252 | */ |
253 | - public function set_reg_url_link( $REG_url_link = '' ) { |
|
254 | - $this->set( 'REG_url_link', $REG_url_link ); |
|
253 | + public function set_reg_url_link($REG_url_link = '') { |
|
254 | + $this->set('REG_url_link', $REG_url_link); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | * @access public |
263 | 263 | * @param int $REG_count Primary Attendee |
264 | 264 | */ |
265 | - public function set_count( $REG_count = 1 ) { |
|
266 | - $this->set( 'REG_count', $REG_count ); |
|
265 | + public function set_count($REG_count = 1) { |
|
266 | + $this->set('REG_count', $REG_count); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | * @access public |
275 | 275 | * @param boolean $REG_group_size Group Registration |
276 | 276 | */ |
277 | - public function set_group_size( $REG_group_size = FALSE ) { |
|
278 | - $this->set( 'REG_group_size', $REG_group_size ); |
|
277 | + public function set_group_size($REG_group_size = FALSE) { |
|
278 | + $this->set('REG_group_size', $REG_group_size); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -358,8 +358,8 @@ discard block |
||
358 | 358 | * @access public |
359 | 359 | * @param mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date |
360 | 360 | */ |
361 | - public function set_reg_date( $REG_date = FALSE ) { |
|
362 | - $this->set( 'REG_date', $REG_date ); |
|
361 | + public function set_reg_date($REG_date = FALSE) { |
|
362 | + $this->set('REG_date', $REG_date); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | |
@@ -370,8 +370,8 @@ discard block |
||
370 | 370 | * @access public |
371 | 371 | * @param float $REG_final_price |
372 | 372 | */ |
373 | - public function set_price_paid( $REG_final_price = 0.00 ) { |
|
374 | - $this->set( 'REG_final_price', $REG_final_price ); |
|
373 | + public function set_price_paid($REG_final_price = 0.00) { |
|
374 | + $this->set('REG_final_price', $REG_final_price); |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | * @return string of price, with correct decimal places and currency symbol |
381 | 381 | */ |
382 | 382 | public function pretty_price_paid() { |
383 | - return $this->get_pretty( 'REG_final_price' ); |
|
383 | + return $this->get_pretty('REG_final_price'); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | * @access public |
392 | 392 | * @param boolean $REG_att_is_going Attendee Is Going |
393 | 393 | */ |
394 | - public function set_att_is_going( $REG_att_is_going = FALSE ) { |
|
395 | - $this->set( 'REG_att_is_going', $REG_att_is_going ); |
|
394 | + public function set_att_is_going($REG_att_is_going = FALSE) { |
|
395 | + $this->set('REG_att_is_going', $REG_att_is_going); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | * @return EE_Attendee |
403 | 403 | */ |
404 | 404 | public function attendee() { |
405 | - return $this->get_first_related( 'Attendee' ); |
|
405 | + return $this->get_first_related('Attendee'); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @access public |
413 | 413 | */ |
414 | 414 | public function event_ID() { |
415 | - return $this->get( 'EVT_ID' ); |
|
415 | + return $this->get('EVT_ID'); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | */ |
424 | 424 | public function event_name() { |
425 | 425 | $event = $this->event_obj(); |
426 | - if ( $event ) { |
|
426 | + if ($event) { |
|
427 | 427 | return $event->name(); |
428 | 428 | } else { |
429 | 429 | return NULL; |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * @return EE_Event |
438 | 438 | */ |
439 | 439 | public function event_obj() { |
440 | - return $this->get_first_related( 'Event' ); |
|
440 | + return $this->get_first_related('Event'); |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | * @access public |
448 | 448 | */ |
449 | 449 | public function attendee_ID() { |
450 | - return $this->get( 'ATT_ID' ); |
|
450 | + return $this->get('ATT_ID'); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | * @access public |
458 | 458 | */ |
459 | 459 | public function session_ID() { |
460 | - return $this->get( 'REG_session' ); |
|
460 | + return $this->get('REG_session'); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
468 | 468 | * @return string |
469 | 469 | */ |
470 | - public function receipt_url( $messenger = 'html' ) { |
|
470 | + public function receipt_url($messenger = 'html') { |
|
471 | 471 | |
472 | 472 | /** |
473 | 473 | * The below will be deprecated one version after this. We check first if there is a custom receipt template already in use on old system. If there is then we just return the standard url for it. |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | */ |
477 | 477 | EE_Registry::instance()->load_helper('Template'); |
478 | 478 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php'; |
479 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
479 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
480 | 480 | |
481 | - if ( $has_custom ) { |
|
482 | - return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) ); |
|
481 | + if ($has_custom) { |
|
482 | + return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch')); |
|
483 | 483 | } |
484 | - return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' ); |
|
484 | + return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt'); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
493 | 493 | * @return string |
494 | 494 | */ |
495 | - public function invoice_url( $messenger = 'html' ) { |
|
495 | + public function invoice_url($messenger = 'html') { |
|
496 | 496 | /** |
497 | 497 | * The below will be deprecated one version after this. We check first if there is a custom invoice template already in use on old system. If there is then we just return the standard url for it. |
498 | 498 | * |
@@ -500,21 +500,21 @@ discard block |
||
500 | 500 | */ |
501 | 501 | EE_Registry::instance()->load_helper('Template'); |
502 | 502 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php'; |
503 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
503 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
504 | 504 | |
505 | - if ( $has_custom ) { |
|
506 | - if ( $messenger == 'html' ) { |
|
507 | - return $this->invoice_url( 'launch' ); |
|
505 | + if ($has_custom) { |
|
506 | + if ($messenger == 'html') { |
|
507 | + return $this->invoice_url('launch'); |
|
508 | 508 | } |
509 | 509 | $route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice'; |
510 | 510 | |
511 | - $query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() ); |
|
512 | - if ( $messenger == 'html' ) { |
|
511 | + $query_args = array('ee' => $route, 'id' => $this->reg_url_link()); |
|
512 | + if ($messenger == 'html') { |
|
513 | 513 | $query_args['html'] = TRUE; |
514 | 514 | } |
515 | - return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) ); |
|
515 | + return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id)); |
|
516 | 516 | } |
517 | - return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' ); |
|
517 | + return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice'); |
|
518 | 518 | } |
519 | 519 | |
520 | 520 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | * @access public |
525 | 525 | */ |
526 | 526 | public function reg_url_link() { |
527 | - return $this->get( 'REG_url_link' ); |
|
527 | + return $this->get('REG_url_link'); |
|
528 | 528 | } |
529 | 529 | |
530 | 530 | |
@@ -534,8 +534,8 @@ discard block |
||
534 | 534 | * @param string $type 'download','launch', or 'html' (default is 'launch') |
535 | 535 | * @return void |
536 | 536 | */ |
537 | - public function e_invoice_url( $type = 'launch' ) { |
|
538 | - echo $this->invoice_url( $type ); |
|
537 | + public function e_invoice_url($type = 'launch') { |
|
538 | + echo $this->invoice_url($type); |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | * @return string |
556 | 556 | */ |
557 | 557 | public function payment_overview_url() { |
558 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), get_permalink( EE_Registry::instance()->CFG->core->reg_page_id ) ); |
|
558 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), get_permalink(EE_Registry::instance()->CFG->core->reg_page_id)); |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | * @return string |
567 | 567 | */ |
568 | 568 | public function edit_attendee_information_url() { |
569 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), get_permalink( EE_Registry::instance()->CFG->core->reg_page_id ) ); |
|
569 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), get_permalink(EE_Registry::instance()->CFG->core->reg_page_id)); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | |
@@ -576,8 +576,8 @@ discard block |
||
576 | 576 | * @return string |
577 | 577 | */ |
578 | 578 | public function get_admin_edit_url() { |
579 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
580 | - return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) ); |
|
579 | + EE_Registry::instance()->load_helper('URL'); |
|
580 | + return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php')); |
|
581 | 581 | } |
582 | 582 | |
583 | 583 | |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | * @access public |
588 | 588 | */ |
589 | 589 | public function is_primary_registrant() { |
590 | - return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE; |
|
590 | + return $this->get('REG_count') == 1 ? TRUE : FALSE; |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | |
@@ -596,12 +596,12 @@ discard block |
||
596 | 596 | * This returns the primary registration object for this registration group (which may be this object). |
597 | 597 | * @return EE_Registration |
598 | 598 | */ |
599 | - public function get_primary_registration() { |
|
600 | - if ( $this->is_primary_registrant() ) |
|
599 | + public function get_primary_registration() { |
|
600 | + if ($this->is_primary_registrant()) |
|
601 | 601 | return $this; |
602 | 602 | |
603 | 603 | //k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1 |
604 | - $primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) ); |
|
604 | + $primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1))); |
|
605 | 605 | return $primary_registrant; |
606 | 606 | } |
607 | 607 | |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | * @access public |
613 | 613 | */ |
614 | 614 | public function count() { |
615 | - return $this->get( 'REG_count' ); |
|
615 | + return $this->get('REG_count'); |
|
616 | 616 | } |
617 | 617 | |
618 | 618 | |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * @access public |
623 | 623 | */ |
624 | 624 | public function group_size() { |
625 | - return $this->get( 'REG_group_size' ); |
|
625 | + return $this->get('REG_group_size'); |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | * @access public |
633 | 633 | */ |
634 | 634 | public function date() { |
635 | - return $this->get( 'REG_date' ); |
|
635 | + return $this->get('REG_date'); |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | |
@@ -643,8 +643,8 @@ discard block |
||
643 | 643 | * @param string $time_format |
644 | 644 | * @return string |
645 | 645 | */ |
646 | - public function pretty_date( $date_format = NULL, $time_format = NULL ) { |
|
647 | - return $this->get_datetime( 'REG_date', $date_format, $time_format ); |
|
646 | + public function pretty_date($date_format = NULL, $time_format = NULL) { |
|
647 | + return $this->get_datetime('REG_date', $date_format, $time_format); |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | * @access public |
655 | 655 | */ |
656 | 656 | public function price_paid() { |
657 | - return $this->get( 'REG_final_price' ); |
|
657 | + return $this->get('REG_final_price'); |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | |
@@ -664,8 +664,8 @@ discard block |
||
664 | 664 | * @param bool $show_icons |
665 | 665 | * @return void |
666 | 666 | */ |
667 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
668 | - echo $this->pretty_status( $show_icons ); |
|
667 | + public function e_pretty_status($show_icons = FALSE) { |
|
668 | + echo $this->pretty_status($show_icons); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | |
@@ -676,10 +676,10 @@ discard block |
||
676 | 676 | * @param bool $show_icons |
677 | 677 | * @return string |
678 | 678 | */ |
679 | - public function pretty_status( $show_icons = FALSE ) { |
|
680 | - $status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
679 | + public function pretty_status($show_icons = FALSE) { |
|
680 | + $status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
681 | 681 | $icon = ''; |
682 | - switch ( $this->status_ID() ) { |
|
682 | + switch ($this->status_ID()) { |
|
683 | 683 | case EEM_Registration::status_id_approved: |
684 | 684 | $icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : ''; |
685 | 685 | break; |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | $icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : ''; |
700 | 700 | break; |
701 | 701 | } |
702 | - return $icon . $status[ $this->status_ID() ]; |
|
702 | + return $icon.$status[$this->status_ID()]; |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | * @access public |
710 | 710 | */ |
711 | 711 | public function att_is_going() { |
712 | - return $this->get( 'REG_att_is_going' ); |
|
712 | + return $this->get('REG_att_is_going'); |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | |
@@ -719,8 +719,8 @@ discard block |
||
719 | 719 | * @param array $query_params like EEM_Base::get_all |
720 | 720 | * @return EE_Answer[] |
721 | 721 | */ |
722 | - public function answers( $query_params = NULL ) { |
|
723 | - return $this->get_many_related( 'Answer', $query_params ); |
|
722 | + public function answers($query_params = NULL) { |
|
723 | + return $this->get_many_related('Answer', $query_params); |
|
724 | 724 | } |
725 | 725 | |
726 | 726 | |
@@ -734,9 +734,9 @@ discard block |
||
734 | 734 | * (because the answer might be an array of answer values, so passing pretty_value=true |
735 | 735 | * will convert it into some kind of string) |
736 | 736 | */ |
737 | - public function answer_value_to_question( $question, $pretty_value=true ) { |
|
737 | + public function answer_value_to_question($question, $pretty_value = true) { |
|
738 | 738 | $question_id = EEM_Question::instance()->ensure_is_ID($question); |
739 | - return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value); |
|
739 | + return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value); |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | /** |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | * @return string |
746 | 746 | */ |
747 | 747 | public function reg_date() { |
748 | - return $this->get_datetime( 'REG_date' ); |
|
748 | + return $this->get_datetime('REG_date'); |
|
749 | 749 | } |
750 | 750 | |
751 | 751 | |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | * @return EE_Datetime_Ticket |
758 | 758 | */ |
759 | 759 | public function datetime_ticket() { |
760 | - return $this->get_first_related( 'Datetime_Ticket' ); |
|
760 | + return $this->get_first_related('Datetime_Ticket'); |
|
761 | 761 | } |
762 | 762 | |
763 | 763 | |
@@ -767,15 +767,15 @@ discard block |
||
767 | 767 | * @param EE_Datetime_Ticket $datetime_ticket |
768 | 768 | * @return EE_Datetime_Ticket |
769 | 769 | */ |
770 | - public function set_datetime_ticket( $datetime_ticket ) { |
|
771 | - return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' ); |
|
770 | + public function set_datetime_ticket($datetime_ticket) { |
|
771 | + return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket'); |
|
772 | 772 | } |
773 | 773 | /** |
774 | 774 | * Gets deleted |
775 | 775 | * @return boolean |
776 | 776 | */ |
777 | 777 | public function deleted() { |
778 | - return $this->get( 'REG_deleted' ); |
|
778 | + return $this->get('REG_deleted'); |
|
779 | 779 | } |
780 | 780 | |
781 | 781 | /** |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | * @return boolean |
785 | 785 | */ |
786 | 786 | public function set_deleted($deleted) { |
787 | - $this->set( 'REG_deleted', $deleted ); |
|
787 | + $this->set('REG_deleted', $deleted); |
|
788 | 788 | } |
789 | 789 | |
790 | 790 | |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | * @return EE_Status |
795 | 795 | */ |
796 | 796 | public function status_obj() { |
797 | - return $this->get_first_related( 'Status' ); |
|
797 | + return $this->get_first_related('Status'); |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | * @return int |
806 | 806 | */ |
807 | 807 | public function count_checkins() { |
808 | - return $this->get_model()->count_related( $this, 'Checkin' ); |
|
808 | + return $this->get_model()->count_related($this, 'Checkin'); |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | * @return int |
816 | 816 | */ |
817 | 817 | public function count_checkins_not_checkedout() { |
818 | - return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) ); |
|
818 | + return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1))); |
|
819 | 819 | } |
820 | 820 | |
821 | 821 | |
@@ -828,15 +828,15 @@ discard block |
||
828 | 828 | * |
829 | 829 | * @return bool |
830 | 830 | */ |
831 | - public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) { |
|
832 | - $DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID ); |
|
831 | + public function can_checkin($DTT_OR_ID, $check_approved = TRUE) { |
|
832 | + $DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID); |
|
833 | 833 | |
834 | 834 | //first check registration status |
835 | - if ( $check_approved && ! $this->is_approved() ) { |
|
835 | + if ($check_approved && ! $this->is_approved()) { |
|
836 | 836 | return false; |
837 | 837 | } |
838 | 838 | //is there a datetime ticket that matches this dtt_ID? |
839 | - return EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) ); |
|
839 | + return EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID))); |
|
840 | 840 | } |
841 | 841 | |
842 | 842 | |
@@ -852,25 +852,25 @@ discard block |
||
852 | 852 | * @param bool $verify If true then can_checkin() is used to verify whether the person can be checked in or not. Otherwise this forces change in checkin status. |
853 | 853 | * @return int|BOOL the chk_in status toggled to OR false if nothing got changed. |
854 | 854 | */ |
855 | - public function toggle_checkin_status( $DTT_ID = NULL, $verify = FALSE ) { |
|
856 | - if ( empty( $DTT_ID ) ) { |
|
855 | + public function toggle_checkin_status($DTT_ID = NULL, $verify = FALSE) { |
|
856 | + if (empty($DTT_ID)) { |
|
857 | 857 | $datetime = $this->get_related_primary_datetime(); |
858 | 858 | $DTT_ID = $datetime->ID(); |
859 | 859 | //verify the registration can checkin for the given DTT_ID |
860 | - } elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) { |
|
861 | - EE_Error::add_error( sprintf( __( 'The given registration (ID:%d) can not be checked in to the given DTT_ID (%d), because the registration does not have access', 'event_espresso'), $this->ID(), $DTT_ID ), __FILE__, __FUNCTION__, __LINE__ ); |
|
860 | + } elseif ( ! $this->can_checkin($DTT_ID, $verify)) { |
|
861 | + EE_Error::add_error(sprintf(__('The given registration (ID:%d) can not be checked in to the given DTT_ID (%d), because the registration does not have access', 'event_espresso'), $this->ID(), $DTT_ID), __FILE__, __FUNCTION__, __LINE__); |
|
862 | 862 | return FALSE; |
863 | 863 | } |
864 | - $status_paths = array( 0 => 1, 1 => 2, 2 => 1 ); |
|
864 | + $status_paths = array(0 => 1, 1 => 2, 2 => 1); |
|
865 | 865 | //start by getting the current status so we know what status we'll be changing to. |
866 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL ); |
|
867 | - $status_to = $status_paths[ $cur_status ]; |
|
866 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL); |
|
867 | + $status_to = $status_paths[$cur_status]; |
|
868 | 868 | //add relation - note Check-ins are always creating new rows because we are keeping track of Check-ins over time. Eventually we'll probably want to show a list table for the individual Check-ins so that can be managed. |
869 | 869 | $new_status = $status_to == 2 ? 0 : $status_to; |
870 | - $chk_data = array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID, 'CHK_in' => $new_status ); |
|
871 | - $checkin = EE_Checkin::new_instance( $chk_data ); |
|
870 | + $chk_data = array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID, 'CHK_in' => $new_status); |
|
871 | + $checkin = EE_Checkin::new_instance($chk_data); |
|
872 | 872 | $updated = $checkin->save(); |
873 | - if ( $updated === 0 ) { |
|
873 | + if ($updated === 0) { |
|
874 | 874 | $status_to = FALSE; |
875 | 875 | } |
876 | 876 | return $status_to; |
@@ -894,22 +894,22 @@ discard block |
||
894 | 894 | * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id. |
895 | 895 | * @return int Integer representing Check-in status. |
896 | 896 | */ |
897 | - public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) { |
|
898 | - if ( empty( $DTT_ID ) && ! $checkin instanceof EE_Checkin ) { |
|
897 | + public function check_in_status_for_datetime($DTT_ID = 0, $checkin = NULL) { |
|
898 | + if (empty($DTT_ID) && ! $checkin instanceof EE_Checkin) { |
|
899 | 899 | $datetime = $this->get_related_primary_datetime(); |
900 | - if ( ! $datetime instanceof EE_Datetime ) { |
|
900 | + if ( ! $datetime instanceof EE_Datetime) { |
|
901 | 901 | return 0; |
902 | 902 | } |
903 | 903 | $DTT_ID = $datetime->ID(); |
904 | 904 | //verify the registration can checkin for the given DTT_ID |
905 | - } elseif ( ! $checkin instanceof EE_Checkin && ! $this->can_checkin( $DTT_ID, false ) ) { |
|
906 | - EE_Error::add_error( sprintf( __( 'The checkin status for the given registration (ID:%d) and DTT_ID (%d) cannot be retrieved because the registration does not have access to that date and time. So there is no status for this registration.', 'event_espresso'), $this->ID(), $DTT_ID ) ); |
|
905 | + } elseif ( ! $checkin instanceof EE_Checkin && ! $this->can_checkin($DTT_ID, false)) { |
|
906 | + EE_Error::add_error(sprintf(__('The checkin status for the given registration (ID:%d) and DTT_ID (%d) cannot be retrieved because the registration does not have access to that date and time. So there is no status for this registration.', 'event_espresso'), $this->ID(), $DTT_ID)); |
|
907 | 907 | return false; |
908 | 908 | } |
909 | 909 | //get checkin object (if exists) |
910 | - $checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ), 'order_by' => array( 'CHK_timestamp' => 'DESC' ) ) ); |
|
911 | - if ( $checkin instanceof EE_Checkin ) { |
|
912 | - if ( $checkin->get( 'CHK_in' ) ) { |
|
910 | + $checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related('Checkin', array(array('DTT_ID' => $DTT_ID), 'order_by' => array('CHK_timestamp' => 'DESC'))); |
|
911 | + if ($checkin instanceof EE_Checkin) { |
|
912 | + if ($checkin->get('CHK_in')) { |
|
913 | 913 | return 1; //checked in |
914 | 914 | } else { |
915 | 915 | return 2; //had checked in but is now checked out. |
@@ -927,28 +927,28 @@ discard block |
||
927 | 927 | * @param bool $error This just flags that you want an error message returned. This is put in so that the error message can be customized with the attendee name. |
928 | 928 | * @return string internationalized message |
929 | 929 | */ |
930 | - public function get_checkin_msg( $DTT_ID, $error = FALSE ) { |
|
930 | + public function get_checkin_msg($DTT_ID, $error = FALSE) { |
|
931 | 931 | //let's get the attendee first so we can include the name of the attendee |
932 | - $attendee = $this->get_first_related( 'Attendee' ); |
|
933 | - if ( $attendee instanceof EE_Attendee ) { |
|
934 | - if ( $error ) { |
|
935 | - return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() ); |
|
932 | + $attendee = $this->get_first_related('Attendee'); |
|
933 | + if ($attendee instanceof EE_Attendee) { |
|
934 | + if ($error) { |
|
935 | + return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name()); |
|
936 | 936 | } |
937 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID ); |
|
937 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID); |
|
938 | 938 | //what is the status message going to be? |
939 | - switch ( $cur_status ) { |
|
939 | + switch ($cur_status) { |
|
940 | 940 | case 0 : |
941 | - return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() ); |
|
941 | + return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name()); |
|
942 | 942 | break; |
943 | 943 | case 1 : |
944 | - return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() ); |
|
944 | + return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name()); |
|
945 | 945 | break; |
946 | 946 | case 2 : |
947 | - return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() ); |
|
947 | + return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name()); |
|
948 | 948 | break; |
949 | 949 | } |
950 | 950 | } |
951 | - return __( "The check-in status could not be determined.", "event_espresso" ); |
|
951 | + return __("The check-in status could not be determined.", "event_espresso"); |
|
952 | 952 | } |
953 | 953 | |
954 | 954 | |
@@ -958,7 +958,7 @@ discard block |
||
958 | 958 | * @return EE_Transaction |
959 | 959 | */ |
960 | 960 | public function transaction() { |
961 | - return $this->get_first_related( 'Transaction' ); |
|
961 | + return $this->get_first_related('Transaction'); |
|
962 | 962 | } |
963 | 963 | |
964 | 964 | |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | * @access public |
970 | 970 | */ |
971 | 971 | public function reg_code() { |
972 | - return $this->get( 'REG_code' ); |
|
972 | + return $this->get('REG_code'); |
|
973 | 973 | } |
974 | 974 | |
975 | 975 | |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | * @access public |
980 | 980 | */ |
981 | 981 | public function transaction_ID() { |
982 | - return $this->get( 'TXN_ID' ); |
|
982 | + return $this->get('TXN_ID'); |
|
983 | 983 | } |
984 | 984 | |
985 | 985 | |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | * @return int |
989 | 989 | */ |
990 | 990 | public function ticket_ID() { |
991 | - return $this->get( 'TKT_ID' ); |
|
991 | + return $this->get('TKT_ID'); |
|
992 | 992 | } |
993 | 993 | |
994 | 994 | |
@@ -1000,17 +1000,17 @@ discard block |
||
1000 | 1000 | * @param string $REG_code Registration Code |
1001 | 1001 | * @param boolean $use_default |
1002 | 1002 | */ |
1003 | - public function set_reg_code( $REG_code, $use_default = FALSE ) { |
|
1004 | - if ( empty( $REG_code )) { |
|
1005 | - EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1003 | + public function set_reg_code($REG_code, $use_default = FALSE) { |
|
1004 | + if (empty($REG_code)) { |
|
1005 | + EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1006 | 1006 | return; |
1007 | 1007 | } |
1008 | - if ( ! $this->reg_code() ) { |
|
1009 | - parent::set( 'REG_code', $REG_code, $use_default ); |
|
1008 | + if ( ! $this->reg_code()) { |
|
1009 | + parent::set('REG_code', $REG_code, $use_default); |
|
1010 | 1010 | } else { |
1011 | 1011 | EE_Error::doing_it_wrong( |
1012 | - __CLASS__ . '::' . __FUNCTION__, |
|
1013 | - __( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ), |
|
1012 | + __CLASS__.'::'.__FUNCTION__, |
|
1013 | + __('Can not change a registration REG_code once it has been set.', 'event_espresso'), |
|
1014 | 1014 | '4.6.0' |
1015 | 1015 | ); |
1016 | 1016 | } |
@@ -1027,17 +1027,17 @@ discard block |
||
1027 | 1027 | * @return EE_Registration[] or empty array if this isn't a group registration. |
1028 | 1028 | */ |
1029 | 1029 | public function get_all_other_registrations_in_group() { |
1030 | - if ( $this->group_size() < 2 ) { |
|
1030 | + if ($this->group_size() < 2) { |
|
1031 | 1031 | return array(); |
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | $query[0] = array( |
1035 | 1035 | 'TXN_ID' => $this->transaction_ID(), |
1036 | - 'REG_ID' => array( '!=', $this->ID() ), |
|
1036 | + 'REG_ID' => array('!=', $this->ID()), |
|
1037 | 1037 | 'TKT_ID' => $this->ticket_ID() |
1038 | 1038 | ); |
1039 | 1039 | |
1040 | - $registrations = $this->get_model()->get_all( $query ); |
|
1040 | + $registrations = $this->get_model()->get_all($query); |
|
1041 | 1041 | return $registrations; |
1042 | 1042 | } |
1043 | 1043 | } |
@@ -618,9 +618,9 @@ |
||
618 | 618 | |
619 | 619 | |
620 | 620 | /** |
621 | - * get Attendee Number |
|
622 | - * @access public |
|
623 | - */ |
|
621 | + * get Attendee Number |
|
622 | + * @access public |
|
623 | + */ |
|
624 | 624 | public function count() { |
625 | 625 | return $this->get( 'REG_count' ); |
626 | 626 | } |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | /** |
782 | 782 | * Sets deleted |
783 | 783 | * @param boolean $deleted |
784 | - * @return boolean |
|
784 | + * @return boolean|null |
|
785 | 785 | */ |
786 | 786 | public function set_deleted($deleted) { |
787 | 787 | $this->set( 'REG_deleted', $deleted ); |
@@ -825,6 +825,7 @@ discard block |
||
825 | 825 | * |
826 | 826 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
827 | 827 | * @param bool $check_approved This is used to indicate whether the caller wants can_checkin to also consider registration status as well as datetime access. |
828 | + * @param integer $DTT_OR_ID |
|
828 | 829 | * |
829 | 830 | * @return bool |
830 | 831 | */ |
@@ -985,7 +986,7 @@ discard block |
||
985 | 986 | |
986 | 987 | |
987 | 988 | /** |
988 | - * @return int |
|
989 | + * @return boolean |
|
989 | 990 | */ |
990 | 991 | public function ticket_ID() { |
991 | 992 | return $this->get( 'TKT_ID' ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @return boolean success |
34 | 34 | */ |
35 | 35 | public function delete() { |
36 | - return $this->delete_or_restore( TRUE ); |
|
36 | + return $this->delete_or_restore(TRUE); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return boolean success |
44 | 44 | */ |
45 | 45 | public function delete_permanently() { |
46 | - return $this->get_model()->delete_permanently_by_ID( $this->ID() ); |
|
46 | + return $this->get_model()->delete_permanently_by_ID($this->ID()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @param bool $delete true=>delete, false=>restore |
54 | 54 | * @return bool |
55 | 55 | */ |
56 | - public function delete_or_restore( $delete = TRUE ) { |
|
56 | + public function delete_or_restore($delete = TRUE) { |
|
57 | 57 | $model = $this->get_model(); |
58 | - return $model->delete_or_restore_by_ID( $delete, $this->ID() ); |
|
58 | + return $model->delete_or_restore_by_ID($delete, $this->ID()); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | * @return boolean |
66 | 66 | */ |
67 | 67 | public function restore() { |
68 | - return $this->delete_or_restore( FALSE ); |
|
68 | + return $this->delete_or_restore(FALSE); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param array $props_n_values |
33 | 33 | * @return EE_State|mixed |
34 | 34 | */ |
35 | - public static function new_instance( $props_n_values = array() ) { |
|
36 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
37 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
35 | + public static function new_instance($props_n_values = array()) { |
|
36 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
37 | + return $has_object ? $has_object : new self($props_n_values); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * @param array $props_n_values |
44 | 44 | * @return EE_State |
45 | 45 | */ |
46 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
47 | - return new self( $props_n_values, TRUE ); |
|
46 | + public static function new_instance_from_db($props_n_values = array()) { |
|
47 | + return new self($props_n_values, TRUE); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @return string |
54 | 54 | */ |
55 | 55 | public function country_iso() { |
56 | - return $this->get( 'CNT_ISO' ); |
|
56 | + return $this->get('CNT_ISO'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @return string |
63 | 63 | */ |
64 | 64 | public function abbrev() { |
65 | - return $this->get( 'STA_abbrev' ); |
|
65 | + return $this->get('STA_abbrev'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * @return bool |
72 | 72 | */ |
73 | 73 | public function active() { |
74 | - return $this->get( 'STA_active' ); |
|
74 | + return $this->get('STA_active'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @return string |
81 | 81 | */ |
82 | 82 | public function name() { |
83 | - return $this->get( 'STA_name' ); |
|
83 | + return $this->get('STA_name'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @return EE_Country |
90 | 90 | */ |
91 | 91 | public function country() { |
92 | - return $this->get_first_related( 'Country' ); |
|
92 | + return $this->get_first_related('Country'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | /** |
98 | 98 | * @param $iso |
99 | 99 | */ |
100 | - public function set_country_iso( $iso ) { |
|
101 | - $this->set( 'CNT_ISO', $iso ); |
|
100 | + public function set_country_iso($iso) { |
|
101 | + $this->set('CNT_ISO', $iso); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | /** |
107 | 107 | * @param $abbrev |
108 | 108 | */ |
109 | - public function set_abbrev( $abbrev ) { |
|
110 | - $this->set( 'STA_abbrev', $abbrev ); |
|
109 | + public function set_abbrev($abbrev) { |
|
110 | + $this->set('STA_abbrev', $abbrev); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | /** |
116 | 116 | * @param $active |
117 | 117 | */ |
118 | - public function set_active( $active ) { |
|
119 | - $this->set( 'STA_active', $active ); |
|
118 | + public function set_active($active) { |
|
119 | + $this->set('STA_active', $active); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | /** |
125 | 125 | * @param $name |
126 | 126 | */ |
127 | - public function set_name( $name ) { |
|
128 | - $this->set( 'STA_name', $name ); |
|
127 | + public function set_name($name) { |
|
128 | + $this->set('STA_name', $name); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 |