@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | * the registration's share of the transaction total, so that the |
683 | 683 | * sum of all the transaction's REG_final_prices equal the transaction's total |
684 | 684 | * @access public |
685 | - * @return float |
|
685 | + * @return boolean |
|
686 | 686 | */ |
687 | 687 | public function final_price() { |
688 | 688 | return $this->get( 'REG_final_price' ); |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | /** |
705 | 705 | * get paid (yeah) |
706 | 706 | * @access public |
707 | - * @return float |
|
707 | + * @return boolean |
|
708 | 708 | */ |
709 | 709 | public function paid() { |
710 | 710 | return $this->get( 'REG_paid' ); |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | * (either the question's ID or a question object) |
818 | 818 | * @param EE_Question|int $question |
819 | 819 | * @param bool $pretty_value |
820 | - * @return array|string if pretty_value= true, the result will always be a string |
|
820 | + * @return string if pretty_value= true, the result will always be a string |
|
821 | 821 | * (because the answer might be an array of answer values, so passing pretty_value=true |
822 | 822 | * will convert it into some kind of string) |
823 | 823 | */ |
@@ -868,7 +868,7 @@ discard block |
||
868 | 868 | /** |
869 | 869 | * Sets deleted |
870 | 870 | * @param boolean $deleted |
871 | - * @return boolean |
|
871 | + * @return boolean|null |
|
872 | 872 | */ |
873 | 873 | public function set_deleted($deleted) { |
874 | 874 | $this->set( 'REG_deleted', $deleted ); |
@@ -912,6 +912,7 @@ discard block |
||
912 | 912 | * |
913 | 913 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
914 | 914 | * @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. |
915 | + * @param integer $DTT_OR_ID |
|
915 | 916 | * |
916 | 917 | * @return bool |
917 | 918 | */ |
@@ -1150,7 +1151,7 @@ discard block |
||
1150 | 1151 | |
1151 | 1152 | |
1152 | 1153 | /** |
1153 | - * @return int |
|
1154 | + * @return boolean |
|
1154 | 1155 | */ |
1155 | 1156 | public function ticket_ID() { |
1156 | 1157 | return $this->get( 'TKT_ID' ); |
@@ -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 |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | * date_format and the second value is the time format |
42 | 42 | * @return EE_Registration |
43 | 43 | */ |
44 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
45 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
46 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
44 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
45 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
46 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | * the website will be used. |
55 | 55 | * @return EE_Registration |
56 | 56 | */ |
57 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
58 | - return new self( $props_n_values, TRUE, $timezone ); |
|
57 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
58 | + return new self($props_n_values, TRUE, $timezone); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | * @access public |
67 | 67 | * @param int $EVT_ID Event ID |
68 | 68 | */ |
69 | - public function set_event( $EVT_ID = 0 ) { |
|
70 | - $this->set( 'EVT_ID', $EVT_ID ); |
|
69 | + public function set_event($EVT_ID = 0) { |
|
70 | + $this->set('EVT_ID', $EVT_ID); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -78,18 +78,18 @@ discard block |
||
78 | 78 | * @param mixed $field_value |
79 | 79 | * @param bool $use_default |
80 | 80 | */ |
81 | - public function set( $field_name, $field_value, $use_default = FALSE ) { |
|
82 | - switch( $field_name ) { |
|
81 | + public function set($field_name, $field_value, $use_default = FALSE) { |
|
82 | + switch ($field_name) { |
|
83 | 83 | case 'REG_code' : |
84 | - if ( ! empty( $field_value ) && $this->reg_code() == '' ) { |
|
85 | - $this->set_reg_code( $field_value, $use_default ); |
|
84 | + if ( ! empty($field_value) && $this->reg_code() == '') { |
|
85 | + $this->set_reg_code($field_value, $use_default); |
|
86 | 86 | } |
87 | 87 | break; |
88 | 88 | case 'STS_ID' : |
89 | - $this->set_status( $field_value, $use_default ); |
|
89 | + $this->set_status($field_value, $use_default); |
|
90 | 90 | break; |
91 | 91 | default : |
92 | - parent::set( $field_name, $field_value, $use_default ); |
|
92 | + parent::set($field_name, $field_value, $use_default); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
@@ -106,30 +106,30 @@ discard block |
||
106 | 106 | * @param boolean $use_default |
107 | 107 | * @return bool |
108 | 108 | */ |
109 | - public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) { |
|
109 | + public function set_status($new_STS_ID = NULL, $use_default = FALSE) { |
|
110 | 110 | // get current REG_Status |
111 | 111 | $old_STS_ID = $this->status_ID(); |
112 | 112 | // if status has changed |
113 | - if ( $old_STS_ID != $new_STS_ID ) { |
|
113 | + if ($old_STS_ID != $new_STS_ID) { |
|
114 | 114 | // TO approved |
115 | - if ( $new_STS_ID == EEM_Registration::status_id_approved ) { |
|
115 | + if ($new_STS_ID == EEM_Registration::status_id_approved) { |
|
116 | 116 | // reserve a space by incrementing ticket and datetime sold values |
117 | 117 | $this->_reserve_registration_space(); |
118 | - do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
118 | + do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID); |
|
119 | 119 | // OR FROM approved |
120 | - } else if ( $old_STS_ID == EEM_Registration::status_id_approved ) { |
|
120 | + } else if ($old_STS_ID == EEM_Registration::status_id_approved) { |
|
121 | 121 | // release a space by decrementing ticket and datetime sold values |
122 | 122 | $this->_release_registration_space(); |
123 | - do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
123 | + do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID); |
|
124 | 124 | } |
125 | 125 | // update status |
126 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
127 | - do_action( 'AHEE__EE_Registration__set_status__after_update', $this ); |
|
126 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
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 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
132 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
133 | 133 | return TRUE; |
134 | 134 | } |
135 | 135 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @access public |
142 | 142 | */ |
143 | 143 | public function status_ID() { |
144 | - return $this->get( 'STS_ID' ); |
|
144 | + return $this->get('STS_ID'); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | * @param boolean $include_archived whether to include archived tickets or not. |
167 | 167 | * @return EE_Ticket |
168 | 168 | */ |
169 | - public function ticket( $include_archived = TRUE ) { |
|
169 | + public function ticket($include_archived = TRUE) { |
|
170 | 170 | $query_params = array(); |
171 | - if ( $include_archived ) { |
|
172 | - $query_params[ 'default_where_conditions' ] = 'none'; |
|
171 | + if ($include_archived) { |
|
172 | + $query_params['default_where_conditions'] = 'none'; |
|
173 | 173 | } |
174 | - return $this->get_first_related( 'Ticket', $query_params ); |
|
174 | + return $this->get_first_related('Ticket', $query_params); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * @return EE_Event |
182 | 182 | */ |
183 | 183 | public function event() { |
184 | - return $this->get_first_related( 'Event' ); |
|
184 | + return $this->get_first_related('Event'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function wp_user() { |
197 | 197 | $event = $this->event(); |
198 | - if ( $event instanceof EE_Event ) { |
|
198 | + if ($event instanceof EE_Event) { |
|
199 | 199 | return $event->wp_user(); |
200 | 200 | } |
201 | 201 | return 0; |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | * @access public |
222 | 222 | * @param int $ATT_ID Attendee ID |
223 | 223 | */ |
224 | - public function set_attendee_id( $ATT_ID = 0 ) { |
|
225 | - $this->set( 'ATT_ID', $ATT_ID ); |
|
224 | + public function set_attendee_id($ATT_ID = 0) { |
|
225 | + $this->set('ATT_ID', $ATT_ID); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | * @access public |
234 | 234 | * @param int $TXN_ID Transaction ID |
235 | 235 | */ |
236 | - public function set_transaction_id( $TXN_ID = 0 ) { |
|
237 | - $this->set( 'TXN_ID', $TXN_ID ); |
|
236 | + public function set_transaction_id($TXN_ID = 0) { |
|
237 | + $this->set('TXN_ID', $TXN_ID); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | * @access public |
246 | 246 | * @param string $REG_session PHP Session ID |
247 | 247 | */ |
248 | - public function set_session( $REG_session = '' ) { |
|
249 | - $this->set( 'REG_session', $REG_session ); |
|
248 | + public function set_session($REG_session = '') { |
|
249 | + $this->set('REG_session', $REG_session); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | * @access public |
258 | 258 | * @param string $REG_url_link Registration URL Link |
259 | 259 | */ |
260 | - public function set_reg_url_link( $REG_url_link = '' ) { |
|
261 | - $this->set( 'REG_url_link', $REG_url_link ); |
|
260 | + public function set_reg_url_link($REG_url_link = '') { |
|
261 | + $this->set('REG_url_link', $REG_url_link); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | * @access public |
270 | 270 | * @param int $REG_count Primary Attendee |
271 | 271 | */ |
272 | - public function set_count( $REG_count = 1 ) { |
|
273 | - $this->set( 'REG_count', $REG_count ); |
|
272 | + public function set_count($REG_count = 1) { |
|
273 | + $this->set('REG_count', $REG_count); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | |
@@ -281,8 +281,8 @@ discard block |
||
281 | 281 | * @access public |
282 | 282 | * @param boolean $REG_group_size Group Registration |
283 | 283 | */ |
284 | - public function set_group_size( $REG_group_size = FALSE ) { |
|
285 | - $this->set( 'REG_group_size', $REG_group_size ); |
|
284 | + public function set_group_size($REG_group_size = FALSE) { |
|
285 | + $this->set('REG_group_size', $REG_group_size); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | |
@@ -365,8 +365,8 @@ discard block |
||
365 | 365 | * @access public |
366 | 366 | * @param mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date |
367 | 367 | */ |
368 | - public function set_reg_date( $REG_date = FALSE ) { |
|
369 | - $this->set( 'REG_date', $REG_date ); |
|
368 | + public function set_reg_date($REG_date = FALSE) { |
|
369 | + $this->set('REG_date', $REG_date); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | |
@@ -377,8 +377,8 @@ discard block |
||
377 | 377 | * @access public |
378 | 378 | * @param float $REG_final_price |
379 | 379 | */ |
380 | - public function set_final_price( $REG_final_price = 0.00 ) { |
|
381 | - $this->set( 'REG_final_price', $REG_final_price ); |
|
380 | + public function set_final_price($REG_final_price = 0.00) { |
|
381 | + $this->set('REG_final_price', $REG_final_price); |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | |
@@ -389,8 +389,8 @@ discard block |
||
389 | 389 | * @access public |
390 | 390 | * @param float $REG_paid |
391 | 391 | */ |
392 | - public function set_paid( $REG_paid = 0.00 ) { |
|
393 | - $this->set( 'REG_paid', $REG_paid ); |
|
392 | + public function set_paid($REG_paid = 0.00) { |
|
393 | + $this->set('REG_paid', $REG_paid); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | |
@@ -401,8 +401,8 @@ discard block |
||
401 | 401 | * @access public |
402 | 402 | * @param boolean $REG_att_is_going Attendee Is Going |
403 | 403 | */ |
404 | - public function set_att_is_going( $REG_att_is_going = FALSE ) { |
|
405 | - $this->set( 'REG_att_is_going', $REG_att_is_going ); |
|
404 | + public function set_att_is_going($REG_att_is_going = FALSE) { |
|
405 | + $this->set('REG_att_is_going', $REG_att_is_going); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @return EE_Attendee |
413 | 413 | */ |
414 | 414 | public function attendee() { |
415 | - return $this->get_first_related( 'Attendee' ); |
|
415 | + return $this->get_first_related('Attendee'); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | * @access public |
423 | 423 | */ |
424 | 424 | public function event_ID() { |
425 | - return $this->get( 'EVT_ID' ); |
|
425 | + return $this->get('EVT_ID'); |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | */ |
434 | 434 | public function event_name() { |
435 | 435 | $event = $this->event_obj(); |
436 | - if ( $event ) { |
|
436 | + if ($event) { |
|
437 | 437 | return $event->name(); |
438 | 438 | } else { |
439 | 439 | return NULL; |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | * @return EE_Event |
448 | 448 | */ |
449 | 449 | public function event_obj() { |
450 | - return $this->get_first_related( 'Event' ); |
|
450 | + return $this->get_first_related('Event'); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | * @access public |
458 | 458 | */ |
459 | 459 | public function attendee_ID() { |
460 | - return $this->get( 'ATT_ID' ); |
|
460 | + return $this->get('ATT_ID'); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | * @access public |
468 | 468 | */ |
469 | 469 | public function session_ID() { |
470 | - return $this->get( 'REG_session' ); |
|
470 | + return $this->get('REG_session'); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
478 | 478 | * @return string |
479 | 479 | */ |
480 | - public function receipt_url( $messenger = 'html' ) { |
|
480 | + public function receipt_url($messenger = 'html') { |
|
481 | 481 | |
482 | 482 | /** |
483 | 483 | * 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. |
@@ -486,12 +486,12 @@ discard block |
||
486 | 486 | */ |
487 | 487 | EE_Registry::instance()->load_helper('Template'); |
488 | 488 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php'; |
489 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
489 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
490 | 490 | |
491 | - if ( $has_custom ) { |
|
492 | - return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) ); |
|
491 | + if ($has_custom) { |
|
492 | + return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch')); |
|
493 | 493 | } |
494 | - return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' ); |
|
494 | + return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt'); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
503 | 503 | * @return string |
504 | 504 | */ |
505 | - public function invoice_url( $messenger = 'html' ) { |
|
505 | + public function invoice_url($messenger = 'html') { |
|
506 | 506 | /** |
507 | 507 | * 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. |
508 | 508 | * |
@@ -510,21 +510,21 @@ discard block |
||
510 | 510 | */ |
511 | 511 | EE_Registry::instance()->load_helper('Template'); |
512 | 512 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php'; |
513 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
513 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
514 | 514 | |
515 | - if ( $has_custom ) { |
|
516 | - if ( $messenger == 'html' ) { |
|
517 | - return $this->invoice_url( 'launch' ); |
|
515 | + if ($has_custom) { |
|
516 | + if ($messenger == 'html') { |
|
517 | + return $this->invoice_url('launch'); |
|
518 | 518 | } |
519 | 519 | $route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice'; |
520 | 520 | |
521 | - $query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() ); |
|
522 | - if ( $messenger == 'html' ) { |
|
521 | + $query_args = array('ee' => $route, 'id' => $this->reg_url_link()); |
|
522 | + if ($messenger == 'html') { |
|
523 | 523 | $query_args['html'] = TRUE; |
524 | 524 | } |
525 | - return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) ); |
|
525 | + return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id)); |
|
526 | 526 | } |
527 | - return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' ); |
|
527 | + return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice'); |
|
528 | 528 | } |
529 | 529 | |
530 | 530 | |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | * @access public |
535 | 535 | */ |
536 | 536 | public function reg_url_link() { |
537 | - return $this->get( 'REG_url_link' ); |
|
537 | + return $this->get('REG_url_link'); |
|
538 | 538 | } |
539 | 539 | |
540 | 540 | |
@@ -544,8 +544,8 @@ discard block |
||
544 | 544 | * @param string $type 'download','launch', or 'html' (default is 'launch') |
545 | 545 | * @return void |
546 | 546 | */ |
547 | - public function e_invoice_url( $type = 'launch' ) { |
|
548 | - echo $this->invoice_url( $type ); |
|
547 | + public function e_invoice_url($type = 'launch') { |
|
548 | + echo $this->invoice_url($type); |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | * @return string |
566 | 566 | */ |
567 | 567 | public function payment_overview_url() { |
568 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() ); |
|
568 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url()); |
|
569 | 569 | } |
570 | 570 | |
571 | 571 | |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | * @return string |
577 | 577 | */ |
578 | 578 | public function edit_attendee_information_url() { |
579 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() ); |
|
579 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url()); |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | |
@@ -586,8 +586,8 @@ discard block |
||
586 | 586 | * @return string |
587 | 587 | */ |
588 | 588 | public function get_admin_edit_url() { |
589 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
590 | - return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) ); |
|
589 | + EE_Registry::instance()->load_helper('URL'); |
|
590 | + return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php')); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | * @access public |
598 | 598 | */ |
599 | 599 | public function is_primary_registrant() { |
600 | - return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE; |
|
600 | + return $this->get('REG_count') == 1 ? TRUE : FALSE; |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | |
@@ -606,12 +606,12 @@ discard block |
||
606 | 606 | * This returns the primary registration object for this registration group (which may be this object). |
607 | 607 | * @return EE_Registration |
608 | 608 | */ |
609 | - public function get_primary_registration() { |
|
610 | - if ( $this->is_primary_registrant() ) |
|
609 | + public function get_primary_registration() { |
|
610 | + if ($this->is_primary_registrant()) |
|
611 | 611 | return $this; |
612 | 612 | |
613 | 613 | //k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1 |
614 | - $primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) ); |
|
614 | + $primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1))); |
|
615 | 615 | return $primary_registrant; |
616 | 616 | } |
617 | 617 | |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * @access public |
623 | 623 | */ |
624 | 624 | public function count() { |
625 | - return $this->get( 'REG_count' ); |
|
625 | + return $this->get('REG_count'); |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | * @access public |
633 | 633 | */ |
634 | 634 | public function group_size() { |
635 | - return $this->get( 'REG_group_size' ); |
|
635 | + return $this->get('REG_group_size'); |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | * @access public |
643 | 643 | */ |
644 | 644 | public function date() { |
645 | - return $this->get( 'REG_date' ); |
|
645 | + return $this->get('REG_date'); |
|
646 | 646 | } |
647 | 647 | |
648 | 648 | |
@@ -653,8 +653,8 @@ discard block |
||
653 | 653 | * @param string $time_format |
654 | 654 | * @return string |
655 | 655 | */ |
656 | - public function pretty_date( $date_format = NULL, $time_format = NULL ) { |
|
657 | - return $this->get_datetime( 'REG_date', $date_format, $time_format ); |
|
656 | + public function pretty_date($date_format = NULL, $time_format = NULL) { |
|
657 | + return $this->get_datetime('REG_date', $date_format, $time_format); |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | * @return float |
668 | 668 | */ |
669 | 669 | public function final_price() { |
670 | - return $this->get( 'REG_final_price' ); |
|
670 | + return $this->get('REG_final_price'); |
|
671 | 671 | } |
672 | 672 | |
673 | 673 | |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | * @return string |
679 | 679 | */ |
680 | 680 | public function pretty_final_price() { |
681 | - return $this->get_pretty( 'REG_final_price' ); |
|
681 | + return $this->get_pretty('REG_final_price'); |
|
682 | 682 | } |
683 | 683 | |
684 | 684 | |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | * @return float |
690 | 690 | */ |
691 | 691 | public function paid() { |
692 | - return $this->get( 'REG_paid' ); |
|
692 | + return $this->get('REG_paid'); |
|
693 | 693 | } |
694 | 694 | |
695 | 695 | |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | * @return float |
701 | 701 | */ |
702 | 702 | public function pretty_paid() { |
703 | - return $this->get_pretty( 'REG_paid' ); |
|
703 | + return $this->get_pretty('REG_paid'); |
|
704 | 704 | } |
705 | 705 | |
706 | 706 | |
@@ -712,11 +712,11 @@ discard block |
||
712 | 712 | * @param array $requires_payment |
713 | 713 | * @return bool |
714 | 714 | */ |
715 | - public function owes_monies_and_can_pay( $requires_payment = array()) { |
|
715 | + public function owes_monies_and_can_pay($requires_payment = array()) { |
|
716 | 716 | // these reg statuses require payment (if event is not free) |
717 | - $requires_payment = ! empty( $requires_payment ) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment(); |
|
717 | + $requires_payment = ! empty($requires_payment) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment(); |
|
718 | 718 | if ( |
719 | - in_array( $this->status_ID(), $requires_payment ) && |
|
719 | + in_array($this->status_ID(), $requires_payment) && |
|
720 | 720 | $this->final_price() != 0 && |
721 | 721 | $this->final_price() != $this->paid() |
722 | 722 | ) { |
@@ -733,8 +733,8 @@ discard block |
||
733 | 733 | * @param bool $show_icons |
734 | 734 | * @return void |
735 | 735 | */ |
736 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
737 | - echo $this->pretty_status( $show_icons ); |
|
736 | + public function e_pretty_status($show_icons = FALSE) { |
|
737 | + echo $this->pretty_status($show_icons); |
|
738 | 738 | } |
739 | 739 | |
740 | 740 | |
@@ -745,10 +745,10 @@ discard block |
||
745 | 745 | * @param bool $show_icons |
746 | 746 | * @return string |
747 | 747 | */ |
748 | - public function pretty_status( $show_icons = FALSE ) { |
|
749 | - $status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
748 | + public function pretty_status($show_icons = FALSE) { |
|
749 | + $status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
750 | 750 | $icon = ''; |
751 | - switch ( $this->status_ID() ) { |
|
751 | + switch ($this->status_ID()) { |
|
752 | 752 | case EEM_Registration::status_id_approved: |
753 | 753 | $icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : ''; |
754 | 754 | break; |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | $icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : ''; |
769 | 769 | break; |
770 | 770 | } |
771 | - return $icon . $status[ $this->status_ID() ]; |
|
771 | + return $icon.$status[$this->status_ID()]; |
|
772 | 772 | } |
773 | 773 | |
774 | 774 | |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | * @access public |
779 | 779 | */ |
780 | 780 | public function att_is_going() { |
781 | - return $this->get( 'REG_att_is_going' ); |
|
781 | + return $this->get('REG_att_is_going'); |
|
782 | 782 | } |
783 | 783 | |
784 | 784 | |
@@ -788,8 +788,8 @@ discard block |
||
788 | 788 | * @param array $query_params like EEM_Base::get_all |
789 | 789 | * @return EE_Answer[] |
790 | 790 | */ |
791 | - public function answers( $query_params = NULL ) { |
|
792 | - return $this->get_many_related( 'Answer', $query_params ); |
|
791 | + public function answers($query_params = NULL) { |
|
792 | + return $this->get_many_related('Answer', $query_params); |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | |
@@ -803,9 +803,9 @@ discard block |
||
803 | 803 | * (because the answer might be an array of answer values, so passing pretty_value=true |
804 | 804 | * will convert it into some kind of string) |
805 | 805 | */ |
806 | - public function answer_value_to_question( $question, $pretty_value=true ) { |
|
806 | + public function answer_value_to_question($question, $pretty_value = true) { |
|
807 | 807 | $question_id = EEM_Question::instance()->ensure_is_ID($question); |
808 | - return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value); |
|
808 | + return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value); |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | /** |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | * @return string |
815 | 815 | */ |
816 | 816 | public function reg_date() { |
817 | - return $this->get_datetime( 'REG_date' ); |
|
817 | + return $this->get_datetime('REG_date'); |
|
818 | 818 | } |
819 | 819 | |
820 | 820 | |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | * @return EE_Datetime_Ticket |
827 | 827 | */ |
828 | 828 | public function datetime_ticket() { |
829 | - return $this->get_first_related( 'Datetime_Ticket' ); |
|
829 | + return $this->get_first_related('Datetime_Ticket'); |
|
830 | 830 | } |
831 | 831 | |
832 | 832 | |
@@ -836,15 +836,15 @@ discard block |
||
836 | 836 | * @param EE_Datetime_Ticket $datetime_ticket |
837 | 837 | * @return EE_Datetime_Ticket |
838 | 838 | */ |
839 | - public function set_datetime_ticket( $datetime_ticket ) { |
|
840 | - return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' ); |
|
839 | + public function set_datetime_ticket($datetime_ticket) { |
|
840 | + return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket'); |
|
841 | 841 | } |
842 | 842 | /** |
843 | 843 | * Gets deleted |
844 | 844 | * @return boolean |
845 | 845 | */ |
846 | 846 | public function deleted() { |
847 | - return $this->get( 'REG_deleted' ); |
|
847 | + return $this->get('REG_deleted'); |
|
848 | 848 | } |
849 | 849 | |
850 | 850 | /** |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | * @return boolean |
854 | 854 | */ |
855 | 855 | public function set_deleted($deleted) { |
856 | - $this->set( 'REG_deleted', $deleted ); |
|
856 | + $this->set('REG_deleted', $deleted); |
|
857 | 857 | } |
858 | 858 | |
859 | 859 | |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | * @return EE_Status |
864 | 864 | */ |
865 | 865 | public function status_obj() { |
866 | - return $this->get_first_related( 'Status' ); |
|
866 | + return $this->get_first_related('Status'); |
|
867 | 867 | } |
868 | 868 | |
869 | 869 | |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | * @return int |
875 | 875 | */ |
876 | 876 | public function count_checkins() { |
877 | - return $this->get_model()->count_related( $this, 'Checkin' ); |
|
877 | + return $this->get_model()->count_related($this, 'Checkin'); |
|
878 | 878 | } |
879 | 879 | |
880 | 880 | |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | * @return int |
885 | 885 | */ |
886 | 886 | public function count_checkins_not_checkedout() { |
887 | - return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) ); |
|
887 | + return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1))); |
|
888 | 888 | } |
889 | 889 | |
890 | 890 | |
@@ -897,20 +897,20 @@ discard block |
||
897 | 897 | * |
898 | 898 | * @return bool |
899 | 899 | */ |
900 | - public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) { |
|
901 | - $DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID ); |
|
900 | + public function can_checkin($DTT_OR_ID, $check_approved = TRUE) { |
|
901 | + $DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID); |
|
902 | 902 | |
903 | 903 | //first check registration status |
904 | - if ( ( $check_approved && ! $this->is_approved() ) || ! $DTT_ID ) { |
|
904 | + if (($check_approved && ! $this->is_approved()) || ! $DTT_ID) { |
|
905 | 905 | return false; |
906 | 906 | } |
907 | 907 | //is there a datetime ticket that matches this dtt_ID? |
908 | - if ( ! ( EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) ) ) ) { |
|
908 | + if ( ! (EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID))))) { |
|
909 | 909 | return false; |
910 | 910 | } |
911 | 911 | |
912 | 912 | //final check is against TKT_uses |
913 | - return $this->verify_can_checkin_against_TKT_uses( $DTT_ID ); |
|
913 | + return $this->verify_can_checkin_against_TKT_uses($DTT_ID); |
|
914 | 914 | } |
915 | 915 | |
916 | 916 | |
@@ -923,10 +923,10 @@ discard block |
||
923 | 923 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
924 | 924 | * @return bool true means can checkin. false means cannot checkin. |
925 | 925 | */ |
926 | - public function verify_can_checkin_against_TKT_uses( $DTT_OR_ID ) { |
|
927 | - $DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID ); |
|
926 | + public function verify_can_checkin_against_TKT_uses($DTT_OR_ID) { |
|
927 | + $DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID); |
|
928 | 928 | |
929 | - if ( ! $DTT_ID ) { |
|
929 | + if ( ! $DTT_ID) { |
|
930 | 930 | return false; |
931 | 931 | } |
932 | 932 | |
@@ -934,23 +934,23 @@ discard block |
||
934 | 934 | |
935 | 935 | // if max uses is not set or equals infinity then return true cause its not a factor for whether user can check-in |
936 | 936 | // or not. |
937 | - if ( ! $max_uses || $max_uses === INF ) { |
|
937 | + if ( ! $max_uses || $max_uses === INF) { |
|
938 | 938 | return true; |
939 | 939 | } |
940 | 940 | |
941 | 941 | //does this datetime have a checkin record? If so, then the dtt count has already been verified so we can just |
942 | 942 | //go ahead and toggle. |
943 | - if ( EEM_Checkin::instance()->exists( array( array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID ) ) ) ) { |
|
943 | + if (EEM_Checkin::instance()->exists(array(array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID)))) { |
|
944 | 944 | return true; |
945 | 945 | } |
946 | 946 | |
947 | 947 | //made it here so the last check is whether the number of checkins per unique datetime on this registration |
948 | 948 | //disallows further check-ins. |
949 | - $count_unique_dtt_checkins = EEM_Checkin::instance()->count( array( array( 'REG_ID' => $this->ID(), 'CHK_in' => true ) ), 'DTT_ID', true ); |
|
949 | + $count_unique_dtt_checkins = EEM_Checkin::instance()->count(array(array('REG_ID' => $this->ID(), 'CHK_in' => true)), 'DTT_ID', true); |
|
950 | 950 | // checkins have already reached their max number of uses |
951 | 951 | // so registrant can NOT checkin |
952 | - if ( $count_unique_dtt_checkins >= $max_uses ) { |
|
953 | - EE_Error::add_error( __( 'Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
952 | + if ($count_unique_dtt_checkins >= $max_uses) { |
|
953 | + EE_Error::add_error(__('Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
954 | 954 | return false; |
955 | 955 | } |
956 | 956 | return true; |
@@ -971,15 +971,15 @@ discard block |
||
971 | 971 | * @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. |
972 | 972 | * @return int|BOOL the chk_in status toggled to OR false if nothing got changed. |
973 | 973 | */ |
974 | - public function toggle_checkin_status( $DTT_ID = null, $verify = false ) { |
|
975 | - if ( empty( $DTT_ID ) ) { |
|
974 | + public function toggle_checkin_status($DTT_ID = null, $verify = false) { |
|
975 | + if (empty($DTT_ID)) { |
|
976 | 976 | $datetime = $this->get_related_primary_datetime(); |
977 | 977 | $DTT_ID = $datetime->ID(); |
978 | 978 | // verify the registration can checkin for the given DTT_ID |
979 | - } elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) { |
|
979 | + } elseif ( ! $this->can_checkin($DTT_ID, $verify)) { |
|
980 | 980 | EE_Error::add_error( |
981 | 981 | sprintf( |
982 | - __( 'The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), |
|
982 | + __('The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), |
|
983 | 983 | because the registration does not have access', 'event_espresso'), |
984 | 984 | $this->ID(), |
985 | 985 | $DTT_ID |
@@ -994,8 +994,8 @@ discard block |
||
994 | 994 | EE_Registration::checkin_status_out => EE_Registration::checkin_status_in |
995 | 995 | ); |
996 | 996 | //start by getting the current status so we know what status we'll be changing to. |
997 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL ); |
|
998 | - $status_to = $status_paths[ $cur_status ]; |
|
997 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL); |
|
998 | + $status_to = $status_paths[$cur_status]; |
|
999 | 999 | // database only records true for checked IN or false for checked OUT |
1000 | 1000 | // no record ( null ) means checked in NEVER, but we obviously don't save that |
1001 | 1001 | $new_status = $status_to == EE_Registration::checkin_status_in ? true : false; |
@@ -1003,24 +1003,24 @@ discard block |
||
1003 | 1003 | // because we are keeping track of Check-ins over time. |
1004 | 1004 | // Eventually we'll probably want to show a list table |
1005 | 1005 | // for the individual Check-ins so that they can be managed. |
1006 | - $checkin = EE_Checkin::new_instance( array( |
|
1006 | + $checkin = EE_Checkin::new_instance(array( |
|
1007 | 1007 | 'REG_ID' => $this->ID(), |
1008 | 1008 | 'DTT_ID' => $DTT_ID, |
1009 | 1009 | 'CHK_in' => $new_status |
1010 | - ) ); |
|
1010 | + )); |
|
1011 | 1011 | // if the record could not be saved then return false |
1012 | - if ( $checkin->save() === 0 ) { |
|
1013 | - if ( WP_DEBUG ) { |
|
1012 | + if ($checkin->save() === 0) { |
|
1013 | + if (WP_DEBUG) { |
|
1014 | 1014 | global $wpdb; |
1015 | 1015 | $error = sprintf( |
1016 | - __( 'Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso' ), |
|
1016 | + __('Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso'), |
|
1017 | 1017 | '<br />', |
1018 | 1018 | $wpdb->last_error |
1019 | 1019 | ); |
1020 | 1020 | } else { |
1021 | - $error = __( 'Registration check in update failed because of an unknown database error', 'event_espresso' ); |
|
1021 | + $error = __('Registration check in update failed because of an unknown database error', 'event_espresso'); |
|
1022 | 1022 | } |
1023 | - EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ ); |
|
1023 | + EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__); |
|
1024 | 1024 | return false; |
1025 | 1025 | } |
1026 | 1026 | return $status_to; |
@@ -1044,19 +1044,19 @@ discard block |
||
1044 | 1044 | * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id. |
1045 | 1045 | * @return int Integer representing Check-in status. |
1046 | 1046 | */ |
1047 | - public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) { |
|
1048 | - if ( empty( $DTT_ID ) && ! $checkin instanceof EE_Checkin ) { |
|
1047 | + public function check_in_status_for_datetime($DTT_ID = 0, $checkin = NULL) { |
|
1048 | + if (empty($DTT_ID) && ! $checkin instanceof EE_Checkin) { |
|
1049 | 1049 | $datetime = $this->get_related_primary_datetime(); |
1050 | - if ( ! $datetime instanceof EE_Datetime ) { |
|
1050 | + if ( ! $datetime instanceof EE_Datetime) { |
|
1051 | 1051 | return 0; |
1052 | 1052 | } |
1053 | 1053 | $DTT_ID = $datetime->ID(); |
1054 | 1054 | //verify the registration can checkin for the given DTT_ID |
1055 | 1055 | } |
1056 | 1056 | //get checkin object (if exists) |
1057 | - $checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ), 'order_by' => array( 'CHK_timestamp' => 'DESC' ) ) ); |
|
1058 | - if ( $checkin instanceof EE_Checkin ) { |
|
1059 | - if ( $checkin->get( 'CHK_in' ) ) { |
|
1057 | + $checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related('Checkin', array(array('DTT_ID' => $DTT_ID), 'order_by' => array('CHK_timestamp' => 'DESC'))); |
|
1058 | + if ($checkin instanceof EE_Checkin) { |
|
1059 | + if ($checkin->get('CHK_in')) { |
|
1060 | 1060 | return EE_Registration::checkin_status_in; //checked in |
1061 | 1061 | } else { |
1062 | 1062 | return EE_Registration::checkin_status_out; //had checked in but is now checked out. |
@@ -1074,28 +1074,28 @@ discard block |
||
1074 | 1074 | * @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. |
1075 | 1075 | * @return string internationalized message |
1076 | 1076 | */ |
1077 | - public function get_checkin_msg( $DTT_ID, $error = FALSE ) { |
|
1077 | + public function get_checkin_msg($DTT_ID, $error = FALSE) { |
|
1078 | 1078 | //let's get the attendee first so we can include the name of the attendee |
1079 | - $attendee = $this->get_first_related( 'Attendee' ); |
|
1080 | - if ( $attendee instanceof EE_Attendee ) { |
|
1081 | - if ( $error ) { |
|
1082 | - return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() ); |
|
1079 | + $attendee = $this->get_first_related('Attendee'); |
|
1080 | + if ($attendee instanceof EE_Attendee) { |
|
1081 | + if ($error) { |
|
1082 | + return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name()); |
|
1083 | 1083 | } |
1084 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID ); |
|
1084 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID); |
|
1085 | 1085 | //what is the status message going to be? |
1086 | - switch ( $cur_status ) { |
|
1086 | + switch ($cur_status) { |
|
1087 | 1087 | case EE_Registration::checkin_status_never : |
1088 | - return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() ); |
|
1088 | + return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name()); |
|
1089 | 1089 | break; |
1090 | 1090 | case EE_Registration::checkin_status_in : |
1091 | - return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() ); |
|
1091 | + return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name()); |
|
1092 | 1092 | break; |
1093 | 1093 | case EE_Registration::checkin_status_out : |
1094 | - return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() ); |
|
1094 | + return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name()); |
|
1095 | 1095 | break; |
1096 | 1096 | } |
1097 | 1097 | } |
1098 | - return __( "The check-in status could not be determined.", "event_espresso" ); |
|
1098 | + return __("The check-in status could not be determined.", "event_espresso"); |
|
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | * @return EE_Transaction |
1106 | 1106 | */ |
1107 | 1107 | public function transaction() { |
1108 | - return $this->get_first_related( 'Transaction' ); |
|
1108 | + return $this->get_first_related('Transaction'); |
|
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | * @access public |
1117 | 1117 | */ |
1118 | 1118 | public function reg_code() { |
1119 | - return $this->get( 'REG_code' ); |
|
1119 | + return $this->get('REG_code'); |
|
1120 | 1120 | } |
1121 | 1121 | |
1122 | 1122 | |
@@ -1126,7 +1126,7 @@ discard block |
||
1126 | 1126 | * @access public |
1127 | 1127 | */ |
1128 | 1128 | public function transaction_ID() { |
1129 | - return $this->get( 'TXN_ID' ); |
|
1129 | + return $this->get('TXN_ID'); |
|
1130 | 1130 | } |
1131 | 1131 | |
1132 | 1132 | |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | * @return int |
1136 | 1136 | */ |
1137 | 1137 | public function ticket_ID() { |
1138 | - return $this->get( 'TKT_ID' ); |
|
1138 | + return $this->get('TKT_ID'); |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | |
@@ -1147,17 +1147,17 @@ discard block |
||
1147 | 1147 | * @param string $REG_code Registration Code |
1148 | 1148 | * @param boolean $use_default |
1149 | 1149 | */ |
1150 | - public function set_reg_code( $REG_code, $use_default = FALSE ) { |
|
1151 | - if ( empty( $REG_code )) { |
|
1152 | - EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1150 | + public function set_reg_code($REG_code, $use_default = FALSE) { |
|
1151 | + if (empty($REG_code)) { |
|
1152 | + EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1153 | 1153 | return; |
1154 | 1154 | } |
1155 | - if ( ! $this->reg_code() ) { |
|
1156 | - parent::set( 'REG_code', $REG_code, $use_default ); |
|
1155 | + if ( ! $this->reg_code()) { |
|
1156 | + parent::set('REG_code', $REG_code, $use_default); |
|
1157 | 1157 | } else { |
1158 | 1158 | EE_Error::doing_it_wrong( |
1159 | - __CLASS__ . '::' . __FUNCTION__, |
|
1160 | - __( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ), |
|
1159 | + __CLASS__.'::'.__FUNCTION__, |
|
1160 | + __('Can not change a registration REG_code once it has been set.', 'event_espresso'), |
|
1161 | 1161 | '4.6.0' |
1162 | 1162 | ); |
1163 | 1163 | } |
@@ -1177,17 +1177,17 @@ discard block |
||
1177 | 1177 | * @return EE_Registration[] or empty array if this isn't a group registration. |
1178 | 1178 | */ |
1179 | 1179 | public function get_all_other_registrations_in_group() { |
1180 | - if ( $this->group_size() < 2 ) { |
|
1180 | + if ($this->group_size() < 2) { |
|
1181 | 1181 | return array(); |
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | $query[0] = array( |
1185 | 1185 | 'TXN_ID' => $this->transaction_ID(), |
1186 | - 'REG_ID' => array( '!=', $this->ID() ), |
|
1186 | + 'REG_ID' => array('!=', $this->ID()), |
|
1187 | 1187 | 'TKT_ID' => $this->ticket_ID() |
1188 | 1188 | ); |
1189 | 1189 | |
1190 | - $registrations = $this->get_model()->get_all( $query ); |
|
1190 | + $registrations = $this->get_model()->get_all($query); |
|
1191 | 1191 | return $registrations; |
1192 | 1192 | } |
1193 | 1193 | |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | * @access public |
1200 | 1200 | */ |
1201 | 1201 | public function price_paid() { |
1202 | - EE_Error::doing_it_wrong( 'EE_Registration::price_paid()', __( 'This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso' ), '4.7.0' ); |
|
1202 | + EE_Error::doing_it_wrong('EE_Registration::price_paid()', __('This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso'), '4.7.0'); |
|
1203 | 1203 | return $this->final_price(); |
1204 | 1204 | } |
1205 | 1205 | |
@@ -1211,9 +1211,9 @@ discard block |
||
1211 | 1211 | * @access public |
1212 | 1212 | * @param float $REG_final_price |
1213 | 1213 | */ |
1214 | - public function set_price_paid( $REG_final_price = 0.00 ) { |
|
1215 | - EE_Error::doing_it_wrong( 'EE_Registration::set_price_paid()', __( 'This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso' ), '4.7.0' ); |
|
1216 | - $this->set_final_price( $REG_final_price ); |
|
1214 | + public function set_price_paid($REG_final_price = 0.00) { |
|
1215 | + EE_Error::doing_it_wrong('EE_Registration::set_price_paid()', __('This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso'), '4.7.0'); |
|
1216 | + $this->set_final_price($REG_final_price); |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | |
@@ -1224,7 +1224,7 @@ discard block |
||
1224 | 1224 | * @return string |
1225 | 1225 | */ |
1226 | 1226 | public function pretty_price_paid() { |
1227 | - EE_Error::doing_it_wrong( 'EE_Registration::pretty_price_paid()', __( 'This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso' ), '4.7.0' ); |
|
1227 | + EE_Error::doing_it_wrong('EE_Registration::pretty_price_paid()', __('This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso'), '4.7.0'); |
|
1228 | 1228 | return $this->pretty_final_price(); |
1229 | 1229 | } |
1230 | 1230 |
@@ -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 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * registration_ID |
42 | 42 | * @access public |
43 | - * @return int |
|
43 | + * @return boolean |
|
44 | 44 | */ |
45 | 45 | public function registration_ID() { |
46 | 46 | return $this->get( 'REG_ID' ); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * payment_ID |
53 | 53 | * @access public |
54 | - * @return int |
|
54 | + * @return boolean |
|
55 | 55 | */ |
56 | 56 | public function payment_ID() { |
57 | 57 | return $this->get( 'PAY_ID' ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * amount |
64 | 64 | * @access public |
65 | - * @return float |
|
65 | + * @return boolean |
|
66 | 66 | */ |
67 | 67 | public function amount() { |
68 | 68 | return $this->get( 'RPY_amount' ); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * @param string $timezone |
20 | 20 | * @return EE_Registration_Payment |
21 | 21 | */ |
22 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
23 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
24 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone ); |
|
22 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
23 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
24 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | * @param string $timezone |
32 | 32 | * @return EE_Registration_Payment |
33 | 33 | */ |
34 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
35 | - return new self( $props_n_values, true, $timezone ); |
|
34 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
35 | + return new self($props_n_values, true, $timezone); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return int |
44 | 44 | */ |
45 | 45 | public function registration_ID() { |
46 | - return $this->get( 'REG_ID' ); |
|
46 | + return $this->get('REG_ID'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return int |
55 | 55 | */ |
56 | 56 | public function payment_ID() { |
57 | - return $this->get( 'PAY_ID' ); |
|
57 | + return $this->get('PAY_ID'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @return float |
66 | 66 | */ |
67 | 67 | public function amount() { |
68 | - return $this->get( 'RPY_amount' ); |
|
68 | + return $this->get('RPY_amount'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @access public |
76 | 76 | * @param float $amount |
77 | 77 | */ |
78 | - public function set_amount( $amount = 0.000 ) { |
|
79 | - $this->set( 'RPY_amount', $amount ); |
|
78 | + public function set_amount($amount = 0.000) { |
|
79 | + $this->set('RPY_amount', $amount); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @return \EE_Registration |
88 | 88 | */ |
89 | 89 | public function registration() { |
90 | - return $this->get_first_related( 'Registration' ); |
|
90 | + return $this->get_first_related('Registration'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return \EE_Payment |
99 | 99 | */ |
100 | 100 | public function payment() { |
101 | - return $this->get_first_related( 'Payment' ); |
|
101 | + return $this->get_first_related('Payment'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | |
52 | 52 | /** |
53 | - * @return string |
|
53 | + * @return boolean |
|
54 | 54 | */ |
55 | 55 | public function country_iso() { |
56 | 56 | return $this->get( 'CNT_ISO' ); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | |
61 | 61 | /** |
62 | - * @return string |
|
62 | + * @return boolean |
|
63 | 63 | */ |
64 | 64 | public function abbrev() { |
65 | 65 | return $this->get( 'STA_abbrev' ); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | |
79 | 79 | /** |
80 | - * @return string |
|
80 | + * @return boolean |
|
81 | 81 | */ |
82 | 82 | public function name() { |
83 | 83 | return $this->get( 'STA_name' ); |
@@ -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 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * Sets code |
68 | 68 | * @param string $code |
69 | - * @return boolean |
|
69 | + * @return boolean|null |
|
70 | 70 | */ |
71 | 71 | function set_code( $code ) { |
72 | 72 | $this->set( 'STS_code', $code ); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Gets desc |
79 | - * @return string |
|
79 | + * @return boolean |
|
80 | 80 | */ |
81 | 81 | function desc() { |
82 | 82 | return $this->get( 'STS_desc' ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * Sets desc |
89 | 89 | * @param string $desc |
90 | - * @return boolean |
|
90 | + * @return boolean|null |
|
91 | 91 | */ |
92 | 92 | function set_desc( $desc ) { |
93 | 93 | $this->set( 'STS_desc', $desc ); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Gets type |
100 | - * @return string |
|
100 | + * @return boolean |
|
101 | 101 | */ |
102 | 102 | function type() { |
103 | 103 | return $this->get( 'STS_type' ); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * Sets type |
110 | 110 | * @param string $type |
111 | - * @return boolean |
|
111 | + * @return boolean|null |
|
112 | 112 | */ |
113 | 113 | function set_type( $type ) { |
114 | 114 | $this->set( 'STS_type', $type ); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | /** |
130 | 130 | * Sets can_edit |
131 | 131 | * @param boolean $can_edit |
132 | - * @return boolean |
|
132 | + * @return boolean|null |
|
133 | 133 | */ |
134 | 134 | function set_can_edit( $can_edit ) { |
135 | 135 | $this->set( 'STS_can_edit', $can_edit ); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * Sets open |
152 | 152 | * @param boolean $open |
153 | - * @return boolean |
|
153 | + * @return boolean|null |
|
154 | 154 | */ |
155 | 155 | function set_open( $open ) { |
156 | 156 | $this->set( 'STS_open', $open ); |
@@ -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_Status |
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_Status |
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 | |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | * @param string $schema |
56 | 56 | * @return string |
57 | 57 | */ |
58 | - function code( $plural = FALSE, $schema = 'upper' ) { |
|
59 | - $id = $this->get( 'STS_ID' ); |
|
60 | - $code = EEM_Status::instance()->localized_status( array( $id => $this->get( 'STS_code' ) ), $plural, $schema ); |
|
61 | - return $code[ $id ]; |
|
58 | + function code($plural = FALSE, $schema = 'upper') { |
|
59 | + $id = $this->get('STS_ID'); |
|
60 | + $code = EEM_Status::instance()->localized_status(array($id => $this->get('STS_code')), $plural, $schema); |
|
61 | + return $code[$id]; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * @param string $code |
69 | 69 | * @return boolean |
70 | 70 | */ |
71 | - function set_code( $code ) { |
|
72 | - $this->set( 'STS_code', $code ); |
|
71 | + function set_code($code) { |
|
72 | + $this->set('STS_code', $code); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @return string |
80 | 80 | */ |
81 | 81 | function desc() { |
82 | - return $this->get( 'STS_desc' ); |
|
82 | + return $this->get('STS_desc'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @param string $desc |
90 | 90 | * @return boolean |
91 | 91 | */ |
92 | - function set_desc( $desc ) { |
|
93 | - $this->set( 'STS_desc', $desc ); |
|
92 | + function set_desc($desc) { |
|
93 | + $this->set('STS_desc', $desc); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @return string |
101 | 101 | */ |
102 | 102 | function type() { |
103 | - return $this->get( 'STS_type' ); |
|
103 | + return $this->get('STS_type'); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | * @param string $type |
111 | 111 | * @return boolean |
112 | 112 | */ |
113 | - function set_type( $type ) { |
|
114 | - $this->set( 'STS_type', $type ); |
|
113 | + function set_type($type) { |
|
114 | + $this->set('STS_type', $type); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @return boolean |
122 | 122 | */ |
123 | 123 | function can_edit() { |
124 | - return $this->get( 'STS_can_edit' ); |
|
124 | + return $this->get('STS_can_edit'); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param boolean $can_edit |
132 | 132 | * @return boolean |
133 | 133 | */ |
134 | - function set_can_edit( $can_edit ) { |
|
135 | - $this->set( 'STS_can_edit', $can_edit ); |
|
134 | + function set_can_edit($can_edit) { |
|
135 | + $this->set('STS_can_edit', $can_edit); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @return boolean |
143 | 143 | */ |
144 | 144 | function open() { |
145 | - return $this->get( 'STS_open' ); |
|
145 | + return $this->get('STS_open'); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | * @param boolean $open |
153 | 153 | * @return boolean |
154 | 154 | */ |
155 | - function set_open( $open ) { |
|
156 | - $this->set( 'STS_open', $open ); |
|
155 | + function set_open($open) { |
|
156 | + $this->set('STS_open', $open); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Gets name |
69 | - * @return string |
|
69 | + * @return boolean |
|
70 | 70 | */ |
71 | 71 | function name() { |
72 | 72 | return $this->get( 'name' ); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Sets name |
79 | 79 | * @param string $name |
80 | - * @return boolean |
|
80 | + * @return boolean|null |
|
81 | 81 | */ |
82 | 82 | function set_name( $name ) { |
83 | 83 | $this->set( 'name', $name ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | /** |
89 | 89 | * Gets slug |
90 | - * @return string |
|
90 | + * @return boolean |
|
91 | 91 | */ |
92 | 92 | function slug() { |
93 | 93 | return $this->get( 'slug' ); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * Sets slug |
100 | 100 | * @param string $slug |
101 | - * @return boolean |
|
101 | + * @return boolean|null |
|
102 | 102 | */ |
103 | 103 | function set_slug( $slug ) { |
104 | 104 | $this->set( 'slug', $slug ); |
@@ -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 |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | * @param bool $bydb |
35 | 35 | * @param string $timezone |
36 | 36 | */ |
37 | - protected function __construct( $fieldValues = array(), $bydb = FALSE, $timezone = '' ) { |
|
38 | - if ( ! isset( $fieldValues[ 'slug' ] ) ) { |
|
39 | - $fieldValues[ 'slug' ] = $fieldValues[ 'name' ]; |
|
37 | + protected function __construct($fieldValues = array(), $bydb = FALSE, $timezone = '') { |
|
38 | + if ( ! isset($fieldValues['slug'])) { |
|
39 | + $fieldValues['slug'] = $fieldValues['name']; |
|
40 | 40 | } |
41 | - parent::__construct( $fieldValues, $bydb, $timezone ); |
|
41 | + parent::__construct($fieldValues, $bydb, $timezone); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * @param array $props_n_values |
48 | 48 | * @return EE_Term|mixed |
49 | 49 | */ |
50 | - public static function new_instance( $props_n_values = array() ) { |
|
51 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
52 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
50 | + public static function new_instance($props_n_values = array()) { |
|
51 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
52 | + return $has_object ? $has_object : new self($props_n_values); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | * @param array $props_n_values |
59 | 59 | * @return EE_Term |
60 | 60 | */ |
61 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
62 | - return new self( $props_n_values, TRUE ); |
|
61 | + public static function new_instance_from_db($props_n_values = array()) { |
|
62 | + return new self($props_n_values, TRUE); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @return string |
70 | 70 | */ |
71 | 71 | function name() { |
72 | - return $this->get( 'name' ); |
|
72 | + return $this->get('name'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | * @param string $name |
80 | 80 | * @return boolean |
81 | 81 | */ |
82 | - function set_name( $name ) { |
|
83 | - $this->set( 'name', $name ); |
|
82 | + function set_name($name) { |
|
83 | + $this->set('name', $name); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @return string |
91 | 91 | */ |
92 | 92 | function slug() { |
93 | - return $this->get( 'slug' ); |
|
93 | + return $this->get('slug'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | * @param string $slug |
101 | 101 | * @return boolean |
102 | 102 | */ |
103 | - function set_slug( $slug ) { |
|
104 | - $this->set( 'slug', $slug ); |
|
103 | + function set_slug($slug) { |
|
104 | + $this->set('slug', $slug); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Gets taxonomy |
54 | - * @return string |
|
54 | + * @return boolean |
|
55 | 55 | */ |
56 | 56 | function taxonomy() { |
57 | 57 | return $this->get( 'taxonomy' ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * Sets taxonomy |
64 | 64 | * @param string $taxonomy |
65 | - * @return boolean |
|
65 | + * @return boolean|null |
|
66 | 66 | */ |
67 | 67 | function set_taxonomy( $taxonomy ) { |
68 | 68 | $this->set( 'taxonomy', $taxonomy ); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Gets term_count |
75 | - * @return int |
|
75 | + * @return boolean |
|
76 | 76 | */ |
77 | 77 | function count() { |
78 | 78 | return $this->get( 'term_count' ); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * Sets term_count |
85 | 85 | * @param int $term_count |
86 | - * @return boolean |
|
86 | + * @return boolean|null |
|
87 | 87 | */ |
88 | 88 | function set_count( $term_count ) { |
89 | 89 | $this->set( 'term_count', $term_count ); |
@@ -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_Term_Taxonomy |
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_Term_Taxonomy |
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 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return string |
55 | 55 | */ |
56 | 56 | function taxonomy() { |
57 | - return $this->get( 'taxonomy' ); |
|
57 | + return $this->get('taxonomy'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | * @param string $taxonomy |
65 | 65 | * @return boolean |
66 | 66 | */ |
67 | - function set_taxonomy( $taxonomy ) { |
|
68 | - $this->set( 'taxonomy', $taxonomy ); |
|
67 | + function set_taxonomy($taxonomy) { |
|
68 | + $this->set('taxonomy', $taxonomy); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @return int |
76 | 76 | */ |
77 | 77 | function count() { |
78 | - return $this->get( 'term_count' ); |
|
78 | + return $this->get('term_count'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * @param int $term_count |
86 | 86 | * @return boolean |
87 | 87 | */ |
88 | - function set_count( $term_count ) { |
|
89 | - $this->set( 'term_count', $term_count ); |
|
88 | + function set_count($term_count) { |
|
89 | + $this->set('term_count', $term_count); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return EE_Term |
97 | 97 | */ |
98 | 98 | function term() { |
99 | - return $this->get_first_related( 'Term' ); |
|
99 | + return $this->get_first_related('Term'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param array $props_n_values incoming values from the database |
50 | 50 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
51 | 51 | * the website will be used. |
52 | - * @return EE_Attendee |
|
52 | + * @return EE_Transaction |
|
53 | 53 | */ |
54 | 54 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
55 | 55 | return new self( $props_n_values, TRUE, $timezone ); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | /** |
213 | 213 | * get Transaction Total |
214 | 214 | * @access public |
215 | - * @return float |
|
215 | + * @return boolean |
|
216 | 216 | */ |
217 | 217 | public function total() { |
218 | 218 | return $this->get( 'TXN_total' ); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | /** |
224 | 224 | * get Total Amount Paid to Date |
225 | 225 | * @access public |
226 | - * @return float |
|
226 | + * @return boolean |
|
227 | 227 | */ |
228 | 228 | public function paid() { |
229 | 229 | return $this->get( 'TXN_paid' ); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | /** |
327 | 327 | * Gets all the attendees for this transaction (handy for use with EE_Attendee's get_registrations_for_event function |
328 | 328 | * for getting attendees and how many registrations they each have for an event) |
329 | - * @return mixed EE_Attendee[] by default, int if $output is set to 'COUNT' |
|
329 | + * @return EE_Base_Class[] EE_Attendee[] by default, int if $output is set to 'COUNT' |
|
330 | 330 | */ |
331 | 331 | public function attendees() { |
332 | 332 | return $this->get_many_related( 'Attendee', array( array( 'Registration.Transaction.TXN_ID' => $this->ID() ) ) ); |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | /** |
572 | 572 | * Gets all the extra meta info on this payment |
573 | 573 | * @param array $query_params like EEM_Base::get_all |
574 | - * @return EE_Extra_Meta |
|
574 | + * @return EE_Base_Class[] |
|
575 | 575 | */ |
576 | 576 | public function extra_meta( $query_params = array() ) { |
577 | 577 | return $this->get_many_related( 'Extra_Meta', $query_params ); |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | |
714 | 714 | /** |
715 | 715 | * Gets PMD_ID |
716 | - * @return int |
|
716 | + * @return boolean |
|
717 | 717 | */ |
718 | 718 | function payment_method_ID() { |
719 | 719 | return $this->get('PMD_ID'); |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | /** |
725 | 725 | * Sets PMD_ID |
726 | 726 | * @param int $PMD_ID |
727 | - * @return boolean |
|
727 | + * @return boolean|null |
|
728 | 728 | */ |
729 | 729 | function set_payment_method_ID($PMD_ID) { |
730 | 730 | $this->set('PMD_ID', $PMD_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 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @subpackage includes/classes/EE_Transaction.class.php |
27 | 27 | * @author Brent Christensen |
28 | 28 | */ |
29 | -class EE_Transaction extends EE_Base_Class implements EEI_Transaction{ |
|
29 | +class EE_Transaction extends EE_Base_Class implements EEI_Transaction { |
|
30 | 30 | |
31 | 31 | |
32 | 32 | /** |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * date_format and the second value is the time format |
39 | 39 | * @return EE_Attendee |
40 | 40 | */ |
41 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
42 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
43 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
41 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
42 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
43 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * the website will be used. |
52 | 52 | * @return EE_Attendee |
53 | 53 | */ |
54 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
55 | - return new self( $props_n_values, TRUE, $timezone ); |
|
54 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
55 | + return new self($props_n_values, TRUE, $timezone); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | */ |
69 | 69 | public function lock() { |
70 | - $locked_transactions = get_option( 'ee_locked_transactions', array() ); |
|
71 | - $locked_transactions[ $this->ID() ] = true; |
|
72 | - update_option( 'ee_locked_transactions', $locked_transactions ); |
|
70 | + $locked_transactions = get_option('ee_locked_transactions', array()); |
|
71 | + $locked_transactions[$this->ID()] = true; |
|
72 | + update_option('ee_locked_transactions', $locked_transactions); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | * @return void |
84 | 84 | */ |
85 | 85 | public function unlock() { |
86 | - $locked_transactions = get_option( 'ee_locked_transactions', array() ); |
|
87 | - unset( $locked_transactions[ $this->ID() ] ); |
|
88 | - update_option( 'ee_locked_transactions', $locked_transactions ); |
|
86 | + $locked_transactions = get_option('ee_locked_transactions', array()); |
|
87 | + unset($locked_transactions[$this->ID()]); |
|
88 | + update_option('ee_locked_transactions', $locked_transactions); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | * @return boolean |
103 | 103 | */ |
104 | 104 | public function is_locked() { |
105 | - $locked_transactions = get_option( 'ee_locked_transactions', array() ); |
|
106 | - return isset( $locked_transactions[ $this->ID() ] ) ? true : false; |
|
105 | + $locked_transactions = get_option('ee_locked_transactions', array()); |
|
106 | + return isset($locked_transactions[$this->ID()]) ? true : false; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | * @access public |
115 | 115 | * @param float $total total value of transaction |
116 | 116 | */ |
117 | - public function set_total( $total = 0.00 ) { |
|
118 | - $this->set( 'TXN_total', $total ); |
|
117 | + public function set_total($total = 0.00) { |
|
118 | + $this->set('TXN_total', $total); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | * @access public |
127 | 127 | * @param float $total_paid total amount paid to date (sum of all payments) |
128 | 128 | */ |
129 | - public function set_paid( $total_paid = 0.00 ) { |
|
130 | - $this->set( 'TXN_paid', $total_paid ); |
|
129 | + public function set_paid($total_paid = 0.00) { |
|
130 | + $this->set('TXN_paid', $total_paid); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | * @access public |
139 | 139 | * @param string $status whether the transaction is open, declined, accepted, or any number of custom values that can be set |
140 | 140 | */ |
141 | - public function set_status( $status = '' ) { |
|
142 | - $this->set( 'STS_ID', $status ); |
|
141 | + public function set_status($status = '') { |
|
142 | + $this->set('STS_ID', $status); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | * @access public |
151 | 151 | * @param string $hash_salt required for some payment gateways |
152 | 152 | */ |
153 | - public function set_hash_salt( $hash_salt = '' ) { |
|
154 | - $this->set( 'TXN_hash_salt', $hash_salt ); |
|
153 | + public function set_hash_salt($hash_salt = '') { |
|
154 | + $this->set('TXN_hash_salt', $hash_salt); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | * Sets TXN_reg_steps array |
161 | 161 | * @param array $txn_reg_steps |
162 | 162 | */ |
163 | - function set_reg_steps( $txn_reg_steps ) { |
|
164 | - $this->set( 'TXN_reg_steps', $txn_reg_steps ); |
|
163 | + function set_reg_steps($txn_reg_steps) { |
|
164 | + $this->set('TXN_reg_steps', $txn_reg_steps); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | * @return array |
172 | 172 | */ |
173 | 173 | function reg_steps() { |
174 | - $TXN_reg_steps = $this->get( 'TXN_reg_steps' ); |
|
175 | - return is_array( $TXN_reg_steps ) ? $TXN_reg_steps : array(); |
|
174 | + $TXN_reg_steps = $this->get('TXN_reg_steps'); |
|
175 | + return is_array($TXN_reg_steps) ? $TXN_reg_steps : array(); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @return string of transaction's total cost, with currency symbol and decimal |
183 | 183 | */ |
184 | 184 | public function pretty_total() { |
185 | - return $this->get_pretty( 'TXN_total' ); |
|
185 | + return $this->get_pretty('TXN_total'); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @return string |
193 | 193 | */ |
194 | 194 | public function pretty_paid() { |
195 | - return $this->get_pretty( 'TXN_paid' ); |
|
195 | + return $this->get_pretty('TXN_paid'); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @return float amount remaining |
205 | 205 | */ |
206 | 206 | public function remaining() { |
207 | - return (float)( $this->total() - $this->paid() ); |
|
207 | + return (float) ($this->total() - $this->paid()); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @return float |
216 | 216 | */ |
217 | 217 | public function total() { |
218 | - return $this->get( 'TXN_total' ); |
|
218 | + return $this->get('TXN_total'); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @return float |
227 | 227 | */ |
228 | 228 | public function paid() { |
229 | - return $this->get( 'TXN_paid' ); |
|
229 | + return $this->get('TXN_paid'); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | * @access public |
237 | 237 | */ |
238 | 238 | public function get_cart_session() { |
239 | - $session_data = $this->get( 'TXN_session_data' ); |
|
240 | - return isset( $session_data[ 'cart' ] ) && $session_data[ 'cart' ] instanceof EE_Cart ? $session_data[ 'cart' ] : NULL; |
|
239 | + $session_data = $this->get('TXN_session_data'); |
|
240 | + return isset($session_data['cart']) && $session_data['cart'] instanceof EE_Cart ? $session_data['cart'] : NULL; |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | * @access public |
248 | 248 | */ |
249 | 249 | public function session_data() { |
250 | - $session_data = $this->get( 'TXN_session_data' ); |
|
251 | - if ( empty( $session_data ) ) { |
|
252 | - $session_data = array( 'id' => NULL, 'user_id' => NULL, 'ip_address' => NULL, 'user_agent' => NULL, 'init_access' => NULL, 'last_access' => NULL, 'pages_visited' => array() ); |
|
250 | + $session_data = $this->get('TXN_session_data'); |
|
251 | + if (empty($session_data)) { |
|
252 | + $session_data = array('id' => NULL, 'user_id' => NULL, 'ip_address' => NULL, 'user_agent' => NULL, 'init_access' => NULL, 'last_access' => NULL, 'pages_visited' => array()); |
|
253 | 253 | } |
254 | 254 | return $session_data; |
255 | 255 | } |
@@ -262,11 +262,11 @@ discard block |
||
262 | 262 | * @access public |
263 | 263 | * @param EE_Session|array $session_data |
264 | 264 | */ |
265 | - public function set_txn_session_data( $session_data ) { |
|
266 | - if ( $session_data instanceof EE_Session ) { |
|
267 | - $this->set( 'TXN_session_data', $session_data->get_session_data( NULL, TRUE )); |
|
265 | + public function set_txn_session_data($session_data) { |
|
266 | + if ($session_data instanceof EE_Session) { |
|
267 | + $this->set('TXN_session_data', $session_data->get_session_data(NULL, TRUE)); |
|
268 | 268 | } else { |
269 | - $this->set( 'TXN_session_data', $session_data ); |
|
269 | + $this->set('TXN_session_data', $session_data); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @access public |
278 | 278 | */ |
279 | 279 | public function hash_salt_() { |
280 | - return $this->get( 'TXN_hash_salt' ); |
|
280 | + return $this->get('TXN_hash_salt'); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | |
@@ -297,13 +297,13 @@ discard block |
||
297 | 297 | * @param boolean $gmt - whether to return a unix timestamp with UTC offset applied (default) or no UTC offset applied |
298 | 298 | * @return string | int |
299 | 299 | */ |
300 | - public function datetime( $format = FALSE, $gmt = FALSE ) { |
|
301 | - if ( $format ) { |
|
302 | - return $this->get_pretty( 'TXN_timestamp' ); |
|
303 | - } else if ( $gmt ) { |
|
304 | - return $this->get_raw( 'TXN_timestamp' ); |
|
300 | + public function datetime($format = FALSE, $gmt = FALSE) { |
|
301 | + if ($format) { |
|
302 | + return $this->get_pretty('TXN_timestamp'); |
|
303 | + } else if ($gmt) { |
|
304 | + return $this->get_raw('TXN_timestamp'); |
|
305 | 305 | } else { |
306 | - return $this->get( 'TXN_timestamp' ); |
|
306 | + return $this->get('TXN_timestamp'); |
|
307 | 307 | } |
308 | 308 | } |
309 | 309 | |
@@ -315,10 +315,10 @@ discard block |
||
315 | 315 | * @param boolean $get_cached TRUE to retrieve cached registrations or FALSE to pull from the db |
316 | 316 | * @return EE_Registration[] |
317 | 317 | */ |
318 | - public function registrations( $query_params = array(), $get_cached = FALSE ) { |
|
319 | - $query_params = ( empty( $query_params ) || ! is_array( $query_params ) ) ? array( 'order_by' => array( 'Event.EVT_name' => 'ASC', 'Attendee.ATT_lname' => 'ASC', 'Attendee.ATT_fname' => 'ASC' ) ) : $query_params; |
|
318 | + public function registrations($query_params = array(), $get_cached = FALSE) { |
|
319 | + $query_params = (empty($query_params) || ! is_array($query_params)) ? array('order_by' => array('Event.EVT_name' => 'ASC', 'Attendee.ATT_lname' => 'ASC', 'Attendee.ATT_fname' => 'ASC')) : $query_params; |
|
320 | 320 | $query_params = $get_cached ? array() : $query_params; |
321 | - return $this->get_many_related( 'Registration', $query_params ); |
|
321 | + return $this->get_many_related('Registration', $query_params); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @return mixed EE_Attendee[] by default, int if $output is set to 'COUNT' |
330 | 330 | */ |
331 | 331 | public function attendees() { |
332 | - return $this->get_many_related( 'Attendee', array( array( 'Registration.Transaction.TXN_ID' => $this->ID() ) ) ); |
|
332 | + return $this->get_many_related('Attendee', array(array('Registration.Transaction.TXN_ID' => $this->ID()))); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | * @param array $query_params like EEM_Base::get_all |
340 | 340 | * @return EE_Payment[] |
341 | 341 | */ |
342 | - public function payments( $query_params = array() ) { |
|
343 | - return $this->get_many_related( 'Payment', $query_params ); |
|
342 | + public function payments($query_params = array()) { |
|
343 | + return $this->get_many_related('Payment', $query_params); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | |
@@ -350,8 +350,8 @@ discard block |
||
350 | 350 | * @return EE_Payment[] |
351 | 351 | */ |
352 | 352 | public function approved_payments() { |
353 | - EE_Registry::instance()->load_model( 'Payment' ); |
|
354 | - return $this->get_many_related( 'Payment', array( array( 'STS_ID' => EEM_Payment::status_id_approved ), 'order_by' => array( 'PAY_timestamp' => 'DESC' ) ) ); |
|
353 | + EE_Registry::instance()->load_model('Payment'); |
|
354 | + return $this->get_many_related('Payment', array(array('STS_ID' => EEM_Payment::status_id_approved), 'order_by' => array('PAY_timestamp' => 'DESC'))); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | * @param bool $show_icons |
362 | 362 | * @return string |
363 | 363 | */ |
364 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
365 | - echo $this->pretty_status( $show_icons ); |
|
364 | + public function e_pretty_status($show_icons = FALSE) { |
|
365 | + echo $this->pretty_status($show_icons); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | |
@@ -372,10 +372,10 @@ discard block |
||
372 | 372 | * @param bool $show_icons |
373 | 373 | * @return string |
374 | 374 | */ |
375 | - public function pretty_status( $show_icons = FALSE ) { |
|
376 | - $status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
375 | + public function pretty_status($show_icons = FALSE) { |
|
376 | + $status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
377 | 377 | $icon = ''; |
378 | - switch ( $this->status_ID() ) { |
|
378 | + switch ($this->status_ID()) { |
|
379 | 379 | case EEM_Transaction::complete_status_code: |
380 | 380 | $icon = $show_icons ? '<span class="dashicons dashicons-yes ee-icon-size-24 green-text"></span>' : ''; |
381 | 381 | break; |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | $icon = $show_icons ? '<span class="dashicons dashicons-plus ee-icon-size-16 orange-text"></span>' : ''; |
393 | 393 | break; |
394 | 394 | } |
395 | - return $icon . $status[ $this->status_ID() ]; |
|
395 | + return $icon.$status[$this->status_ID()]; |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | * @access public |
403 | 403 | */ |
404 | 404 | public function status_ID() { |
405 | - return $this->get( 'STS_ID' ); |
|
405 | + return $this->get('STS_ID'); |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @return boolean |
413 | 413 | */ |
414 | 414 | public function is_free() { |
415 | - return (float)$this->get( 'TXN_total' ) == 0 ? TRUE : FALSE; |
|
415 | + return (float) $this->get('TXN_total') == 0 ? TRUE : FALSE; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -480,12 +480,12 @@ discard block |
||
480 | 480 | * @access public |
481 | 481 | * @return string |
482 | 482 | */ |
483 | - public function invoice_url( $type = 'html' ) { |
|
483 | + public function invoice_url($type = 'html') { |
|
484 | 484 | $REG = $this->primary_registration(); |
485 | - if ( ! $REG instanceof EE_Registration ) { |
|
485 | + if ( ! $REG instanceof EE_Registration) { |
|
486 | 486 | return ''; |
487 | 487 | } |
488 | - return $REG->invoice_url( $type ); |
|
488 | + return $REG->invoice_url($type); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | * @return EE_Registration |
496 | 496 | */ |
497 | 497 | public function primary_registration() { |
498 | - return $this->get_first_related( 'Registration', array( array( 'REG_count' => EEM_Registration::PRIMARY_REGISTRANT_COUNT ) ) ); |
|
498 | + return $this->get_first_related('Registration', array(array('REG_count' => EEM_Registration::PRIMARY_REGISTRANT_COUNT))); |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | |
@@ -505,12 +505,12 @@ discard block |
||
505 | 505 | * @param string $type 'pdf' or 'html' (default is 'html') |
506 | 506 | * @return string |
507 | 507 | */ |
508 | - public function receipt_url( $type = 'html' ) { |
|
508 | + public function receipt_url($type = 'html') { |
|
509 | 509 | $REG = $this->primary_registration(); |
510 | - if ( ! $REG instanceof EE_Registration ) { |
|
510 | + if ( ! $REG instanceof EE_Registration) { |
|
511 | 511 | return ''; |
512 | 512 | } |
513 | - return $REG->receipt_url( $type ); |
|
513 | + return $REG->receipt_url($type); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | |
@@ -535,15 +535,15 @@ discard block |
||
535 | 535 | * @deprecated |
536 | 536 | * @return boolean |
537 | 537 | */ |
538 | - public function update_based_on_payments(){ |
|
538 | + public function update_based_on_payments() { |
|
539 | 539 | EE_Error::doing_it_wrong( |
540 | - __CLASS__ . '::' . __FUNCTION__, |
|
541 | - sprintf( __( 'This method is deprecated. Please use "%s" instead', 'event_espresso' ), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()' ), |
|
540 | + __CLASS__.'::'.__FUNCTION__, |
|
541 | + sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()'), |
|
542 | 542 | '4.6.0' |
543 | 543 | ); |
544 | 544 | /** @type EE_Transaction_Processor $transaction_processor */ |
545 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
546 | - return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment( $this ); |
|
545 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
546 | + return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment($this); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | * @return string |
553 | 553 | */ |
554 | 554 | public function gateway_response_on_transaction() { |
555 | - $payment = $this->get_first_related( 'Payment' ); |
|
555 | + $payment = $this->get_first_related('Payment'); |
|
556 | 556 | return $payment instanceof EE_Payment ? $payment->gateway_response() : ''; |
557 | 557 | } |
558 | 558 | |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | * @return EE_Status |
564 | 564 | */ |
565 | 565 | public function status_obj() { |
566 | - return $this->get_first_related( 'Status' ); |
|
566 | + return $this->get_first_related('Status'); |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | |
@@ -573,8 +573,8 @@ discard block |
||
573 | 573 | * @param array $query_params like EEM_Base::get_all |
574 | 574 | * @return EE_Extra_Meta |
575 | 575 | */ |
576 | - public function extra_meta( $query_params = array() ) { |
|
577 | - return $this->get_many_related( 'Extra_Meta', $query_params ); |
|
576 | + public function extra_meta($query_params = array()) { |
|
577 | + return $this->get_many_related('Extra_Meta', $query_params); |
|
578 | 578 | } |
579 | 579 | |
580 | 580 | |
@@ -584,8 +584,8 @@ discard block |
||
584 | 584 | * @param EE_Registration $registration |
585 | 585 | * @return EE_Base_Class the relation was added to |
586 | 586 | */ |
587 | - public function add_registration( EE_Registration $registration ) { |
|
588 | - return $this->_add_relation_to( $registration, 'Registration' ); |
|
587 | + public function add_registration(EE_Registration $registration) { |
|
588 | + return $this->_add_relation_to($registration, 'Registration'); |
|
589 | 589 | } |
590 | 590 | |
591 | 591 | |
@@ -596,8 +596,8 @@ discard block |
||
596 | 596 | * @param int $registration_or_id |
597 | 597 | * @return EE_Base_Class that was removed from being related |
598 | 598 | */ |
599 | - public function remove_registration_with_id( $registration_or_id ) { |
|
600 | - return $this->_remove_relation_to( $registration_or_id, 'Registration' ); |
|
599 | + public function remove_registration_with_id($registration_or_id) { |
|
600 | + return $this->_remove_relation_to($registration_or_id, 'Registration'); |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | * @return EE_Line_Item[] |
608 | 608 | */ |
609 | 609 | public function items_purchased() { |
610 | - return $this->line_items( array( array( 'LIN_type' => EEM_Line_Item::type_line_item ) ) ); |
|
610 | + return $this->line_items(array(array('LIN_type' => EEM_Line_Item::type_line_item))); |
|
611 | 611 | } |
612 | 612 | |
613 | 613 | |
@@ -617,8 +617,8 @@ discard block |
||
617 | 617 | * @param EE_Line_Item $line_item |
618 | 618 | * @return EE_Base_Class the relation was added to |
619 | 619 | */ |
620 | - public function add_line_item( EE_Line_Item $line_item ) { |
|
621 | - return $this->_add_relation_to( $line_item, 'Line_Item' ); |
|
620 | + public function add_line_item(EE_Line_Item $line_item) { |
|
621 | + return $this->_add_relation_to($line_item, 'Line_Item'); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | |
@@ -628,8 +628,8 @@ discard block |
||
628 | 628 | * @param array $query_params |
629 | 629 | * @return EE_Line_Item[] |
630 | 630 | */ |
631 | - public function line_items( $query_params = array() ) { |
|
632 | - return $this->get_many_related( 'Line_Item', $query_params ); |
|
631 | + public function line_items($query_params = array()) { |
|
632 | + return $this->get_many_related('Line_Item', $query_params); |
|
633 | 633 | } |
634 | 634 | |
635 | 635 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | * @return EE_Line_Item[] |
640 | 640 | */ |
641 | 641 | public function tax_items() { |
642 | - return $this->line_items( array( array( 'LIN_type' => EEM_Line_Item::type_tax ) ) ); |
|
642 | + return $this->line_items(array(array('LIN_type' => EEM_Line_Item::type_tax))); |
|
643 | 643 | } |
644 | 644 | |
645 | 645 | |
@@ -650,10 +650,10 @@ discard block |
||
650 | 650 | * @return EE_Line_Item |
651 | 651 | */ |
652 | 652 | public function total_line_item() { |
653 | - $item = $this->get_first_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_total ) ) ); |
|
654 | - if( ! $item ){ |
|
655 | - EE_Registry::instance()->load_helper( 'Line_Item' ); |
|
656 | - $item = EEH_Line_Item::create_total_line_item( $this ); |
|
653 | + $item = $this->get_first_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_total))); |
|
654 | + if ( ! $item) { |
|
655 | + EE_Registry::instance()->load_helper('Line_Item'); |
|
656 | + $item = EEH_Line_Item::create_total_line_item($this); |
|
657 | 657 | } |
658 | 658 | return $item; |
659 | 659 | } |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | */ |
668 | 668 | public function tax_total() { |
669 | 669 | $tax_line_item = $this->tax_total_line_item(); |
670 | - if ( $tax_line_item ) { |
|
670 | + if ($tax_line_item) { |
|
671 | 671 | return $tax_line_item->total(); |
672 | 672 | } else { |
673 | 673 | return 0; |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | * @return EE_Line_Item |
682 | 682 | */ |
683 | 683 | public function tax_total_line_item() { |
684 | - return $this->get_first_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax_sub_total ) ) ); |
|
684 | + return $this->get_first_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax_sub_total))); |
|
685 | 685 | } |
686 | 686 | |
687 | 687 | |
@@ -690,20 +690,20 @@ discard block |
||
690 | 690 | * Gets the array of billing info for the gateway and for this transaction's primary registration's attendee. |
691 | 691 | * @return EE_Form_Section_Proper |
692 | 692 | */ |
693 | - public function billing_info(){ |
|
693 | + public function billing_info() { |
|
694 | 694 | $payment_method = $this->payment_method(); |
695 | - if ( !$payment_method){ |
|
695 | + if ( ! $payment_method) { |
|
696 | 696 | EE_Error::add_error(__("Could not find billing info for transaction because no gateway has been used for it yet", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
697 | 697 | return false; |
698 | 698 | } |
699 | 699 | $primary_reg = $this->primary_registration(); |
700 | - if ( ! $primary_reg ) { |
|
701 | - EE_Error::add_error( __( "Cannot get billing info for gateway %s on transaction because no primary registration exists", "event_espresso" ), __FILE__, __FUNCTION__, __LINE__ ); |
|
700 | + if ( ! $primary_reg) { |
|
701 | + EE_Error::add_error(__("Cannot get billing info for gateway %s on transaction because no primary registration exists", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
|
702 | 702 | return FALSE; |
703 | 703 | } |
704 | 704 | $attendee = $primary_reg->attendee(); |
705 | - if ( ! $attendee ) { |
|
706 | - EE_Error::add_error( __( "Cannot get billing info for gateway %s on transaction because the primary registration has no attendee exists", "event_espresso" ), __FILE__, __FUNCTION__, __LINE__ ); |
|
705 | + if ( ! $attendee) { |
|
706 | + EE_Error::add_error(__("Cannot get billing info for gateway %s on transaction because the primary registration has no attendee exists", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
|
707 | 707 | return FALSE; |
708 | 708 | } |
709 | 709 | return $attendee->billing_info_for_payment_method($payment_method); |
@@ -738,15 +738,15 @@ discard block |
||
738 | 738 | * offline ones, dont' create payments) |
739 | 739 | * @return EE_Payment_Method |
740 | 740 | */ |
741 | - function payment_method(){ |
|
741 | + function payment_method() { |
|
742 | 742 | $pm = $this->get_first_related('Payment_Method'); |
743 | - if( $pm instanceof EE_Payment_Method ){ |
|
743 | + if ($pm instanceof EE_Payment_Method) { |
|
744 | 744 | return $pm; |
745 | - }else{ |
|
745 | + } else { |
|
746 | 746 | $last_payment = $this->last_payment(); |
747 | - if( $last_payment instanceof EE_Payment && $last_payment->payment_method() ){ |
|
747 | + if ($last_payment instanceof EE_Payment && $last_payment->payment_method()) { |
|
748 | 748 | return $last_payment->payment_method(); |
749 | - }else{ |
|
749 | + } else { |
|
750 | 750 | return NULL; |
751 | 751 | } |
752 | 752 | } |
@@ -757,15 +757,15 @@ discard block |
||
757 | 757 | * @return EE_Payment |
758 | 758 | */ |
759 | 759 | public function last_payment() { |
760 | - return $this->get_first_related( 'Payment', array( 'order_by' => array( 'PAY_ID' => 'desc' ) ) ); |
|
760 | + return $this->get_first_related('Payment', array('order_by' => array('PAY_ID' => 'desc'))); |
|
761 | 761 | } |
762 | 762 | |
763 | 763 | /** |
764 | 764 | * Gets all the line items which are unrelated to tickets on this transaction |
765 | 765 | * @return EE_Line_Item[] |
766 | 766 | */ |
767 | - public function non_ticket_line_items(){ |
|
768 | - return EEM_Line_Item::instance()->get_all_non_ticket_line_items_for_transaction( $this->ID() ); |
|
767 | + public function non_ticket_line_items() { |
|
768 | + return EEM_Line_Item::instance()->get_all_non_ticket_line_items_for_transaction($this->ID()); |
|
769 | 769 | } |
770 | 770 | |
771 | 771 |
@@ -742,11 +742,11 @@ |
||
742 | 742 | $pm = $this->get_first_related('Payment_Method'); |
743 | 743 | if( $pm instanceof EE_Payment_Method ){ |
744 | 744 | return $pm; |
745 | - }else{ |
|
745 | + } else{ |
|
746 | 746 | $last_payment = $this->last_payment(); |
747 | 747 | if( $last_payment instanceof EE_Payment && $last_payment->payment_method() ){ |
748 | 748 | return $last_payment->payment_method(); |
749 | - }else{ |
|
749 | + } else{ |
|
750 | 750 | return NULL; |
751 | 751 | } |
752 | 752 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param array $props_n_values incoming values from the database |
49 | 49 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
50 | 50 | * the website will be used. |
51 | - * @return EE_Attendee |
|
51 | + * @return EE_Venue |
|
52 | 52 | */ |
53 | 53 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
54 | 54 | return new self( $props_n_values, TRUE, $timezone ); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Gets name |
61 | - * @return string |
|
61 | + * @return boolean |
|
62 | 62 | */ |
63 | 63 | function name() { |
64 | 64 | return $this->get( 'VNU_name' ); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Gets phone |
70 | - * @return string |
|
70 | + * @return boolean |
|
71 | 71 | */ |
72 | 72 | function phone() { |
73 | 73 | return $this->get( 'VNU_phone' ); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | /** |
79 | 79 | * venue_url |
80 | - * @return string |
|
80 | + * @return boolean |
|
81 | 81 | */ |
82 | 82 | function venue_url() { |
83 | 83 | return $this->get( 'VNU_url' ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | /** |
88 | 88 | * Gets desc |
89 | - * @return string |
|
89 | + * @return boolean |
|
90 | 90 | */ |
91 | 91 | function description() { |
92 | 92 | return $this->get( 'VNU_desc' ); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | /** |
98 | 98 | * Gets short description (AKA: the excerpt) |
99 | - * @return string |
|
99 | + * @return boolean |
|
100 | 100 | */ |
101 | 101 | function excerpt() { |
102 | 102 | return $this->get( 'VNU_short_desc' ); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Gets identifier |
109 | - * @return string |
|
109 | + * @return boolean |
|
110 | 110 | */ |
111 | 111 | function identifier() { |
112 | 112 | return $this->get( 'VNU_identifier' ); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | /** |
118 | 118 | * Gets address |
119 | - * @return string |
|
119 | + * @return boolean |
|
120 | 120 | */ |
121 | 121 | function address() { |
122 | 122 | return $this->get( 'VNU_address' ); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | /** |
128 | 128 | * Gets address2 |
129 | - * @return string |
|
129 | + * @return boolean |
|
130 | 130 | */ |
131 | 131 | function address2() { |
132 | 132 | return $this->get( 'VNU_address2' ); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | /** |
139 | 139 | * Gets city |
140 | - * @return string |
|
140 | + * @return boolean |
|
141 | 141 | */ |
142 | 142 | function city() { |
143 | 143 | return $this->get( 'VNU_city' ); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | /** |
147 | 147 | * Gets state |
148 | - * @return int |
|
148 | + * @return boolean |
|
149 | 149 | */ |
150 | 150 | function state_ID() { |
151 | 151 | return $this->get( 'STA_ID' ); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | /** |
201 | 201 | * country_ID |
202 | - * @return string |
|
202 | + * @return boolean |
|
203 | 203 | */ |
204 | 204 | function country_ID() { |
205 | 205 | return $this->get( 'CNT_ISO' ); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | /** |
246 | 246 | * Gets zip |
247 | - * @return string |
|
247 | + * @return boolean |
|
248 | 248 | */ |
249 | 249 | function zip() { |
250 | 250 | return $this->get( 'VNU_zip' ); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | |
265 | 265 | /** |
266 | 266 | * Gets created |
267 | - * @return string |
|
267 | + * @return boolean |
|
268 | 268 | */ |
269 | 269 | function created() { |
270 | 270 | return $this->get( 'VNU_created' ); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | /** |
276 | 276 | * Gets modified |
277 | - * @return string |
|
277 | + * @return boolean |
|
278 | 278 | */ |
279 | 279 | function modified() { |
280 | 280 | return $this->get( 'VNU_modified' ); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | /** |
286 | 286 | * Gets order |
287 | - * @return int |
|
287 | + * @return boolean |
|
288 | 288 | */ |
289 | 289 | function order() { |
290 | 290 | return $this->get( 'VNU_order' ); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | /** |
296 | 296 | * Gets wp_user |
297 | - * @return int |
|
297 | + * @return boolean |
|
298 | 298 | */ |
299 | 299 | function wp_user() { |
300 | 300 | return $this->get( 'VNU_wp_user' ); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | |
305 | 305 | /** |
306 | - * @return string |
|
306 | + * @return boolean |
|
307 | 307 | */ |
308 | 308 | function virtual_phone() { |
309 | 309 | return $this->get( 'VNU_virtual_phone' ); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | |
314 | 314 | /** |
315 | - * @return string |
|
315 | + * @return boolean |
|
316 | 316 | */ |
317 | 317 | function virtual_url() { |
318 | 318 | return $this->get( 'VNU_virtual_url' ); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | |
332 | 332 | /** |
333 | - * @return string |
|
333 | + * @return boolean |
|
334 | 334 | */ |
335 | 335 | function google_map_link() { |
336 | 336 | return $this->get( 'VNU_google_map_link' ); |
@@ -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 |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | * date_format and the second value is the time format |
38 | 38 | * @return EE_Attendee |
39 | 39 | */ |
40 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
41 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
42 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
40 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
41 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
42 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | * the website will be used. |
51 | 51 | * @return EE_Attendee |
52 | 52 | */ |
53 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
54 | - return new self( $props_n_values, TRUE, $timezone ); |
|
53 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
54 | + return new self($props_n_values, TRUE, $timezone); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @return string |
62 | 62 | */ |
63 | 63 | function name() { |
64 | - return $this->get( 'VNU_name' ); |
|
64 | + return $this->get('VNU_name'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @return string |
71 | 71 | */ |
72 | 72 | function phone() { |
73 | - return $this->get( 'VNU_phone' ); |
|
73 | + return $this->get('VNU_phone'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @return string |
81 | 81 | */ |
82 | 82 | function venue_url() { |
83 | - return $this->get( 'VNU_url' ); |
|
83 | + return $this->get('VNU_url'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @return string |
90 | 90 | */ |
91 | 91 | function description() { |
92 | - return $this->get( 'VNU_desc' ); |
|
92 | + return $this->get('VNU_desc'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return string |
100 | 100 | */ |
101 | 101 | function excerpt() { |
102 | - return $this->get( 'VNU_short_desc' ); |
|
102 | + return $this->get('VNU_short_desc'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @return string |
110 | 110 | */ |
111 | 111 | function identifier() { |
112 | - return $this->get( 'VNU_identifier' ); |
|
112 | + return $this->get('VNU_identifier'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @return string |
120 | 120 | */ |
121 | 121 | function address() { |
122 | - return $this->get( 'VNU_address' ); |
|
122 | + return $this->get('VNU_address'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return string |
130 | 130 | */ |
131 | 131 | function address2() { |
132 | - return $this->get( 'VNU_address2' ); |
|
132 | + return $this->get('VNU_address2'); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @return string |
141 | 141 | */ |
142 | 142 | function city() { |
143 | - return $this->get( 'VNU_city' ); |
|
143 | + return $this->get('VNU_city'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @return int |
149 | 149 | */ |
150 | 150 | function state_ID() { |
151 | - return $this->get( 'STA_ID' ); |
|
151 | + return $this->get('STA_ID'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @return string |
158 | 158 | */ |
159 | 159 | public function state_abbrev() { |
160 | - return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __( 'Unknown', 'event_espresso' ); |
|
160 | + return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __('Unknown', 'event_espresso'); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * @return string |
167 | 167 | */ |
168 | 168 | public function state_name() { |
169 | - return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() : __( 'Unknown', 'event_espresso' ); |
|
169 | + return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() : __('Unknown', 'event_espresso'); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @return EE_State |
177 | 177 | */ |
178 | 178 | function state_obj() { |
179 | - return $this->get_first_related( 'State' ); |
|
179 | + return $this->get_first_related('State'); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * @return string |
189 | 189 | */ |
190 | 190 | public function state() { |
191 | - if ( apply_filters( 'FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj() ) ) { |
|
191 | + if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) { |
|
192 | 192 | return $this->state_abbrev(); |
193 | 193 | } else { |
194 | 194 | return $this->state_name(); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @return string |
203 | 203 | */ |
204 | 204 | function country_ID() { |
205 | - return $this->get( 'CNT_ISO' ); |
|
205 | + return $this->get('CNT_ISO'); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @return string |
212 | 212 | */ |
213 | 213 | public function country_name() { |
214 | - return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() : __( 'Unknown', 'event_espresso' ); |
|
214 | + return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() : __('Unknown', 'event_espresso'); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @return EE_Country |
222 | 222 | */ |
223 | 223 | function country_obj() { |
224 | - return $this->get_first_related( 'Country' ); |
|
224 | + return $this->get_first_related('Country'); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @return string |
234 | 234 | */ |
235 | 235 | public function country() { |
236 | - if ( apply_filters( 'FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj() ) ) { |
|
236 | + if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) { |
|
237 | 237 | return $this->country_ID(); |
238 | 238 | } else { |
239 | 239 | return $this->country_name(); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * @return string |
248 | 248 | */ |
249 | 249 | function zip() { |
250 | - return $this->get( 'VNU_zip' ); |
|
250 | + return $this->get('VNU_zip'); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * @return int |
258 | 258 | */ |
259 | 259 | function capacity() { |
260 | - return $this->get_pretty( 'VNU_capacity', 'symbol' ); |
|
260 | + return $this->get_pretty('VNU_capacity', 'symbol'); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @return string |
268 | 268 | */ |
269 | 269 | function created() { |
270 | - return $this->get( 'VNU_created' ); |
|
270 | + return $this->get('VNU_created'); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @return string |
278 | 278 | */ |
279 | 279 | function modified() { |
280 | - return $this->get( 'VNU_modified' ); |
|
280 | + return $this->get('VNU_modified'); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * @return int |
288 | 288 | */ |
289 | 289 | function order() { |
290 | - return $this->get( 'VNU_order' ); |
|
290 | + return $this->get('VNU_order'); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @return int |
298 | 298 | */ |
299 | 299 | function wp_user() { |
300 | - return $this->get( 'VNU_wp_user' ); |
|
300 | + return $this->get('VNU_wp_user'); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @return string |
307 | 307 | */ |
308 | 308 | function virtual_phone() { |
309 | - return $this->get( 'VNU_virtual_phone' ); |
|
309 | + return $this->get('VNU_virtual_phone'); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | * @return string |
316 | 316 | */ |
317 | 317 | function virtual_url() { |
318 | - return $this->get( 'VNU_virtual_url' ); |
|
318 | + return $this->get('VNU_virtual_url'); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | * @return bool |
325 | 325 | */ |
326 | 326 | function enable_for_gmap() { |
327 | - return $this->get( 'VNU_enable_for_gmap' ); |
|
327 | + return $this->get('VNU_enable_for_gmap'); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @return string |
334 | 334 | */ |
335 | 335 | function google_map_link() { |
336 | - return $this->get( 'VNU_google_map_link' ); |
|
336 | + return $this->get('VNU_google_map_link'); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | |
@@ -345,16 +345,16 @@ discard block |
||
345 | 345 | * @param bool $upcoming |
346 | 346 | * @return EE_Event[] |
347 | 347 | */ |
348 | - function events( $query_params = array(), $upcoming = FALSE ) { |
|
349 | - if ( $upcoming ) { |
|
348 | + function events($query_params = array(), $upcoming = FALSE) { |
|
349 | + if ($upcoming) { |
|
350 | 350 | $query_params = array( |
351 | 351 | array( |
352 | 352 | 'status' => 'publish', |
353 | - 'Datetime.DTT_EVT_start' => array( '>', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_start' ) ) |
|
353 | + 'Datetime.DTT_EVT_start' => array('>', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start')) |
|
354 | 354 | ) |
355 | 355 | ); |
356 | 356 | } |
357 | - return $this->get_many_related( 'Event', $query_params ); |
|
357 | + return $this->get_many_related('Event', $query_params); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | |
@@ -372,8 +372,8 @@ discard block |
||
372 | 372 | /** |
373 | 373 | * Sets address |
374 | 374 | */ |
375 | - function set_address( $address = '' ) { |
|
376 | - $this->set( 'VNU_address', $address ); |
|
375 | + function set_address($address = '') { |
|
376 | + $this->set('VNU_address', $address); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | /** |
382 | 382 | * @param string $address2 |
383 | 383 | */ |
384 | - function set_address2( $address2 = '' ) { |
|
385 | - $this->set( 'VNU_address2', $address2 ); |
|
384 | + function set_address2($address2 = '') { |
|
385 | + $this->set('VNU_address2', $address2); |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | |
@@ -390,8 +390,8 @@ discard block |
||
390 | 390 | /** |
391 | 391 | * @param string $city |
392 | 392 | */ |
393 | - function set_city( $city = '' ) { |
|
394 | - $this->set( 'VNU_city', $city ); |
|
393 | + function set_city($city = '') { |
|
394 | + $this->set('VNU_city', $city); |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | |
@@ -399,8 +399,8 @@ discard block |
||
399 | 399 | /** |
400 | 400 | * @param int $state |
401 | 401 | */ |
402 | - function set_state_ID( $state = 0 ) { |
|
403 | - $this->set( 'STA_ID', $state ); |
|
402 | + function set_state_ID($state = 0) { |
|
403 | + $this->set('STA_ID', $state); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | * @param EE_State /int $state_id_or_obj |
412 | 412 | * @return EE_State |
413 | 413 | */ |
414 | - function set_state_obj( $state_id_or_obj ) { |
|
415 | - return $this->_add_relation_to( $state_id_or_obj, 'State' ); |
|
414 | + function set_state_obj($state_id_or_obj) { |
|
415 | + return $this->_add_relation_to($state_id_or_obj, 'State'); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -420,8 +420,8 @@ discard block |
||
420 | 420 | /** |
421 | 421 | * @param int $country_ID |
422 | 422 | */ |
423 | - function set_country_ID( $country_ID = 0 ) { |
|
424 | - $this->set( 'CNT_ISO', $country_ID ); |
|
423 | + function set_country_ID($country_ID = 0) { |
|
424 | + $this->set('CNT_ISO', $country_ID); |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | * @param EE_Country /string $country_id_or_obj |
431 | 431 | * @return EE_Country |
432 | 432 | */ |
433 | - function set_country_obj( $country_id_or_obj ) { |
|
433 | + function set_country_obj($country_id_or_obj) { |
|
434 | 434 | return $this->_add_relation_to($country_id_or_obj, 'Country'); |
435 | 435 | } |
436 | 436 | |
@@ -439,8 +439,8 @@ discard block |
||
439 | 439 | /** |
440 | 440 | * @param string $zip |
441 | 441 | */ |
442 | - function set_zip( $zip = '' ) { |
|
443 | - $this->set( 'VNU_zip', $zip ); |
|
442 | + function set_zip($zip = '') { |
|
443 | + $this->set('VNU_zip', $zip); |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | |
@@ -448,8 +448,8 @@ discard block |
||
448 | 448 | /** |
449 | 449 | * @param int $capacity |
450 | 450 | */ |
451 | - function set_capacity( $capacity = 0 ) { |
|
452 | - $this->set( 'VNU_capacity', $capacity ); |
|
451 | + function set_capacity($capacity = 0) { |
|
452 | + $this->set('VNU_capacity', $capacity); |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | |
@@ -457,8 +457,8 @@ discard block |
||
457 | 457 | /** |
458 | 458 | * @param string $created |
459 | 459 | */ |
460 | - function set_created( $created = '' ) { |
|
461 | - $this->set( 'VNU_created', $created ); |
|
460 | + function set_created($created = '') { |
|
461 | + $this->set('VNU_created', $created); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | |
@@ -466,8 +466,8 @@ discard block |
||
466 | 466 | /** |
467 | 467 | * @param string $desc |
468 | 468 | */ |
469 | - function set_description( $desc = '' ) { |
|
470 | - $this->set( 'VNU_desc', $desc ); |
|
469 | + function set_description($desc = '') { |
|
470 | + $this->set('VNU_desc', $desc); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | |
@@ -475,8 +475,8 @@ discard block |
||
475 | 475 | /** |
476 | 476 | * @param string $identifier |
477 | 477 | */ |
478 | - function set_identifier( $identifier = '' ) { |
|
479 | - $this->set( 'VNU_identifier', $identifier ); |
|
478 | + function set_identifier($identifier = '') { |
|
479 | + $this->set('VNU_identifier', $identifier); |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | |
@@ -484,8 +484,8 @@ discard block |
||
484 | 484 | /** |
485 | 485 | * @param string $modified |
486 | 486 | */ |
487 | - function set_modified( $modified = '' ) { |
|
488 | - $this->set( 'VNU_modified', $modified ); |
|
487 | + function set_modified($modified = '') { |
|
488 | + $this->set('VNU_modified', $modified); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | |
@@ -493,8 +493,8 @@ discard block |
||
493 | 493 | /** |
494 | 494 | * @param string $name |
495 | 495 | */ |
496 | - function set_name( $name = '' ) { |
|
497 | - $this->set( 'VNU_name', $name ); |
|
496 | + function set_name($name = '') { |
|
497 | + $this->set('VNU_name', $name); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | |
@@ -502,8 +502,8 @@ discard block |
||
502 | 502 | /** |
503 | 503 | * @param int $order |
504 | 504 | */ |
505 | - function set_order( $order = 0 ) { |
|
506 | - $this->set( 'VNU_order', $order ); |
|
505 | + function set_order($order = 0) { |
|
506 | + $this->set('VNU_order', $order); |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | |
@@ -511,8 +511,8 @@ discard block |
||
511 | 511 | /** |
512 | 512 | * @param string $phone |
513 | 513 | */ |
514 | - function set_phone( $phone = '' ) { |
|
515 | - $this->set( 'VNU_phone', $phone ); |
|
514 | + function set_phone($phone = '') { |
|
515 | + $this->set('VNU_phone', $phone); |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | |
@@ -520,8 +520,8 @@ discard block |
||
520 | 520 | /** |
521 | 521 | * @param int $wp_user |
522 | 522 | */ |
523 | - function set_wp_user( $wp_user = 1 ) { |
|
524 | - $this->set( 'VNU_wp_user', $wp_user ); |
|
523 | + function set_wp_user($wp_user = 1) { |
|
524 | + $this->set('VNU_wp_user', $wp_user); |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | |
@@ -529,8 +529,8 @@ discard block |
||
529 | 529 | /** |
530 | 530 | * @param string $url |
531 | 531 | */ |
532 | - function set_venue_url( $url = '' ) { |
|
533 | - $this->set( 'VNU_url', $url ); |
|
532 | + function set_venue_url($url = '') { |
|
533 | + $this->set('VNU_url', $url); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | |
@@ -538,8 +538,8 @@ discard block |
||
538 | 538 | /** |
539 | 539 | * @param string $phone |
540 | 540 | */ |
541 | - function set_virtual_phone( $phone = '' ) { |
|
542 | - $this->set( 'VNU_virtual_phone', $phone ); |
|
541 | + function set_virtual_phone($phone = '') { |
|
542 | + $this->set('VNU_virtual_phone', $phone); |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | |
@@ -547,8 +547,8 @@ discard block |
||
547 | 547 | /** |
548 | 548 | * @param string $url |
549 | 549 | */ |
550 | - function set_virtual_url( $url = '' ) { |
|
551 | - $this->set( 'VNU_virtual_url', $url ); |
|
550 | + function set_virtual_url($url = '') { |
|
551 | + $this->set('VNU_virtual_url', $url); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | |
@@ -556,8 +556,8 @@ discard block |
||
556 | 556 | /** |
557 | 557 | * @param string $enable |
558 | 558 | */ |
559 | - function set_enable_for_gmap( $enable = '' ) { |
|
560 | - $this->set( 'VNU_enable_for_gmap', $enable ); |
|
559 | + function set_enable_for_gmap($enable = '') { |
|
560 | + $this->set('VNU_enable_for_gmap', $enable); |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | |
@@ -565,8 +565,8 @@ discard block |
||
565 | 565 | /** |
566 | 566 | * @param string $google_map_link |
567 | 567 | */ |
568 | - function set_google_map_link( $google_map_link = '' ) { |
|
569 | - $this->set( 'VNU_google_map_link', $google_map_link ); |
|
568 | + function set_google_map_link($google_map_link = '') { |
|
569 | + $this->set('VNU_google_map_link', $google_map_link); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param string $log_type !see the acceptable values of LOG_type in EEM__Change_Log::__construct |
118 | 118 | * @param mixed $message array|string of the message you want to record |
119 | 119 | * @param EE_Base_Class $related_model_obj |
120 | - * @return EE_Change_Log |
|
120 | + * @return EE_Attendee |
|
121 | 121 | */ |
122 | 122 | public function log($log_type,$message,$related_model_obj){ |
123 | 123 | if($related_model_obj instanceof EE_Base_Class){ |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @param mixed $related_obj_id |
146 | 146 | * @param string $related_obj_type |
147 | 147 | * @throws EE_Error |
148 | - * @return EE_Change_Log |
|
148 | + * @return EE_Attendee |
|
149 | 149 | */ |
150 | 150 | public function gateway_log( $message, $related_obj_id, $related_obj_type ){ |
151 | 151 | if( ! EE_Registry::instance()->is_model_name($related_obj_type)){ |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EEM_Change_Log extends EEM_Base{ |
|
28 | +class EEM_Change_Log extends EEM_Base { |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * the related object was created log type |
@@ -68,19 +68,19 @@ discard block |
||
68 | 68 | * @access protected |
69 | 69 | * @return EEM_Change_Log |
70 | 70 | */ |
71 | - protected function __construct( $timezone = null ){ |
|
71 | + protected function __construct($timezone = null) { |
|
72 | 72 | global $current_user; |
73 | - $this->singular_item = __('Log','event_espresso'); |
|
74 | - $this->plural_item = __('Logs','event_espresso'); |
|
73 | + $this->singular_item = __('Log', 'event_espresso'); |
|
74 | + $this->plural_item = __('Logs', 'event_espresso'); |
|
75 | 75 | $this->_tables = array( |
76 | 76 | 'Log'=> new EE_Primary_Table('esp_log', 'LOG_ID') |
77 | 77 | ); |
78 | 78 | $models_this_can_attach_to = array_keys(EE_Registry::instance()->non_abstract_db_models); |
79 | 79 | $this->_fields = array( |
80 | 80 | 'Log'=>array( |
81 | - 'LOG_ID'=> new EE_Primary_Key_Int_Field('LOG_ID', __('Log ID','event_espresso')), |
|
81 | + 'LOG_ID'=> new EE_Primary_Key_Int_Field('LOG_ID', __('Log ID', 'event_espresso')), |
|
82 | 82 | 'LOG_time'=>new EE_Datetime_Field('LOG_time', __("Log Time", 'event_espresso'), false, time()), |
83 | - 'OBJ_ID'=>new EE_Foreign_Key_String_Field('OBJ_ID', __("Object ID (int or string)", 'event_espresso'), true, NULL,$models_this_can_attach_to), |
|
83 | + 'OBJ_ID'=>new EE_Foreign_Key_String_Field('OBJ_ID', __("Object ID (int or string)", 'event_espresso'), true, NULL, $models_this_can_attach_to), |
|
84 | 84 | 'OBJ_type'=>new EE_Any_Foreign_Model_Name_Field('OBJ_type', __("Object Type", 'event_espresso'), true, NULL, $models_this_can_attach_to), |
85 | 85 | 'LOG_type'=>new EE_Enum_Text_Field('LOG_type', __("Type of log entry", "event_espresso"), false, self::type_debug, |
86 | 86 | array( |
@@ -92,24 +92,24 @@ discard block |
||
92 | 92 | self::type_gateway=> __("Gateway Interaction (IPN or Direct Payment)", 'event_espresso'), |
93 | 93 | )), |
94 | 94 | 'LOG_message'=>new EE_Maybe_Serialized_Text_Field('LOG_message', __("Log Message (body)", 'event_espresso'), true), |
95 | - 'LOG_wp_user' => new EE_WP_User_Field('LOG_wp_user', __("User who was logged in while this occurred", 'event_espresso'), true ), |
|
95 | + 'LOG_wp_user' => new EE_WP_User_Field('LOG_wp_user', __("User who was logged in while this occurred", 'event_espresso'), true), |
|
96 | 96 | |
97 | 97 | )); |
98 | 98 | $this->_model_relations = array(); |
99 | - foreach($models_this_can_attach_to as $model){ |
|
100 | - if( $model == 'WP_User' ){ |
|
101 | - $this->_model_relations[ $model ] = new EE_Belongs_To_Relation(); |
|
102 | - }elseif( $model != 'Change_Log' ) { |
|
99 | + foreach ($models_this_can_attach_to as $model) { |
|
100 | + if ($model == 'WP_User') { |
|
101 | + $this->_model_relations[$model] = new EE_Belongs_To_Relation(); |
|
102 | + }elseif ($model != 'Change_Log') { |
|
103 | 103 | $this->_model_relations[$model] = new EE_Belongs_To_Any_Relation(); |
104 | 104 | } |
105 | 105 | } |
106 | 106 | //use completely custom caps for this |
107 | 107 | $this->_cap_restriction_generators = false; |
108 | 108 | //caps-wise this is all-or-nothing: if you have the default role you can access anything, otherwise nothing |
109 | - foreach( $this->_cap_contexts_to_cap_action_map as $cap_context => $action ) { |
|
110 | - $this->_cap_restrictions[ $cap_context ][ EE_Restriction_Generator_Base::get_default_restrictions_cap() ] = new EE_Return_None_Where_Conditions(); |
|
109 | + foreach ($this->_cap_contexts_to_cap_action_map as $cap_context => $action) { |
|
110 | + $this->_cap_restrictions[$cap_context][EE_Restriction_Generator_Base::get_default_restrictions_cap()] = new EE_Return_None_Where_Conditions(); |
|
111 | 111 | } |
112 | - parent::__construct( $timezone ); |
|
112 | + parent::__construct($timezone); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | * @param EE_Base_Class $related_model_obj |
120 | 120 | * @return EE_Change_Log |
121 | 121 | */ |
122 | - public function log($log_type,$message,$related_model_obj){ |
|
123 | - if($related_model_obj instanceof EE_Base_Class){ |
|
122 | + public function log($log_type, $message, $related_model_obj) { |
|
123 | + if ($related_model_obj instanceof EE_Base_Class) { |
|
124 | 124 | $obj_id = $related_model_obj->ID(); |
125 | 125 | $obj_type = $related_model_obj->get_model()->get_this_model_name(); |
126 | - }else{ |
|
126 | + } else { |
|
127 | 127 | $obj_id = NULL; |
128 | 128 | $obj_type = NULL; |
129 | 129 | } |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | * @throws EE_Error |
148 | 148 | * @return EE_Change_Log |
149 | 149 | */ |
150 | - public function gateway_log( $message, $related_obj_id, $related_obj_type ){ |
|
151 | - if( ! EE_Registry::instance()->is_model_name($related_obj_type)){ |
|
152 | - throw new EE_Error(sprintf(__("'%s' is not a model name. A model name must be provided when making a gateway log. Eg, 'Payment', 'Payment_Method', etc", "event_espresso"),$related_obj_type)); |
|
150 | + public function gateway_log($message, $related_obj_id, $related_obj_type) { |
|
151 | + if ( ! EE_Registry::instance()->is_model_name($related_obj_type)) { |
|
152 | + throw new EE_Error(sprintf(__("'%s' is not a model name. A model name must be provided when making a gateway log. Eg, 'Payment', 'Payment_Method', etc", "event_espresso"), $related_obj_type)); |
|
153 | 153 | } |
154 | 154 | $log = EE_Change_Log::new_instance(array( |
155 | 155 | 'LOG_type'=>EEM_Change_Log::type_gateway, |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @param array $query_params @see EEM_Base::get_all |
169 | 169 | * @return array of arrays |
170 | 170 | */ |
171 | - public function get_all_efficiently($query_params){ |
|
171 | + public function get_all_efficiently($query_params) { |
|
172 | 172 | return $this->_get_all_wpdb_results($query_params); |
173 | 173 | } |
174 | 174 |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -99,7 +100,7 @@ discard block |
||
99 | 100 | foreach($models_this_can_attach_to as $model){ |
100 | 101 | if( $model == 'WP_User' ){ |
101 | 102 | $this->_model_relations[ $model ] = new EE_Belongs_To_Relation(); |
102 | - }elseif( $model != 'Change_Log' ) { |
|
103 | + } elseif( $model != 'Change_Log' ) { |
|
103 | 104 | $this->_model_relations[$model] = new EE_Belongs_To_Any_Relation(); |
104 | 105 | } |
105 | 106 | } |
@@ -123,7 +124,7 @@ discard block |
||
123 | 124 | if($related_model_obj instanceof EE_Base_Class){ |
124 | 125 | $obj_id = $related_model_obj->ID(); |
125 | 126 | $obj_type = $related_model_obj->get_model()->get_this_model_name(); |
126 | - }else{ |
|
127 | + } else{ |
|
127 | 128 | $obj_id = NULL; |
128 | 129 | $obj_type = NULL; |
129 | 130 | } |