@@ -1,18 +1,18 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Required by EEM_Event_Question_Group in case someone queries for all its model objects |
6 | 6 | */ |
7 | -class EE_Event_Question_Group extends EE_Base_Class{ |
|
7 | +class EE_Event_Question_Group extends EE_Base_Class { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * @param array $props_n_values |
11 | 11 | * @return EE_Event_Question_Group|mixed |
12 | 12 | */ |
13 | - public static function new_instance( $props_n_values = array() ) { |
|
14 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
15 | - return $has_object ? $has_object : new self( $props_n_values); |
|
13 | + public static function new_instance($props_n_values = array()) { |
|
14 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
15 | + return $has_object ? $has_object : new self($props_n_values); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @param array $props_n_values |
22 | 22 | * @return EE_Event_Question_Group |
23 | 23 | */ |
24 | - public static function new_instance_from_db ( $props_n_values = array() ) { |
|
25 | - return new self( $props_n_values, TRUE ); |
|
24 | + public static function new_instance_from_db($props_n_values = array()) { |
|
25 | + return new self($props_n_values, TRUE); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Required by EEM_Event_Question_Group in case someone queries for all its model objects |
4 | 4 | */ |
5 | -class EE_Event_Venue extends EE_Base_Class{ |
|
5 | +class EE_Event_Venue extends EE_Base_Class { |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * @param array $props_n_values |
9 | 9 | * @return EE_Event_Venue|mixed |
10 | 10 | */ |
11 | - public static function new_instance( $props_n_values = array() ) { |
|
12 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
13 | - return $has_object ? $has_object : new self( $props_n_values); |
|
11 | + public static function new_instance($props_n_values = array()) { |
|
12 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
13 | + return $has_object ? $has_object : new self($props_n_values); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | * @param array $props_n_values |
20 | 20 | * @return EE_Event_Venue |
21 | 21 | */ |
22 | - public static function new_instance_from_db ( $props_n_values = array() ) { |
|
23 | - return new self( $props_n_values, TRUE ); |
|
22 | + public static function new_instance_from_db($props_n_values = array()) { |
|
23 | + return new self($props_n_values, TRUE); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | EE_Error::doing_it_wrong('EE_Payment::gateway', __( 'The method EE_Payment::gateway() has been deprecated. Consider instead using EE_Payment::payment_method()->name()', 'event_espresso' ), '4.6.0' ); |
143 | 143 | if( $this->payment_method() ){ |
144 | 144 | return $this->payment_method()->name(); |
145 | - }else{ |
|
145 | + } else{ |
|
146 | 146 | return __( 'Unknown', 'event_espresso' ); |
147 | 147 | } |
148 | 148 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | public function set_payment_made_via_admin( $via_admin = FALSE ) { |
195 | 195 | if($via_admin){ |
196 | 196 | $this->set('PAY_source', EEM_Payment_Method::scope_admin); |
197 | - }else{ |
|
197 | + } else{ |
|
198 | 198 | $this->set('PAY_source', EEM_Payment_Method::scope_cart); |
199 | 199 | } |
200 | 200 | |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | } |
619 | 619 | if( is_array( $item ) ){ |
620 | 620 | array_walk_recursive( $item, array( $this, '_strip_all_tags_within_array' ) ); |
621 | - }else{ |
|
621 | + } else{ |
|
622 | 622 | $item = wp_strip_all_tags( $item ); |
623 | 623 | } |
624 | 624 | } |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | $current_status = $this->status(); |
635 | 635 | if( $original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved ){ |
636 | 636 | return TRUE; |
637 | - }else{ |
|
637 | + } else{ |
|
638 | 638 | return FALSE; |
639 | 639 | } |
640 | 640 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | /** |
286 | 286 | * get Payment Amount |
287 | 287 | * @access public |
288 | - * @return float |
|
288 | + * @return boolean |
|
289 | 289 | */ |
290 | 290 | public function amount() { |
291 | 291 | return $this->get( 'PAY_amount' ); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | |
364 | 364 | /** |
365 | 365 | * Gets redirect_url |
366 | - * @return string |
|
366 | + * @return boolean |
|
367 | 367 | */ |
368 | 368 | function redirect_url() { |
369 | 369 | return $this->get('PAY_redirect_url'); |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | |
374 | 374 | /** |
375 | 375 | * Gets redirect_args |
376 | - * @return array |
|
376 | + * @return boolean |
|
377 | 377 | */ |
378 | 378 | function redirect_args() { |
379 | 379 | return $this->get('PAY_redirect_args'); |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | /** |
511 | 511 | * Gets all the extra meta info on this payment |
512 | 512 | * @param array $query_params like EEM_Base::get_all |
513 | - * @return EE_Extra_Meta |
|
513 | + * @return EE_Base_Class[] |
|
514 | 514 | */ |
515 | 515 | public function extra_meta( $query_params = array() ) { |
516 | 516 | return $this->get_many_related( 'Extra_Meta', $query_params ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | * @subpackage includes/classes/EE_Payment.class.php |
23 | 23 | * @author Brent Christensen |
24 | 24 | */ |
25 | -class EE_Payment extends EE_Base_Class implements EEI_Payment{ |
|
25 | +class EE_Payment extends EE_Base_Class implements EEI_Payment { |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * |
29 | 29 | * @param array $props_n_values |
30 | 30 | * @return EE_Payment |
31 | 31 | */ |
32 | - public static function new_instance( $props_n_values = array() ) { |
|
33 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
34 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
32 | + public static function new_instance($props_n_values = array()) { |
|
33 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
34 | + return $has_object ? $has_object : new self($props_n_values); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * @param null $timezone |
42 | 42 | * @return EE_Payment |
43 | 43 | */ |
44 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = NULL ) { |
|
45 | - return new self( $props_n_values, TRUE, $timezone ); |
|
44 | + public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) { |
|
45 | + return new self($props_n_values, TRUE, $timezone); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | * @access public |
54 | 54 | * @param int $TXN_ID |
55 | 55 | */ |
56 | - public function set_transaction_id( $TXN_ID = 0 ) { |
|
57 | - $this->set( 'TXN_ID', $TXN_ID ); |
|
56 | + public function set_transaction_id($TXN_ID = 0) { |
|
57 | + $this->set('TXN_ID', $TXN_ID); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @return EE_Transaction |
65 | 65 | */ |
66 | 66 | public function transaction() { |
67 | - return $this->get_first_related( 'Transaction' ); |
|
67 | + return $this->get_first_related('Transaction'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @access public |
76 | 76 | * @param string $STS_ID |
77 | 77 | */ |
78 | - public function set_status( $STS_ID = '' ) { |
|
79 | - $this->set( 'STS_ID', $STS_ID ); |
|
78 | + public function set_status($STS_ID = '') { |
|
79 | + $this->set('STS_ID', $STS_ID); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | * @access public |
88 | 88 | * @param int $timestamp |
89 | 89 | */ |
90 | - public function set_timestamp( $timestamp = 0 ) { |
|
91 | - $this->set( 'PAY_timestamp', $timestamp ); |
|
90 | + public function set_timestamp($timestamp = 0) { |
|
91 | + $this->set('PAY_timestamp', $timestamp); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | * @access public |
100 | 100 | * @param string $PAY_source |
101 | 101 | */ |
102 | - public function set_source( $PAY_source = '' ) { |
|
103 | - $this->set('PAY_source',$PAY_source); |
|
102 | + public function set_source($PAY_source = '') { |
|
103 | + $this->set('PAY_source', $PAY_source); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * @access public |
112 | 112 | * @param float $amount |
113 | 113 | */ |
114 | - public function set_amount( $amount = 0.00 ) { |
|
115 | - $this->set( 'PAY_amount', $amount ); |
|
114 | + public function set_amount($amount = 0.00) { |
|
115 | + $this->set('PAY_amount', $amount); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | * @access public |
124 | 124 | * @param string $gateway_response |
125 | 125 | */ |
126 | - public function set_gateway_response( $gateway_response = '' ) { |
|
127 | - $this->set( 'PAY_gateway_response', $gateway_response ); |
|
126 | + public function set_gateway_response($gateway_response = '') { |
|
127 | + $this->set('PAY_gateway_response', $gateway_response); |
|
128 | 128 | } |
129 | 129 | /** |
130 | 130 | * Returns the name of the paymetn method used on this payment (previously known merely as 'gateway') |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | * @deprecated |
134 | 134 | * @return string |
135 | 135 | */ |
136 | - public function gateway(){ |
|
137 | - EE_Error::doing_it_wrong('EE_Payment::gateway', __( 'The method EE_Payment::gateway() has been deprecated. Consider instead using EE_Payment::payment_method()->name()', 'event_espresso' ), '4.6.0' ); |
|
138 | - if( $this->payment_method() ){ |
|
136 | + public function gateway() { |
|
137 | + EE_Error::doing_it_wrong('EE_Payment::gateway', __('The method EE_Payment::gateway() has been deprecated. Consider instead using EE_Payment::payment_method()->name()', 'event_espresso'), '4.6.0'); |
|
138 | + if ($this->payment_method()) { |
|
139 | 139 | return $this->payment_method()->name(); |
140 | - }else{ |
|
141 | - return __( 'Unknown', 'event_espresso' ); |
|
140 | + } else { |
|
141 | + return __('Unknown', 'event_espresso'); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | * @access public |
151 | 151 | * @param string $txn_id_chq_nmbr |
152 | 152 | */ |
153 | - public function set_txn_id_chq_nmbr( $txn_id_chq_nmbr = '' ) { |
|
154 | - $this->set( 'PAY_txn_id_chq_nmbr', $txn_id_chq_nmbr ); |
|
153 | + public function set_txn_id_chq_nmbr($txn_id_chq_nmbr = '') { |
|
154 | + $this->set('PAY_txn_id_chq_nmbr', $txn_id_chq_nmbr); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | * @access public |
163 | 163 | * @param string $po_number |
164 | 164 | */ |
165 | - public function set_po_number( $po_number = '' ) { |
|
166 | - $this->set( 'PAY_po_number', $po_number ); |
|
165 | + public function set_po_number($po_number = '') { |
|
166 | + $this->set('PAY_po_number', $po_number); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | * @access public |
175 | 175 | * @param string $extra_accntng |
176 | 176 | */ |
177 | - public function set_extra_accntng( $extra_accntng = '' ) { |
|
178 | - $this->set( 'PAY_extra_accntng', $extra_accntng ); |
|
177 | + public function set_extra_accntng($extra_accntng = '') { |
|
178 | + $this->set('PAY_extra_accntng', $extra_accntng); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | * @access public |
187 | 187 | * @param bool $via_admin |
188 | 188 | */ |
189 | - public function set_payment_made_via_admin( $via_admin = FALSE ) { |
|
190 | - if($via_admin){ |
|
191 | - $this->set('PAY_source', EEM_Payment_Method::scope_admin); |
|
192 | - }else{ |
|
189 | + public function set_payment_made_via_admin($via_admin = FALSE) { |
|
190 | + if ($via_admin) { |
|
191 | + $this->set('PAY_source', EEM_Payment_Method::scope_admin); |
|
192 | + } else { |
|
193 | 193 | $this->set('PAY_source', EEM_Payment_Method::scope_cart); |
194 | 194 | } |
195 | 195 | |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | * @access public |
204 | 204 | * @param string $details |
205 | 205 | */ |
206 | - public function set_details( $details = '' ) { |
|
207 | - if ( is_array( $details ) ) { |
|
208 | - array_walk_recursive( $details, array( $this, '_strip_all_tags_within_array' )); |
|
206 | + public function set_details($details = '') { |
|
207 | + if (is_array($details)) { |
|
208 | + array_walk_recursive($details, array($this, '_strip_all_tags_within_array')); |
|
209 | 209 | } else { |
210 | - $details = wp_strip_all_tags( $details ); |
|
210 | + $details = wp_strip_all_tags($details); |
|
211 | 211 | } |
212 | - $this->set( 'PAY_details', $details ); |
|
212 | + $this->set('PAY_details', $details); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * @access public |
236 | 236 | */ |
237 | 237 | public function TXN_ID() { |
238 | - return $this->get( 'TXN_ID' ); |
|
238 | + return $this->get('TXN_ID'); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | |
@@ -266,8 +266,8 @@ discard block |
||
266 | 266 | * @param null $date_or_time |
267 | 267 | * @return string |
268 | 268 | */ |
269 | - public function timestamp( $dt_frmt = '', $tm_frmt = '', $date_or_time = NULL ) { |
|
270 | - return $this->get_datetime('PAY_timestamp', $dt_frmt, $tm_frmt, $date_or_time ); |
|
269 | + public function timestamp($dt_frmt = '', $tm_frmt = '', $date_or_time = NULL) { |
|
270 | + return $this->get_datetime('PAY_timestamp', $dt_frmt, $tm_frmt, $date_or_time); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | * @return float |
289 | 289 | */ |
290 | 290 | public function amount() { |
291 | - return $this->get( 'PAY_amount' ); |
|
291 | + return $this->get('PAY_amount'); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @return mixed |
298 | 298 | */ |
299 | 299 | public function amount_no_code() { |
300 | - return $this->get_pretty( 'PAY_amount', 'no_currency_code' ); |
|
300 | + return $this->get_pretty('PAY_amount', 'no_currency_code'); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @access public |
308 | 308 | */ |
309 | 309 | public function gateway_response() { |
310 | - return $this->get( 'PAY_gateway_response' ); |
|
310 | + return $this->get('PAY_gateway_response'); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @access public |
318 | 318 | */ |
319 | 319 | public function txn_id_chq_nmbr() { |
320 | - return $this->get( 'PAY_txn_id_chq_nmbr' ); |
|
320 | + return $this->get('PAY_txn_id_chq_nmbr'); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * @access public |
328 | 328 | */ |
329 | 329 | public function po_number() { |
330 | - return $this->get( 'PAY_po_number' ); |
|
330 | + return $this->get('PAY_po_number'); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @access public |
338 | 338 | */ |
339 | 339 | public function extra_accntng() { |
340 | - return $this->get( 'PAY_extra_accntng' ); |
|
340 | + return $this->get('PAY_extra_accntng'); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | * @access public |
358 | 358 | */ |
359 | 359 | public function details() { |
360 | - return $this->get( 'PAY_details' ); |
|
360 | + return $this->get('PAY_details'); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
@@ -386,8 +386,8 @@ discard block |
||
386 | 386 | * @param bool $show_icons |
387 | 387 | * @return void |
388 | 388 | */ |
389 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
390 | - echo $this->pretty_status( $show_icons ); |
|
389 | + public function e_pretty_status($show_icons = FALSE) { |
|
390 | + echo $this->pretty_status($show_icons); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | |
@@ -397,10 +397,10 @@ discard block |
||
397 | 397 | * @param bool $show_icons |
398 | 398 | * @return string |
399 | 399 | */ |
400 | - public function pretty_status( $show_icons = FALSE ) { |
|
401 | - $status = EEM_Status::instance()->localized_status( array( $this->STS_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
400 | + public function pretty_status($show_icons = FALSE) { |
|
401 | + $status = EEM_Status::instance()->localized_status(array($this->STS_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
402 | 402 | $icon = ''; |
403 | - switch ( $this->STS_ID() ) { |
|
403 | + switch ($this->STS_ID()) { |
|
404 | 404 | case EEM_Payment::status_id_approved: |
405 | 405 | $icon = $show_icons ? '<span class="dashicons dashicons-yes ee-icon-size-24 green-text"></span>' : ''; |
406 | 406 | break; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : ''; |
415 | 415 | break; |
416 | 416 | } |
417 | - return $icon . $status[ $this->STS_ID() ]; |
|
417 | + return $icon.$status[$this->STS_ID()]; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | * @return boolean whether the payment is approved or not |
426 | 426 | */ |
427 | 427 | public function is_approved() { |
428 | - return $this->status_is( EEM_Payment::status_id_approved ); |
|
428 | + return $this->status_is(EEM_Payment::status_id_approved); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | |
@@ -437,8 +437,8 @@ discard block |
||
437 | 437 | * one of the status_id_* on the EEM_Payment model |
438 | 438 | * @return boolean whether the status of this payment equals the status id |
439 | 439 | */ |
440 | - protected function status_is( $STS_ID ) { |
|
441 | - if ( $STS_ID == $this->STS_ID() ) { |
|
440 | + protected function status_is($STS_ID) { |
|
441 | + if ($STS_ID == $this->STS_ID()) { |
|
442 | 442 | return TRUE; |
443 | 443 | } else { |
444 | 444 | return FALSE; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | * @return boolean whether the payment is pending or not |
453 | 453 | */ |
454 | 454 | public function is_pending() { |
455 | - return $this->status_is( EEM_Payment::status_id_pending ); |
|
455 | + return $this->status_is(EEM_Payment::status_id_pending); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | * @return boolean |
463 | 463 | */ |
464 | 464 | public function is_cancelled() { |
465 | - return $this->status_is( EEM_Payment::status_id_cancelled ); |
|
465 | + return $this->status_is(EEM_Payment::status_id_cancelled); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | * @return boolean |
473 | 473 | */ |
474 | 474 | public function is_declined() { |
475 | - return $this->status_is( EEM_Payment::status_id_declined ); |
|
475 | + return $this->status_is(EEM_Payment::status_id_declined); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | * @return boolean |
483 | 483 | */ |
484 | 484 | public function is_failed() { |
485 | - return $this->status_is( EEM_Payment::status_id_failed ); |
|
485 | + return $this->status_is(EEM_Payment::status_id_failed); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * @return EE_Status |
503 | 503 | */ |
504 | 504 | public function status_obj() { |
505 | - return $this->get_first_related( 'Status' ); |
|
505 | + return $this->get_first_related('Status'); |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | |
@@ -512,8 +512,8 @@ discard block |
||
512 | 512 | * @param array $query_params like EEM_Base::get_all |
513 | 513 | * @return EE_Extra_Meta |
514 | 514 | */ |
515 | - public function extra_meta( $query_params = array() ) { |
|
516 | - return $this->get_many_related( 'Extra_Meta', $query_params ); |
|
515 | + public function extra_meta($query_params = array()) { |
|
516 | + return $this->get_many_related('Extra_Meta', $query_params); |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | * offline ones, dont' create payments) |
525 | 525 | * @return EE_Payment_Method |
526 | 526 | */ |
527 | - function payment_method(){ |
|
527 | + function payment_method() { |
|
528 | 528 | return $this->get_first_related('Payment_Method'); |
529 | 529 | } |
530 | 530 | |
@@ -539,12 +539,12 @@ discard block |
||
539 | 539 | * @param string $inside_form_html |
540 | 540 | * @return string html |
541 | 541 | */ |
542 | - function redirect_form( $inside_form_html = NULL ) { |
|
542 | + function redirect_form($inside_form_html = NULL) { |
|
543 | 543 | $redirect_url = $this->redirect_url(); |
544 | - if ( ! empty( $redirect_url )) { |
|
544 | + if ( ! empty($redirect_url)) { |
|
545 | 545 | EE_Registry::instance()->load_helper('HTML'); |
546 | 546 | // what ? no inner form content? |
547 | - if( $inside_form_html === NULL ) { |
|
547 | + if ($inside_form_html === NULL) { |
|
548 | 548 | $inside_form_html = EEH_HTML::p( |
549 | 549 | sprintf( |
550 | 550 | __('If you are not automatically redirected to the payment website within 10 seconds... %1$s %2$s Click Here %3$s', 'event_espresso'), |
@@ -556,10 +556,10 @@ discard block |
||
556 | 556 | ); |
557 | 557 | } |
558 | 558 | $method = $this->redirect_args() ? 'POST' : 'GET'; |
559 | - $form = EEH_HTML::nl(1) . '<form method="' . $method . '" name="gateway_form" action="' . $redirect_url . '">'; |
|
560 | - $form .= EEH_HTML::nl(1) . $this->redirect_args_as_inputs(); |
|
559 | + $form = EEH_HTML::nl(1).'<form method="'.$method.'" name="gateway_form" action="'.$redirect_url.'">'; |
|
560 | + $form .= EEH_HTML::nl(1).$this->redirect_args_as_inputs(); |
|
561 | 561 | $form .= $inside_form_html; |
562 | - $form .= EEH_HTML::nl(-1) . '</form>' . EEH_HTML::nl(-1); |
|
562 | + $form .= EEH_HTML::nl(-1).'</form>'.EEH_HTML::nl(-1); |
|
563 | 563 | return $form; |
564 | 564 | } else { |
565 | 565 | return NULL; |
@@ -573,12 +573,12 @@ discard block |
||
573 | 573 | * Changes all the name-value pairs of |
574 | 574 | * @return string |
575 | 575 | */ |
576 | - function redirect_args_as_inputs(){ |
|
576 | + function redirect_args_as_inputs() { |
|
577 | 577 | $html = ''; |
578 | - if( $this->redirect_args() !== NULL && is_array( $this->redirect_args() )) { |
|
578 | + if ($this->redirect_args() !== NULL && is_array($this->redirect_args())) { |
|
579 | 579 | EE_Registry::instance()->load_helper('HTML'); |
580 | - foreach($this->redirect_args() as $name => $value){ |
|
581 | - $html .= EEH_HTML::nl(0) . '<input type="hidden" name="' . $name . '" value="' . esc_attr( $value ) . '"/>'; |
|
580 | + foreach ($this->redirect_args() as $name => $value) { |
|
581 | + $html .= EEH_HTML::nl(0).'<input type="hidden" name="'.$name.'" value="'.esc_attr($value).'"/>'; |
|
582 | 582 | } |
583 | 583 | } |
584 | 584 | return $html; |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | * object itself) |
594 | 594 | * @return string for the currency code |
595 | 595 | */ |
596 | - public function currency_code(){ |
|
596 | + public function currency_code() { |
|
597 | 597 | return EE_Config::instance()->currency->code; |
598 | 598 | } |
599 | 599 | |
@@ -607,14 +607,14 @@ discard block |
||
607 | 607 | * @access private |
608 | 608 | * @param mixed $item |
609 | 609 | */ |
610 | - private function _strip_all_tags_within_array( &$item ) { |
|
611 | - if( is_object( $item ) ) { |
|
610 | + private function _strip_all_tags_within_array(&$item) { |
|
611 | + if (is_object($item)) { |
|
612 | 612 | $item = (array) $item; |
613 | 613 | } |
614 | - if( is_array( $item ) ){ |
|
615 | - array_walk_recursive( $item, array( $this, '_strip_all_tags_within_array' ) ); |
|
616 | - }else{ |
|
617 | - $item = wp_strip_all_tags( $item ); |
|
614 | + if (is_array($item)) { |
|
615 | + array_walk_recursive($item, array($this, '_strip_all_tags_within_array')); |
|
616 | + } else { |
|
617 | + $item = wp_strip_all_tags($item); |
|
618 | 618 | } |
619 | 619 | } |
620 | 620 | |
@@ -623,13 +623,13 @@ discard block |
||
623 | 623 | * is approved and was created during this request). False otherwise. |
624 | 624 | * @return boolean |
625 | 625 | */ |
626 | - public function just_approved(){ |
|
627 | - EE_Registry::instance()->load_helper( 'Array' ); |
|
628 | - $original_status =EEH_Array::is_set( $this->_props_n_values_provided_in_constructor, 'STS_ID', $this->get_model()->field_settings_for( 'STS_ID' )->get_default_value() ); |
|
626 | + public function just_approved() { |
|
627 | + EE_Registry::instance()->load_helper('Array'); |
|
628 | + $original_status = EEH_Array::is_set($this->_props_n_values_provided_in_constructor, 'STS_ID', $this->get_model()->field_settings_for('STS_ID')->get_default_value()); |
|
629 | 629 | $current_status = $this->status(); |
630 | - if( $original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved ){ |
|
630 | + if ($original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved) { |
|
631 | 631 | return TRUE; |
632 | - }else{ |
|
632 | + } else { |
|
633 | 633 | return FALSE; |
634 | 634 | } |
635 | 635 | } |
@@ -641,11 +641,11 @@ discard block |
||
641 | 641 | * @param string $extra_cache_ref This allows the user to specify an extra cache ref for the given property (in cases where the same property may be used for different outputs - i.e. datetime, money etc.) |
642 | 642 | * @return mixed |
643 | 643 | */ |
644 | - public function get_pretty($field_name, $extra_cache_ref = NULL){ |
|
645 | - if( $field_name == 'PAY_gateway' ){ |
|
644 | + public function get_pretty($field_name, $extra_cache_ref = NULL) { |
|
645 | + if ($field_name == 'PAY_gateway') { |
|
646 | 646 | return $this->gateway(); |
647 | 647 | } |
648 | - return $this->_get_cached_property( $field_name, TRUE, $extra_cache_ref ); |
|
648 | + return $this->_get_cached_property($field_name, TRUE, $extra_cache_ref); |
|
649 | 649 | } |
650 | 650 | } |
651 | 651 |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | |
100 | 100 | |
101 | 101 | /** |
102 | - * Set Payment Method |
|
103 | - * |
|
104 | - * @access public |
|
105 | - * @param string $PAY_source |
|
106 | - */ |
|
102 | + * Set Payment Method |
|
103 | + * |
|
104 | + * @access public |
|
105 | + * @param string $PAY_source |
|
106 | + */ |
|
107 | 107 | public function set_source( $PAY_source = '' ) { |
108 | 108 | $this->set('PAY_source',$PAY_source); |
109 | 109 | } |
@@ -246,16 +246,16 @@ discard block |
||
246 | 246 | |
247 | 247 | |
248 | 248 | /** |
249 | - * get Payment Status |
|
250 | - * @access public |
|
251 | - */ |
|
249 | + * get Payment Status |
|
250 | + * @access public |
|
251 | + */ |
|
252 | 252 | public function status() { |
253 | 253 | return $this->get('STS_ID'); |
254 | 254 | } |
255 | 255 | /** |
256 | - * get Payment Status |
|
257 | - * @access public |
|
258 | - */ |
|
256 | + * get Payment Status |
|
257 | + * @access public |
|
258 | + */ |
|
259 | 259 | public function STS_ID() { |
260 | 260 | return $this->get('STS_ID'); |
261 | 261 | } |
@@ -278,9 +278,9 @@ discard block |
||
278 | 278 | |
279 | 279 | |
280 | 280 | /** |
281 | - * get Payment Source |
|
282 | - * @access public |
|
283 | - */ |
|
281 | + * get Payment Source |
|
282 | + * @access public |
|
283 | + */ |
|
284 | 284 | public function source() { |
285 | 285 | return $this->get('PAY_source'); |
286 | 286 | } |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | |
349 | 349 | |
350 | 350 | /** |
351 | - * get Payment made via admin source |
|
352 | - * @access public |
|
353 | - */ |
|
351 | + * get Payment made via admin source |
|
352 | + * @access public |
|
353 | + */ |
|
354 | 354 | public function payment_made_via_admin() { |
355 | 355 | return ($this->get('PAY_source') == EEM_Payment_Method::scope_admin); |
356 | 356 | } |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Required by EEM_Question_Group_Question in case someone queries for all its model objects |
4 | 4 | */ |
5 | -class EE_Question_Group_Question extends EE_Base_Class{ |
|
5 | +class EE_Question_Group_Question extends EE_Base_Class { |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * @param array $props_n_values |
9 | 9 | * @return EE_Question_Group_Question|mixed |
10 | 10 | */ |
11 | - public static function new_instance( $props_n_values = array() ) { |
|
12 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
13 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
11 | + public static function new_instance($props_n_values = array()) { |
|
12 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
13 | + return $has_object ? $has_object : new self($props_n_values); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @param array $props_n_values |
20 | 20 | * @return EE_Question_Group_Question |
21 | 21 | */ |
22 | - public static function new_instance_from_db ( $props_n_values = array() ) { |
|
23 | - return new self( $props_n_values, TRUE ); |
|
22 | + public static function new_instance_from_db($props_n_values = array()) { |
|
23 | + return new self($props_n_values, TRUE); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
127 | 127 | do_action( 'AHEE__EE_Registration__set_status__after_update', $this ); |
128 | 128 | return TRUE; |
129 | - }else{ |
|
129 | + } else{ |
|
130 | 130 | //even though the old value matches the new value, it's still good to |
131 | 131 | //allow the parent set method to have a say |
132 | 132 | parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
@@ -625,8 +625,9 @@ discard block |
||
625 | 625 | * @return EE_Registration |
626 | 626 | */ |
627 | 627 | public function get_primary_registration() { |
628 | - if ( $this->is_primary_registrant() ) |
|
629 | - return $this; |
|
628 | + if ( $this->is_primary_registrant() ) { |
|
629 | + return $this; |
|
630 | + } |
|
630 | 631 | |
631 | 632 | //k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1 |
632 | 633 | $primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * EE_Registration class |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $timezone |
39 | 39 | * @return EE_Registration |
40 | 40 | */ |
41 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
42 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
43 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
41 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
42 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
43 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | * @param string $timezone |
51 | 51 | * @return EE_Registration |
52 | 52 | */ |
53 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
54 | - return new self( $props_n_values, TRUE, $timezone ); |
|
53 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
54 | + return new self($props_n_values, TRUE, $timezone); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | * @access public |
63 | 63 | * @param int $EVT_ID Event ID |
64 | 64 | */ |
65 | - public function set_event( $EVT_ID = 0 ) { |
|
66 | - $this->set( 'EVT_ID', $EVT_ID ); |
|
65 | + public function set_event($EVT_ID = 0) { |
|
66 | + $this->set('EVT_ID', $EVT_ID); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -74,18 +74,18 @@ discard block |
||
74 | 74 | * @param mixed $field_value |
75 | 75 | * @param bool $use_default |
76 | 76 | */ |
77 | - public function set( $field_name, $field_value, $use_default = FALSE ) { |
|
78 | - switch( $field_name ) { |
|
77 | + public function set($field_name, $field_value, $use_default = FALSE) { |
|
78 | + switch ($field_name) { |
|
79 | 79 | case 'REG_code' : |
80 | - if ( ! empty( $field_value ) && $this->reg_code() == '' ) { |
|
81 | - $this->set_reg_code( $field_value, $use_default ); |
|
80 | + if ( ! empty($field_value) && $this->reg_code() == '') { |
|
81 | + $this->set_reg_code($field_value, $use_default); |
|
82 | 82 | } |
83 | 83 | break; |
84 | 84 | case 'STS_ID' : |
85 | - $this->set_status( $field_value, $use_default ); |
|
85 | + $this->set_status($field_value, $use_default); |
|
86 | 86 | break; |
87 | 87 | default : |
88 | - parent::set( $field_name, $field_value, $use_default ); |
|
88 | + parent::set($field_name, $field_value, $use_default); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -102,30 +102,30 @@ discard block |
||
102 | 102 | * @param boolean $use_default |
103 | 103 | * @return bool |
104 | 104 | */ |
105 | - public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) { |
|
105 | + public function set_status($new_STS_ID = NULL, $use_default = FALSE) { |
|
106 | 106 | // get current REG_Status |
107 | 107 | $old_STS_ID = $this->status_ID(); |
108 | 108 | // if status has changed |
109 | - if ( $old_STS_ID != $new_STS_ID ) { |
|
109 | + if ($old_STS_ID != $new_STS_ID) { |
|
110 | 110 | // TO approved |
111 | - if ( $new_STS_ID == EEM_Registration::status_id_approved ) { |
|
111 | + if ($new_STS_ID == EEM_Registration::status_id_approved) { |
|
112 | 112 | // reserve a space by incrementing ticket and datetime sold values |
113 | 113 | $this->_reserve_registration_space(); |
114 | - do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
114 | + do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID); |
|
115 | 115 | // OR FROM approved |
116 | - } else if ( $old_STS_ID == EEM_Registration::status_id_approved ) { |
|
116 | + } else if ($old_STS_ID == EEM_Registration::status_id_approved) { |
|
117 | 117 | // release a space by decrementing ticket and datetime sold values |
118 | 118 | $this->_release_registration_space(); |
119 | - do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
119 | + do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID); |
|
120 | 120 | } |
121 | 121 | // update status |
122 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
123 | - do_action( 'AHEE__EE_Registration__set_status__after_update', $this ); |
|
122 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
123 | + do_action('AHEE__EE_Registration__set_status__after_update', $this); |
|
124 | 124 | return TRUE; |
125 | - }else{ |
|
125 | + } else { |
|
126 | 126 | //even though the old value matches the new value, it's still good to |
127 | 127 | //allow the parent set method to have a say |
128 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
128 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
129 | 129 | return TRUE; |
130 | 130 | } |
131 | 131 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @access public |
138 | 138 | */ |
139 | 139 | public function status_ID() { |
140 | - return $this->get( 'STS_ID' ); |
|
140 | + return $this->get('STS_ID'); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | $ticket->increase_sold(); |
152 | 152 | $ticket->save(); |
153 | 153 | $datetimes = $ticket->datetimes(); |
154 | - if ( is_array( $datetimes ) ) { |
|
155 | - foreach ( $datetimes as $datetime ) { |
|
156 | - if ( $datetime instanceof EE_Datetime ) { |
|
154 | + if (is_array($datetimes)) { |
|
155 | + foreach ($datetimes as $datetime) { |
|
156 | + if ($datetime instanceof EE_Datetime) { |
|
157 | 157 | $datetime->increase_sold(); |
158 | 158 | $datetime->save(); |
159 | 159 | } |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | * @param boolean $include_archived whether to include archived tickets or not. |
172 | 172 | * @return EE_Ticket |
173 | 173 | */ |
174 | - public function ticket( $include_archived = TRUE ) { |
|
174 | + public function ticket($include_archived = TRUE) { |
|
175 | 175 | $query_params = array(); |
176 | - if ( $include_archived ) { |
|
177 | - $query_params[ 'default_where_conditions' ] = 'none'; |
|
176 | + if ($include_archived) { |
|
177 | + $query_params['default_where_conditions'] = 'none'; |
|
178 | 178 | } |
179 | - return $this->get_first_related( 'Ticket', $query_params ); |
|
179 | + return $this->get_first_related('Ticket', $query_params); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * @return EE_Event |
187 | 187 | */ |
188 | 188 | public function event() { |
189 | - return $this->get_first_related( 'Event' ); |
|
189 | + return $this->get_first_related('Event'); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function wp_user() { |
202 | 202 | $event = $this->event(); |
203 | - if ( $event instanceof EE_Event ) { |
|
203 | + if ($event instanceof EE_Event) { |
|
204 | 204 | return $event->wp_user(); |
205 | 205 | } |
206 | 206 | return 0; |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | $ticket->decrease_sold(); |
218 | 218 | $ticket->save(); |
219 | 219 | $datetimes = $ticket->datetimes(); |
220 | - if ( is_array( $datetimes ) ) { |
|
221 | - foreach ( $datetimes as $datetime ) { |
|
222 | - if ( $datetime instanceof EE_Datetime ) { |
|
220 | + if (is_array($datetimes)) { |
|
221 | + foreach ($datetimes as $datetime) { |
|
222 | + if ($datetime instanceof EE_Datetime) { |
|
223 | 223 | $datetime->decrease_sold(); |
224 | 224 | $datetime->save(); |
225 | 225 | } |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | * @access public |
236 | 236 | * @param int $ATT_ID Attendee ID |
237 | 237 | */ |
238 | - public function set_attendee_id( $ATT_ID = 0 ) { |
|
239 | - $this->set( 'ATT_ID', $ATT_ID ); |
|
238 | + public function set_attendee_id($ATT_ID = 0) { |
|
239 | + $this->set('ATT_ID', $ATT_ID); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | * @access public |
248 | 248 | * @param int $TXN_ID Transaction ID |
249 | 249 | */ |
250 | - public function set_transaction_id( $TXN_ID = 0 ) { |
|
251 | - $this->set( 'TXN_ID', $TXN_ID ); |
|
250 | + public function set_transaction_id($TXN_ID = 0) { |
|
251 | + $this->set('TXN_ID', $TXN_ID); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | * @access public |
260 | 260 | * @param string $REG_session PHP Session ID |
261 | 261 | */ |
262 | - public function set_session( $REG_session = '' ) { |
|
263 | - $this->set( 'REG_session', $REG_session ); |
|
262 | + public function set_session($REG_session = '') { |
|
263 | + $this->set('REG_session', $REG_session); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | * @access public |
272 | 272 | * @param string $REG_url_link Registration URL Link |
273 | 273 | */ |
274 | - public function set_reg_url_link( $REG_url_link = '' ) { |
|
275 | - $this->set( 'REG_url_link', $REG_url_link ); |
|
274 | + public function set_reg_url_link($REG_url_link = '') { |
|
275 | + $this->set('REG_url_link', $REG_url_link); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | * @access public |
284 | 284 | * @param int $REG_count Primary Attendee |
285 | 285 | */ |
286 | - public function set_count( $REG_count = 1 ) { |
|
287 | - $this->set( 'REG_count', $REG_count ); |
|
286 | + public function set_count($REG_count = 1) { |
|
287 | + $this->set('REG_count', $REG_count); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | * @access public |
296 | 296 | * @param boolean $REG_group_size Group Registration |
297 | 297 | */ |
298 | - public function set_group_size( $REG_group_size = FALSE ) { |
|
299 | - $this->set( 'REG_group_size', $REG_group_size ); |
|
298 | + public function set_group_size($REG_group_size = FALSE) { |
|
299 | + $this->set('REG_group_size', $REG_group_size); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | |
@@ -379,8 +379,8 @@ discard block |
||
379 | 379 | * @access public |
380 | 380 | * @param mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date |
381 | 381 | */ |
382 | - public function set_reg_date( $REG_date = FALSE ) { |
|
383 | - $this->set( 'REG_date', $REG_date ); |
|
382 | + public function set_reg_date($REG_date = FALSE) { |
|
383 | + $this->set('REG_date', $REG_date); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | * @access public |
392 | 392 | * @param float $REG_final_price |
393 | 393 | */ |
394 | - public function set_final_price( $REG_final_price = 0.00 ) { |
|
395 | - $this->set( 'REG_final_price', $REG_final_price ); |
|
394 | + public function set_final_price($REG_final_price = 0.00) { |
|
395 | + $this->set('REG_final_price', $REG_final_price); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | * @access public |
404 | 404 | * @param float $REG_paid |
405 | 405 | */ |
406 | - public function set_paid( $REG_paid = 0.00 ) { |
|
407 | - $this->set( 'REG_paid', $REG_paid ); |
|
406 | + public function set_paid($REG_paid = 0.00) { |
|
407 | + $this->set('REG_paid', $REG_paid); |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | |
@@ -415,8 +415,8 @@ discard block |
||
415 | 415 | * @access public |
416 | 416 | * @param boolean $REG_att_is_going Attendee Is Going |
417 | 417 | */ |
418 | - public function set_att_is_going( $REG_att_is_going = FALSE ) { |
|
419 | - $this->set( 'REG_att_is_going', $REG_att_is_going ); |
|
418 | + public function set_att_is_going($REG_att_is_going = FALSE) { |
|
419 | + $this->set('REG_att_is_going', $REG_att_is_going); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | * @return EE_Attendee |
427 | 427 | */ |
428 | 428 | public function attendee() { |
429 | - return $this->get_first_related( 'Attendee' ); |
|
429 | + return $this->get_first_related('Attendee'); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * @access public |
437 | 437 | */ |
438 | 438 | public function event_ID() { |
439 | - return $this->get( 'EVT_ID' ); |
|
439 | + return $this->get('EVT_ID'); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | */ |
448 | 448 | public function event_name() { |
449 | 449 | $event = $this->event_obj(); |
450 | - if ( $event ) { |
|
450 | + if ($event) { |
|
451 | 451 | return $event->name(); |
452 | 452 | } else { |
453 | 453 | return NULL; |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | * @return EE_Event |
462 | 462 | */ |
463 | 463 | public function event_obj() { |
464 | - return $this->get_first_related( 'Event' ); |
|
464 | + return $this->get_first_related('Event'); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | * @access public |
472 | 472 | */ |
473 | 473 | public function attendee_ID() { |
474 | - return $this->get( 'ATT_ID' ); |
|
474 | + return $this->get('ATT_ID'); |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | * @access public |
482 | 482 | */ |
483 | 483 | public function session_ID() { |
484 | - return $this->get( 'REG_session' ); |
|
484 | + return $this->get('REG_session'); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
492 | 492 | * @return string |
493 | 493 | */ |
494 | - public function receipt_url( $messenger = 'html' ) { |
|
494 | + public function receipt_url($messenger = 'html') { |
|
495 | 495 | |
496 | 496 | /** |
497 | 497 | * 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. |
@@ -500,12 +500,12 @@ discard block |
||
500 | 500 | */ |
501 | 501 | EE_Registry::instance()->load_helper('Template'); |
502 | 502 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php'; |
503 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
503 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
504 | 504 | |
505 | - if ( $has_custom ) { |
|
506 | - return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) ); |
|
505 | + if ($has_custom) { |
|
506 | + return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch')); |
|
507 | 507 | } |
508 | - return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' ); |
|
508 | + return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt'); |
|
509 | 509 | } |
510 | 510 | |
511 | 511 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
517 | 517 | * @return string |
518 | 518 | */ |
519 | - public function invoice_url( $messenger = 'html' ) { |
|
519 | + public function invoice_url($messenger = 'html') { |
|
520 | 520 | /** |
521 | 521 | * 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. |
522 | 522 | * |
@@ -524,21 +524,21 @@ discard block |
||
524 | 524 | */ |
525 | 525 | EE_Registry::instance()->load_helper('Template'); |
526 | 526 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php'; |
527 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
527 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
528 | 528 | |
529 | - if ( $has_custom ) { |
|
530 | - if ( $messenger == 'html' ) { |
|
531 | - return $this->invoice_url( 'launch' ); |
|
529 | + if ($has_custom) { |
|
530 | + if ($messenger == 'html') { |
|
531 | + return $this->invoice_url('launch'); |
|
532 | 532 | } |
533 | 533 | $route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice'; |
534 | 534 | |
535 | - $query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() ); |
|
536 | - if ( $messenger == 'html' ) { |
|
535 | + $query_args = array('ee' => $route, 'id' => $this->reg_url_link()); |
|
536 | + if ($messenger == 'html') { |
|
537 | 537 | $query_args['html'] = TRUE; |
538 | 538 | } |
539 | - return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) ); |
|
539 | + return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id)); |
|
540 | 540 | } |
541 | - return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' ); |
|
541 | + return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice'); |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | * @access public |
549 | 549 | */ |
550 | 550 | public function reg_url_link() { |
551 | - return $this->get( 'REG_url_link' ); |
|
551 | + return $this->get('REG_url_link'); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | * @param string $type 'download','launch', or 'html' (default is 'launch') |
559 | 559 | * @return void |
560 | 560 | */ |
561 | - public function e_invoice_url( $type = 'launch' ) { |
|
562 | - echo $this->invoice_url( $type ); |
|
561 | + public function e_invoice_url($type = 'launch') { |
|
562 | + echo $this->invoice_url($type); |
|
563 | 563 | } |
564 | 564 | |
565 | 565 | |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | * @return string |
580 | 580 | */ |
581 | 581 | public function payment_overview_url() { |
582 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), get_permalink( EE_Registry::instance()->CFG->core->reg_page_id ) ); |
|
582 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), get_permalink(EE_Registry::instance()->CFG->core->reg_page_id)); |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | * @return string |
591 | 591 | */ |
592 | 592 | public function edit_attendee_information_url() { |
593 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), get_permalink( EE_Registry::instance()->CFG->core->reg_page_id ) ); |
|
593 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), get_permalink(EE_Registry::instance()->CFG->core->reg_page_id)); |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | |
@@ -600,8 +600,8 @@ discard block |
||
600 | 600 | * @return string |
601 | 601 | */ |
602 | 602 | public function get_admin_edit_url() { |
603 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
604 | - return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) ); |
|
603 | + EE_Registry::instance()->load_helper('URL'); |
|
604 | + return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php')); |
|
605 | 605 | } |
606 | 606 | |
607 | 607 | |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | * @access public |
612 | 612 | */ |
613 | 613 | public function is_primary_registrant() { |
614 | - return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE; |
|
614 | + return $this->get('REG_count') == 1 ? TRUE : FALSE; |
|
615 | 615 | } |
616 | 616 | |
617 | 617 | |
@@ -620,12 +620,12 @@ discard block |
||
620 | 620 | * This returns the primary registration object for this registration group (which may be this object). |
621 | 621 | * @return EE_Registration |
622 | 622 | */ |
623 | - public function get_primary_registration() { |
|
624 | - if ( $this->is_primary_registrant() ) |
|
623 | + public function get_primary_registration() { |
|
624 | + if ($this->is_primary_registrant()) |
|
625 | 625 | return $this; |
626 | 626 | |
627 | 627 | //k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1 |
628 | - $primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) ); |
|
628 | + $primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1))); |
|
629 | 629 | return $primary_registrant; |
630 | 630 | } |
631 | 631 | |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | * @access public |
637 | 637 | */ |
638 | 638 | public function count() { |
639 | - return $this->get( 'REG_count' ); |
|
639 | + return $this->get('REG_count'); |
|
640 | 640 | } |
641 | 641 | |
642 | 642 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | * @access public |
647 | 647 | */ |
648 | 648 | public function group_size() { |
649 | - return $this->get( 'REG_group_size' ); |
|
649 | + return $this->get('REG_group_size'); |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | * @access public |
657 | 657 | */ |
658 | 658 | public function date() { |
659 | - return $this->get( 'REG_date' ); |
|
659 | + return $this->get('REG_date'); |
|
660 | 660 | } |
661 | 661 | |
662 | 662 | |
@@ -667,8 +667,8 @@ discard block |
||
667 | 667 | * @param string $time_format |
668 | 668 | * @return string |
669 | 669 | */ |
670 | - public function pretty_date( $date_format = NULL, $time_format = NULL ) { |
|
671 | - return $this->get_datetime( 'REG_date', $date_format, $time_format ); |
|
670 | + public function pretty_date($date_format = NULL, $time_format = NULL) { |
|
671 | + return $this->get_datetime('REG_date', $date_format, $time_format); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | * @return float |
681 | 681 | */ |
682 | 682 | public function final_price() { |
683 | - return $this->get( 'REG_final_price' ); |
|
683 | + return $this->get('REG_final_price'); |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | * @return string |
692 | 692 | */ |
693 | 693 | public function pretty_final_price() { |
694 | - return $this->get_pretty( 'REG_final_price' ); |
|
694 | + return $this->get_pretty('REG_final_price'); |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | * @return float |
703 | 703 | */ |
704 | 704 | public function paid() { |
705 | - return $this->get( 'REG_paid' ); |
|
705 | + return $this->get('REG_paid'); |
|
706 | 706 | } |
707 | 707 | |
708 | 708 | |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | * @return float |
714 | 714 | */ |
715 | 715 | public function pretty_paid() { |
716 | - return $this->get_pretty( 'REG_paid' ); |
|
716 | + return $this->get_pretty('REG_paid'); |
|
717 | 717 | } |
718 | 718 | |
719 | 719 | |
@@ -725,11 +725,11 @@ discard block |
||
725 | 725 | * @param array $requires_payment |
726 | 726 | * @return bool |
727 | 727 | */ |
728 | - public function owes_monies_and_can_pay( $requires_payment = array()) { |
|
728 | + public function owes_monies_and_can_pay($requires_payment = array()) { |
|
729 | 729 | // these reg statuses require payment (if event is not free) |
730 | - $requires_payment = ! empty( $requires_payment ) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment(); |
|
730 | + $requires_payment = ! empty($requires_payment) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment(); |
|
731 | 731 | if ( |
732 | - in_array( $this->status_ID(), $requires_payment ) && |
|
732 | + in_array($this->status_ID(), $requires_payment) && |
|
733 | 733 | $this->final_price() != 0 && |
734 | 734 | $this->final_price() != $this->paid() |
735 | 735 | ) { |
@@ -746,8 +746,8 @@ discard block |
||
746 | 746 | * @param bool $show_icons |
747 | 747 | * @return void |
748 | 748 | */ |
749 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
750 | - echo $this->pretty_status( $show_icons ); |
|
749 | + public function e_pretty_status($show_icons = FALSE) { |
|
750 | + echo $this->pretty_status($show_icons); |
|
751 | 751 | } |
752 | 752 | |
753 | 753 | |
@@ -758,10 +758,10 @@ discard block |
||
758 | 758 | * @param bool $show_icons |
759 | 759 | * @return string |
760 | 760 | */ |
761 | - public function pretty_status( $show_icons = FALSE ) { |
|
762 | - $status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
761 | + public function pretty_status($show_icons = FALSE) { |
|
762 | + $status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
763 | 763 | $icon = ''; |
764 | - switch ( $this->status_ID() ) { |
|
764 | + switch ($this->status_ID()) { |
|
765 | 765 | case EEM_Registration::status_id_approved: |
766 | 766 | $icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : ''; |
767 | 767 | break; |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | $icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : ''; |
782 | 782 | break; |
783 | 783 | } |
784 | - return $icon . $status[ $this->status_ID() ]; |
|
784 | + return $icon.$status[$this->status_ID()]; |
|
785 | 785 | } |
786 | 786 | |
787 | 787 | |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | * @access public |
792 | 792 | */ |
793 | 793 | public function att_is_going() { |
794 | - return $this->get( 'REG_att_is_going' ); |
|
794 | + return $this->get('REG_att_is_going'); |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | |
@@ -801,8 +801,8 @@ discard block |
||
801 | 801 | * @param array $query_params like EEM_Base::get_all |
802 | 802 | * @return EE_Answer[] |
803 | 803 | */ |
804 | - public function answers( $query_params = NULL ) { |
|
805 | - return $this->get_many_related( 'Answer', $query_params ); |
|
804 | + public function answers($query_params = NULL) { |
|
805 | + return $this->get_many_related('Answer', $query_params); |
|
806 | 806 | } |
807 | 807 | |
808 | 808 | |
@@ -816,9 +816,9 @@ discard block |
||
816 | 816 | * (because the answer might be an array of answer values, so passing pretty_value=true |
817 | 817 | * will convert it into some kind of string) |
818 | 818 | */ |
819 | - public function answer_value_to_question( $question, $pretty_value=true ) { |
|
819 | + public function answer_value_to_question($question, $pretty_value = true) { |
|
820 | 820 | $question_id = EEM_Question::instance()->ensure_is_ID($question); |
821 | - return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value); |
|
821 | + return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value); |
|
822 | 822 | } |
823 | 823 | |
824 | 824 | /** |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | * @return string |
828 | 828 | */ |
829 | 829 | public function reg_date() { |
830 | - return $this->get_datetime( 'REG_date' ); |
|
830 | + return $this->get_datetime('REG_date'); |
|
831 | 831 | } |
832 | 832 | |
833 | 833 | |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | * @return EE_Datetime_Ticket |
840 | 840 | */ |
841 | 841 | public function datetime_ticket() { |
842 | - return $this->get_first_related( 'Datetime_Ticket' ); |
|
842 | + return $this->get_first_related('Datetime_Ticket'); |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | |
@@ -849,15 +849,15 @@ discard block |
||
849 | 849 | * @param EE_Datetime_Ticket $datetime_ticket |
850 | 850 | * @return EE_Datetime_Ticket |
851 | 851 | */ |
852 | - public function set_datetime_ticket( $datetime_ticket ) { |
|
853 | - return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' ); |
|
852 | + public function set_datetime_ticket($datetime_ticket) { |
|
853 | + return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket'); |
|
854 | 854 | } |
855 | 855 | /** |
856 | 856 | * Gets deleted |
857 | 857 | * @return boolean |
858 | 858 | */ |
859 | 859 | public function deleted() { |
860 | - return $this->get( 'REG_deleted' ); |
|
860 | + return $this->get('REG_deleted'); |
|
861 | 861 | } |
862 | 862 | |
863 | 863 | /** |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | * @return boolean |
867 | 867 | */ |
868 | 868 | public function set_deleted($deleted) { |
869 | - $this->set( 'REG_deleted', $deleted ); |
|
869 | + $this->set('REG_deleted', $deleted); |
|
870 | 870 | } |
871 | 871 | |
872 | 872 | |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | * @return EE_Status |
877 | 877 | */ |
878 | 878 | public function status_obj() { |
879 | - return $this->get_first_related( 'Status' ); |
|
879 | + return $this->get_first_related('Status'); |
|
880 | 880 | } |
881 | 881 | |
882 | 882 | |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | * @return int |
888 | 888 | */ |
889 | 889 | public function count_checkins() { |
890 | - return $this->get_model()->count_related( $this, 'Checkin' ); |
|
890 | + return $this->get_model()->count_related($this, 'Checkin'); |
|
891 | 891 | } |
892 | 892 | |
893 | 893 | |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | * @return int |
898 | 898 | */ |
899 | 899 | public function count_checkins_not_checkedout() { |
900 | - return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) ); |
|
900 | + return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1))); |
|
901 | 901 | } |
902 | 902 | |
903 | 903 | |
@@ -910,20 +910,20 @@ discard block |
||
910 | 910 | * |
911 | 911 | * @return bool |
912 | 912 | */ |
913 | - public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) { |
|
914 | - $DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID ); |
|
913 | + public function can_checkin($DTT_OR_ID, $check_approved = TRUE) { |
|
914 | + $DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID); |
|
915 | 915 | |
916 | 916 | //first check registration status |
917 | - if ( ( $check_approved && ! $this->is_approved() ) || ! $DTT_ID ) { |
|
917 | + if (($check_approved && ! $this->is_approved()) || ! $DTT_ID) { |
|
918 | 918 | return false; |
919 | 919 | } |
920 | 920 | //is there a datetime ticket that matches this dtt_ID? |
921 | - if ( ! ( EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) ) ) ) { |
|
921 | + if ( ! (EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID))))) { |
|
922 | 922 | return false; |
923 | 923 | } |
924 | 924 | |
925 | 925 | //final check is against TKT_uses |
926 | - return $this->verify_can_checkin_against_TKT_uses( $DTT_ID ); |
|
926 | + return $this->verify_can_checkin_against_TKT_uses($DTT_ID); |
|
927 | 927 | } |
928 | 928 | |
929 | 929 | |
@@ -936,10 +936,10 @@ discard block |
||
936 | 936 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
937 | 937 | * @return bool true means can checkin. false means cannot checkin. |
938 | 938 | */ |
939 | - public function verify_can_checkin_against_TKT_uses( $DTT_OR_ID ) { |
|
940 | - $DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID ); |
|
939 | + public function verify_can_checkin_against_TKT_uses($DTT_OR_ID) { |
|
940 | + $DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID); |
|
941 | 941 | |
942 | - if ( ! $DTT_ID ) { |
|
942 | + if ( ! $DTT_ID) { |
|
943 | 943 | return false; |
944 | 944 | } |
945 | 945 | |
@@ -947,23 +947,23 @@ discard block |
||
947 | 947 | |
948 | 948 | // if max uses is not set or equals infinity then return true cause its not a factor for whether user can check-in |
949 | 949 | // or not. |
950 | - if ( ! $max_uses || $max_uses === INF ) { |
|
950 | + if ( ! $max_uses || $max_uses === INF) { |
|
951 | 951 | return true; |
952 | 952 | } |
953 | 953 | |
954 | 954 | //does this datetime have a checkin record? If so, then the dtt count has already been verified so we can just |
955 | 955 | //go ahead and toggle. |
956 | - if ( EEM_Checkin::instance()->exists( array( array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID ) ) ) ) { |
|
956 | + if (EEM_Checkin::instance()->exists(array(array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID)))) { |
|
957 | 957 | return true; |
958 | 958 | } |
959 | 959 | |
960 | 960 | //made it here so the last check is whether the number of checkins per unique datetime on this registration |
961 | 961 | //disallows further check-ins. |
962 | - $count_unique_dtt_checkins = EEM_Checkin::instance()->count( array( array( 'REG_ID' => $this->ID(), 'CHK_in' => true ) ), 'DTT_ID', true ); |
|
962 | + $count_unique_dtt_checkins = EEM_Checkin::instance()->count(array(array('REG_ID' => $this->ID(), 'CHK_in' => true)), 'DTT_ID', true); |
|
963 | 963 | // checkins have already reached their max number of uses |
964 | 964 | // so registrant can NOT checkin |
965 | - if ( $count_unique_dtt_checkins >= $max_uses ) { |
|
966 | - 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__ ); |
|
965 | + if ($count_unique_dtt_checkins >= $max_uses) { |
|
966 | + 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__); |
|
967 | 967 | return false; |
968 | 968 | } |
969 | 969 | return true; |
@@ -984,15 +984,15 @@ discard block |
||
984 | 984 | * @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. |
985 | 985 | * @return int|BOOL the chk_in status toggled to OR false if nothing got changed. |
986 | 986 | */ |
987 | - public function toggle_checkin_status( $DTT_ID = null, $verify = false ) { |
|
988 | - if ( empty( $DTT_ID ) ) { |
|
987 | + public function toggle_checkin_status($DTT_ID = null, $verify = false) { |
|
988 | + if (empty($DTT_ID)) { |
|
989 | 989 | $datetime = $this->get_related_primary_datetime(); |
990 | 990 | $DTT_ID = $datetime->ID(); |
991 | 991 | // verify the registration can checkin for the given DTT_ID |
992 | - } elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) { |
|
992 | + } elseif ( ! $this->can_checkin($DTT_ID, $verify)) { |
|
993 | 993 | EE_Error::add_error( |
994 | 994 | sprintf( |
995 | - __( 'The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), |
|
995 | + __('The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), |
|
996 | 996 | because the registration does not have access', 'event_espresso'), |
997 | 997 | $this->ID(), |
998 | 998 | $DTT_ID |
@@ -1007,8 +1007,8 @@ discard block |
||
1007 | 1007 | EE_Registration::checkin_status_out => EE_Registration::checkin_status_in |
1008 | 1008 | ); |
1009 | 1009 | //start by getting the current status so we know what status we'll be changing to. |
1010 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL ); |
|
1011 | - $status_to = $status_paths[ $cur_status ]; |
|
1010 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL); |
|
1011 | + $status_to = $status_paths[$cur_status]; |
|
1012 | 1012 | // database only records true for checked IN or false for checked OUT |
1013 | 1013 | // no record ( null ) means checked in NEVER, but we obviously don't save that |
1014 | 1014 | $new_status = $status_to == EE_Registration::checkin_status_in ? true : false; |
@@ -1016,24 +1016,24 @@ discard block |
||
1016 | 1016 | // because we are keeping track of Check-ins over time. |
1017 | 1017 | // Eventually we'll probably want to show a list table |
1018 | 1018 | // for the individual Check-ins so that they can be managed. |
1019 | - $checkin = EE_Checkin::new_instance( array( |
|
1019 | + $checkin = EE_Checkin::new_instance(array( |
|
1020 | 1020 | 'REG_ID' => $this->ID(), |
1021 | 1021 | 'DTT_ID' => $DTT_ID, |
1022 | 1022 | 'CHK_in' => $new_status |
1023 | - ) ); |
|
1023 | + )); |
|
1024 | 1024 | // if the record could not be saved then return false |
1025 | - if ( $checkin->save() === 0 ) { |
|
1026 | - if ( WP_DEBUG ) { |
|
1025 | + if ($checkin->save() === 0) { |
|
1026 | + if (WP_DEBUG) { |
|
1027 | 1027 | global $wpdb; |
1028 | 1028 | $error = sprintf( |
1029 | - __( 'Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso' ), |
|
1029 | + __('Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso'), |
|
1030 | 1030 | '<br />', |
1031 | 1031 | $wpdb->last_error |
1032 | 1032 | ); |
1033 | 1033 | } else { |
1034 | - $error = __( 'Registration check in update failed because of an unknown database error', 'event_espresso' ); |
|
1034 | + $error = __('Registration check in update failed because of an unknown database error', 'event_espresso'); |
|
1035 | 1035 | } |
1036 | - EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ ); |
|
1036 | + EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__); |
|
1037 | 1037 | return false; |
1038 | 1038 | } |
1039 | 1039 | return $status_to; |
@@ -1057,19 +1057,19 @@ discard block |
||
1057 | 1057 | * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id. |
1058 | 1058 | * @return int Integer representing Check-in status. |
1059 | 1059 | */ |
1060 | - public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) { |
|
1061 | - if ( empty( $DTT_ID ) && ! $checkin instanceof EE_Checkin ) { |
|
1060 | + public function check_in_status_for_datetime($DTT_ID = 0, $checkin = NULL) { |
|
1061 | + if (empty($DTT_ID) && ! $checkin instanceof EE_Checkin) { |
|
1062 | 1062 | $datetime = $this->get_related_primary_datetime(); |
1063 | - if ( ! $datetime instanceof EE_Datetime ) { |
|
1063 | + if ( ! $datetime instanceof EE_Datetime) { |
|
1064 | 1064 | return 0; |
1065 | 1065 | } |
1066 | 1066 | $DTT_ID = $datetime->ID(); |
1067 | 1067 | //verify the registration can checkin for the given DTT_ID |
1068 | 1068 | } |
1069 | 1069 | //get checkin object (if exists) |
1070 | - $checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ), 'order_by' => array( 'CHK_timestamp' => 'DESC' ) ) ); |
|
1071 | - if ( $checkin instanceof EE_Checkin ) { |
|
1072 | - if ( $checkin->get( 'CHK_in' ) ) { |
|
1070 | + $checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related('Checkin', array(array('DTT_ID' => $DTT_ID), 'order_by' => array('CHK_timestamp' => 'DESC'))); |
|
1071 | + if ($checkin instanceof EE_Checkin) { |
|
1072 | + if ($checkin->get('CHK_in')) { |
|
1073 | 1073 | return EE_Registration::checkin_status_in; //checked in |
1074 | 1074 | } else { |
1075 | 1075 | return EE_Registration::checkin_status_out; //had checked in but is now checked out. |
@@ -1087,28 +1087,28 @@ discard block |
||
1087 | 1087 | * @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. |
1088 | 1088 | * @return string internationalized message |
1089 | 1089 | */ |
1090 | - public function get_checkin_msg( $DTT_ID, $error = FALSE ) { |
|
1090 | + public function get_checkin_msg($DTT_ID, $error = FALSE) { |
|
1091 | 1091 | //let's get the attendee first so we can include the name of the attendee |
1092 | - $attendee = $this->get_first_related( 'Attendee' ); |
|
1093 | - if ( $attendee instanceof EE_Attendee ) { |
|
1094 | - if ( $error ) { |
|
1095 | - return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() ); |
|
1092 | + $attendee = $this->get_first_related('Attendee'); |
|
1093 | + if ($attendee instanceof EE_Attendee) { |
|
1094 | + if ($error) { |
|
1095 | + return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name()); |
|
1096 | 1096 | } |
1097 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID ); |
|
1097 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID); |
|
1098 | 1098 | //what is the status message going to be? |
1099 | - switch ( $cur_status ) { |
|
1099 | + switch ($cur_status) { |
|
1100 | 1100 | case EE_Registration::checkin_status_never : |
1101 | - return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() ); |
|
1101 | + return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name()); |
|
1102 | 1102 | break; |
1103 | 1103 | case EE_Registration::checkin_status_in : |
1104 | - return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() ); |
|
1104 | + return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name()); |
|
1105 | 1105 | break; |
1106 | 1106 | case EE_Registration::checkin_status_out : |
1107 | - return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() ); |
|
1107 | + return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name()); |
|
1108 | 1108 | break; |
1109 | 1109 | } |
1110 | 1110 | } |
1111 | - return __( "The check-in status could not be determined.", "event_espresso" ); |
|
1111 | + return __("The check-in status could not be determined.", "event_espresso"); |
|
1112 | 1112 | } |
1113 | 1113 | |
1114 | 1114 | |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | * @return EE_Transaction |
1119 | 1119 | */ |
1120 | 1120 | public function transaction() { |
1121 | - return $this->get_first_related( 'Transaction' ); |
|
1121 | + return $this->get_first_related('Transaction'); |
|
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | * @access public |
1130 | 1130 | */ |
1131 | 1131 | public function reg_code() { |
1132 | - return $this->get( 'REG_code' ); |
|
1132 | + return $this->get('REG_code'); |
|
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 | |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | * @access public |
1140 | 1140 | */ |
1141 | 1141 | public function transaction_ID() { |
1142 | - return $this->get( 'TXN_ID' ); |
|
1142 | + return $this->get('TXN_ID'); |
|
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | |
@@ -1148,7 +1148,7 @@ discard block |
||
1148 | 1148 | * @return int |
1149 | 1149 | */ |
1150 | 1150 | public function ticket_ID() { |
1151 | - return $this->get( 'TKT_ID' ); |
|
1151 | + return $this->get('TKT_ID'); |
|
1152 | 1152 | } |
1153 | 1153 | |
1154 | 1154 | |
@@ -1160,17 +1160,17 @@ discard block |
||
1160 | 1160 | * @param string $REG_code Registration Code |
1161 | 1161 | * @param boolean $use_default |
1162 | 1162 | */ |
1163 | - public function set_reg_code( $REG_code, $use_default = FALSE ) { |
|
1164 | - if ( empty( $REG_code )) { |
|
1165 | - EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1163 | + public function set_reg_code($REG_code, $use_default = FALSE) { |
|
1164 | + if (empty($REG_code)) { |
|
1165 | + EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1166 | 1166 | return; |
1167 | 1167 | } |
1168 | - if ( ! $this->reg_code() ) { |
|
1169 | - parent::set( 'REG_code', $REG_code, $use_default ); |
|
1168 | + if ( ! $this->reg_code()) { |
|
1169 | + parent::set('REG_code', $REG_code, $use_default); |
|
1170 | 1170 | } else { |
1171 | 1171 | EE_Error::doing_it_wrong( |
1172 | - __CLASS__ . '::' . __FUNCTION__, |
|
1173 | - __( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ), |
|
1172 | + __CLASS__.'::'.__FUNCTION__, |
|
1173 | + __('Can not change a registration REG_code once it has been set.', 'event_espresso'), |
|
1174 | 1174 | '4.6.0' |
1175 | 1175 | ); |
1176 | 1176 | } |
@@ -1190,17 +1190,17 @@ discard block |
||
1190 | 1190 | * @return EE_Registration[] or empty array if this isn't a group registration. |
1191 | 1191 | */ |
1192 | 1192 | public function get_all_other_registrations_in_group() { |
1193 | - if ( $this->group_size() < 2 ) { |
|
1193 | + if ($this->group_size() < 2) { |
|
1194 | 1194 | return array(); |
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | $query[0] = array( |
1198 | 1198 | 'TXN_ID' => $this->transaction_ID(), |
1199 | - 'REG_ID' => array( '!=', $this->ID() ), |
|
1199 | + 'REG_ID' => array('!=', $this->ID()), |
|
1200 | 1200 | 'TKT_ID' => $this->ticket_ID() |
1201 | 1201 | ); |
1202 | 1202 | |
1203 | - $registrations = $this->get_model()->get_all( $query ); |
|
1203 | + $registrations = $this->get_model()->get_all($query); |
|
1204 | 1204 | return $registrations; |
1205 | 1205 | } |
1206 | 1206 | |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | * @access public |
1213 | 1213 | */ |
1214 | 1214 | public function price_paid() { |
1215 | - 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' ); |
|
1215 | + 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'); |
|
1216 | 1216 | return $this->final_price(); |
1217 | 1217 | } |
1218 | 1218 | |
@@ -1224,9 +1224,9 @@ discard block |
||
1224 | 1224 | * @access public |
1225 | 1225 | * @param float $REG_final_price |
1226 | 1226 | */ |
1227 | - public function set_price_paid( $REG_final_price = 0.00 ) { |
|
1228 | - 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' ); |
|
1229 | - $this->set_final_price( $REG_final_price ); |
|
1227 | + public function set_price_paid($REG_final_price = 0.00) { |
|
1228 | + 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'); |
|
1229 | + $this->set_final_price($REG_final_price); |
|
1230 | 1230 | } |
1231 | 1231 | |
1232 | 1232 | |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | * @return string |
1238 | 1238 | */ |
1239 | 1239 | public function pretty_price_paid() { |
1240 | - 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' ); |
|
1240 | + 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'); |
|
1241 | 1241 | return $this->pretty_final_price(); |
1242 | 1242 | } |
1243 | 1243 |
@@ -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 | } |
@@ -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' ); |
@@ -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' ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @return boolean success |
34 | 34 | */ |
35 | 35 | public function delete() { |
36 | - return $this->delete_or_restore( TRUE ); |
|
36 | + return $this->delete_or_restore(TRUE); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return boolean success |
44 | 44 | */ |
45 | 45 | public function delete_permanently() { |
46 | - return $this->get_model()->delete_permanently_by_ID( $this->ID() ); |
|
46 | + return $this->get_model()->delete_permanently_by_ID($this->ID()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @param bool $delete true=>delete, false=>restore |
54 | 54 | * @return bool |
55 | 55 | */ |
56 | - public function delete_or_restore( $delete = TRUE ) { |
|
56 | + public function delete_or_restore($delete = TRUE) { |
|
57 | 57 | $model = $this->get_model(); |
58 | - return $model->delete_or_restore_by_ID( $delete, $this->ID() ); |
|
58 | + return $model->delete_or_restore_by_ID($delete, $this->ID()); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | * @return boolean |
66 | 66 | */ |
67 | 67 | public function restore() { |
68 | - return $this->delete_or_restore( FALSE ); |
|
68 | + return $this->delete_or_restore(FALSE); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | \ No newline at end of file |
@@ -36,8 +36,9 @@ |
||
36 | 36 | $tax = 0; |
37 | 37 | $total_tax = 0; |
38 | 38 | //This first checks to see if the given ticket is taxable. |
39 | - if ( ! $ticket->get( 'TKT_taxable' ) ) |
|
40 | - return $tax; |
|
39 | + if ( ! $ticket->get( 'TKT_taxable' ) ) { |
|
40 | + return $tax; |
|
41 | + } |
|
41 | 42 | //get subtotal (notice we're only retrieving a subtotal if there isn't one given) |
42 | 43 | $subtotal = self::get_subtotal_for_admin( $ticket ); |
43 | 44 | //get taxes |
@@ -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 | * Taxes class |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | * @param EE_Ticket $ticket incoming EE_Ticket |
33 | 33 | * @return float total taxes to apply to ticket. |
34 | 34 | */ |
35 | - public static function get_total_taxes_for_admin( EE_Ticket $ticket ) { |
|
35 | + public static function get_total_taxes_for_admin(EE_Ticket $ticket) { |
|
36 | 36 | $tax = 0; |
37 | 37 | $total_tax = 0; |
38 | 38 | //This first checks to see if the given ticket is taxable. |
39 | - if ( ! $ticket->get( 'TKT_taxable' ) ) |
|
39 | + if ( ! $ticket->get('TKT_taxable')) |
|
40 | 40 | return $tax; |
41 | 41 | //get subtotal (notice we're only retrieving a subtotal if there isn't one given) |
42 | - $subtotal = self::get_subtotal_for_admin( $ticket ); |
|
42 | + $subtotal = self::get_subtotal_for_admin($ticket); |
|
43 | 43 | //get taxes |
44 | 44 | $taxes = self::get_taxes_for_admin(); |
45 | 45 | //apply taxes to subtotal |
46 | - foreach ( $taxes as $tax ) { |
|
46 | + foreach ($taxes as $tax) { |
|
47 | 47 | //assuming taxes are not cumulative |
48 | - $total_tax += $subtotal * $tax->get( 'PRC_amount' ) / 100; |
|
48 | + $total_tax += $subtotal * $tax->get('PRC_amount') / 100; |
|
49 | 49 | } |
50 | 50 | return $total_tax; |
51 | 51 | } |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | * @param EE_Ticket $ticket |
57 | 57 | * @return float |
58 | 58 | */ |
59 | - public static function get_subtotal_for_admin( EE_Ticket $ticket ) { |
|
59 | + public static function get_subtotal_for_admin(EE_Ticket $ticket) { |
|
60 | 60 | $TKT_ID = $ticket->ID(); |
61 | - return isset( self::$_subtotal[ $TKT_ID ] ) ? self::$_subtotal[ $TKT_ID ] : self::_get_subtotal_for_admin( $ticket ); |
|
61 | + return isset(self::$_subtotal[$TKT_ID]) ? self::$_subtotal[$TKT_ID] : self::_get_subtotal_for_admin($ticket); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
@@ -68,26 +68,26 @@ discard block |
||
68 | 68 | * @param EE_Ticket $ticket |
69 | 69 | * @return float subtotal calculated from all EE_Price[] on Ticket. |
70 | 70 | */ |
71 | - private static function _get_subtotal_for_admin( EE_Ticket $ticket ) { |
|
71 | + private static function _get_subtotal_for_admin(EE_Ticket $ticket) { |
|
72 | 72 | $subtotal = 0; |
73 | 73 | //get all prices |
74 | - $prices = $ticket->get_many_related( 'Price', array( 'default_where_conditions' => 'none', 'order_by' => array( 'PRC_order' => 'ASC' ) ) ); |
|
74 | + $prices = $ticket->get_many_related('Price', array('default_where_conditions' => 'none', 'order_by' => array('PRC_order' => 'ASC'))); |
|
75 | 75 | //let's loop through them (base price is always the first item) |
76 | - foreach ( $prices as $price ) { |
|
77 | - if ( $price instanceof EE_Price ) { |
|
78 | - switch ( $price->type_obj()->base_type() ) { |
|
76 | + foreach ($prices as $price) { |
|
77 | + if ($price instanceof EE_Price) { |
|
78 | + switch ($price->type_obj()->base_type()) { |
|
79 | 79 | case 1: // base price |
80 | 80 | case 3: // surcharges |
81 | - $subtotal += $price->is_percent() ? $subtotal * $price->get( 'PRC_amount' ) / 100 : $price->get( 'PRC_amount' ); |
|
81 | + $subtotal += $price->is_percent() ? $subtotal * $price->get('PRC_amount') / 100 : $price->get('PRC_amount'); |
|
82 | 82 | break; |
83 | 83 | case 2: // discounts |
84 | - $subtotal -= $price->is_percent() ? $subtotal * $price->get( 'PRC_amount' ) / 100 : $price->get( 'PRC_amount' ); |
|
84 | + $subtotal -= $price->is_percent() ? $subtotal * $price->get('PRC_amount') / 100 : $price->get('PRC_amount'); |
|
85 | 85 | break; |
86 | 86 | } |
87 | 87 | } |
88 | 88 | } |
89 | 89 | $TKT_ID = $ticket->ID(); |
90 | - self::$_subtotal = array( $TKT_ID => $subtotal ); |
|
90 | + self::$_subtotal = array($TKT_ID => $subtotal); |
|
91 | 91 | return $subtotal; |
92 | 92 | } |
93 | 93 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return EE_Price[] EE_Price objects that have PRT_ID == 4 |
99 | 99 | */ |
100 | 100 | public static function get_taxes_for_admin() { |
101 | - self::$_default_taxes = ! empty( self::$_default_taxes ) ? self::$_default_taxes : EE_Registry::instance()->load_model( 'Price' )->get_all( array( array( 'Price_Type.PBT_ID' => 4 ) ) ); |
|
101 | + self::$_default_taxes = ! empty(self::$_default_taxes) ? self::$_default_taxes : EE_Registry::instance()->load_model('Price')->get_all(array(array('Price_Type.PBT_ID' => 4))); |
|
102 | 102 | return self::$_default_taxes; |
103 | 103 | } |
104 | 104 |
@@ -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 |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | * @param array $props_n_values |
31 | 31 | * @return EE_Term_Relationship |
32 | 32 | */ |
33 | - public static function new_instance( $props_n_values = array() ) { |
|
34 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
35 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
33 | + public static function new_instance($props_n_values = array()) { |
|
34 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
35 | + return $has_object ? $has_object : new self($props_n_values); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * @param array $props_n_values |
42 | 42 | * @return EE_Term_Relationship |
43 | 43 | */ |
44 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
45 | - return new self( $props_n_values, TRUE ); |
|
44 | + public static function new_instance_from_db($props_n_values = array()) { |
|
45 | + return new self($props_n_values, TRUE); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 |
@@ -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 |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @param string $timezone |
36 | 36 | * @return EE_Ticket_Template|mixed |
37 | 37 | */ |
38 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
39 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
40 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
38 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
39 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
40 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @param string $timezone |
48 | 48 | * @return EE_Ticket_Template |
49 | 49 | */ |
50 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
51 | - return new self( $props_n_values, TRUE, $timezone ); |
|
50 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
51 | + return new self($props_n_values, TRUE, $timezone); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |