Completed
Branch old/BUG-7514-7935-7936-price-o... (518ae6)
by
unknown
13:33 queued 11:14
created
core/db_classes/EE_Message_Template_Group.class.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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,9 +34,9 @@  discard block
 block discarded – undo
34 34
 	 * @param string $timezone
35 35
 	 * @return EE_Message_Template_Group|mixed
36 36
 	 */
37
-	public static function new_instance( $props_n_values = array(), $timezone = '' ) {
38
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone );
39
-		return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone );
37
+	public static function new_instance($props_n_values = array(), $timezone = '') {
38
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone);
39
+		return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone);
40 40
 	}
41 41
 
42 42
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	 * @param string $timezone
47 47
 	 * @return EE_Message_Template_Group
48 48
 	 */
49
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) {
50
-		return new self( $props_n_values, TRUE, $timezone );
49
+	public static function new_instance_from_db($props_n_values = array(), $timezone = '') {
50
+		return new self($props_n_values, TRUE, $timezone);
51 51
 	}
52 52
 
53 53
 
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 	 * @param bool $message_type
57 57
 	 * @throws EE_Error
58 58
 	 */
59
-	public function set_message_type( $message_type = FALSE ) {
60
-		if ( ! $message_type ) {
61
-			throw new EE_Error( __( 'Missing required value for the message_type parameter', 'event_espresso' ) );
59
+	public function set_message_type($message_type = FALSE) {
60
+		if ( ! $message_type) {
61
+			throw new EE_Error(__('Missing required value for the message_type parameter', 'event_espresso'));
62 62
 		}
63
-		$this->set( 'MTP_message_type', $message_type );
63
+		$this->set('MTP_message_type', $message_type);
64 64
 	}
65 65
 
66 66
 
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
 	 * @param bool $messenger
70 70
 	 * @throws EE_Error
71 71
 	 */
72
-	public function set_messenger( $messenger = FALSE ) {
73
-		if ( ! $messenger ) {
74
-			throw new EE_Error( __( 'Missing required value for the messenger parameter', 'event_espresso' ) );
72
+	public function set_messenger($messenger = FALSE) {
73
+		if ( ! $messenger) {
74
+			throw new EE_Error(__('Missing required value for the messenger parameter', 'event_espresso'));
75 75
 		}
76
-		$this->set( 'MTP_messenger', $messenger );
76
+		$this->set('MTP_messenger', $messenger);
77 77
 	}
78 78
 
79 79
 
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
 	 * @param bool $GRP_ID
83 83
 	 * @throws EE_Error
84 84
 	 */
85
-	public function set_group_template_id( $GRP_ID = FALSE ) {
86
-		if ( ! $GRP_ID ) {
87
-			throw new EE_Error( __( 'Missing required value for the message template group id', 'event_espresso' ) );
85
+	public function set_group_template_id($GRP_ID = FALSE) {
86
+		if ( ! $GRP_ID) {
87
+			throw new EE_Error(__('Missing required value for the message template group id', 'event_espresso'));
88 88
 		}
89
-		$this->set( 'GRP_ID', $GRP_ID );
89
+		$this->set('GRP_ID', $GRP_ID);
90 90
 	}
91 91
 
92 92
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 * @return int
98 98
 	 */
99 99
 	public function GRP_ID() {
100
-		return $this->get( 'GRP_ID' );
100
+		return $this->get('GRP_ID');
101 101
 	}
102 102
 
103 103
 
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	 * @return int
109 109
 	 */
110 110
 	public function user() {
111
-		$user_id = $this->get( 'MTP_user_id' );
112
-		return empty( $user_id ) ? get_current_user_id() : $user_id;
111
+		$user_id = $this->get('MTP_user_id');
112
+		return empty($user_id) ? get_current_user_id() : $user_id;
113 113
 	}
114 114
 
115 115
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 * @return int
133 133
 	 */
134 134
 	public function count_events() {
135
-		return $this->count_related( 'Event' );
135
+		return $this->count_related('Event');
136 136
 	}
137 137
 
138 138
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @return string
143 143
 	 */
144 144
 	public function name() {
145
-		return $this->get( 'MTP_name' );
145
+		return $this->get('MTP_name');
146 146
 	}
147 147
 
148 148
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 * @return string
153 153
 	 */
154 154
 	public function description() {
155
-		return $this->get( 'MTP_description' );
155
+		return $this->get('MTP_description');
156 156
 	}
157 157
 
158 158
 
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 	 * @param  array $query_params like EEM_Base::get_all()
163 163
 	 * @return EE_Message_Template[]
164 164
 	 */
165
-	public function message_templates( $query_params = array() ) {
166
-		return $this->get_many_related( 'Message_Template', $query_params );
165
+	public function message_templates($query_params = array()) {
166
+		return $this->get_many_related('Message_Template', $query_params);
167 167
 	}
168 168
 
169 169
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 * @return string
175 175
 	 */
176 176
 	public function messenger() {
177
-		return $this->get( 'MTP_messenger' );
177
+		return $this->get('MTP_messenger');
178 178
 	}
179 179
 
180 180
 
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	public function messenger_obj() {
192 192
 		$messenger = $this->messenger();
193
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
193
+		EE_Registry::instance()->load_helper('MSG_Template');
194 194
 		try {
195
-			$messenger = EEH_MSG_Template::messenger_obj( $messenger );
196
-		} catch( EE_Error $e ) {
195
+			$messenger = EEH_MSG_Template::messenger_obj($messenger);
196
+		} catch (EE_Error $e) {
197 197
 			//if an exception was thrown then let's deactivate this message template group because it means there is no class for this messenger in this group.
198
-			$this->set( 'MTP_is_active', false );
198
+			$this->set('MTP_is_active', false);
199 199
 			$this->save();
200 200
 			return null;
201 201
 		}
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 * @return string
212 212
 	 */
213 213
 	public function message_type() {
214
-		return $this->get( 'MTP_message_type' );
214
+		return $this->get('MTP_message_type');
215 215
 	}
216 216
 
217 217
 
@@ -228,12 +228,12 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	public function message_type_obj() {
230 230
 		$message_type = $this->message_type();
231
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
231
+		EE_Registry::instance()->load_helper('MSG_Template');
232 232
 		try {
233
-			$message_type = EEH_MSG_Template::message_type_obj( $message_type );
234
-		} catch(EE_Error $e) {
233
+			$message_type = EEH_MSG_Template::message_type_obj($message_type);
234
+		} catch (EE_Error $e) {
235 235
 			//if an exception was thrown then let's deactivate this message template group because it means there is no class for the message type in this group.
236
-			$this->set( 'MTP_is_active', false );
236
+			$this->set('MTP_is_active', false);
237 237
 			$this->save();
238 238
 			return null;
239 239
 		}
@@ -270,13 +270,13 @@  discard block
 block discarded – undo
270 270
 	 */
271 271
 	public function context_templates() {
272 272
 		$mtps_arr = array();
273
-		$mtps = $this->get_many_related( 'Message_Template' );
274
-		if ( empty( $mtps ) ) {
273
+		$mtps = $this->get_many_related('Message_Template');
274
+		if (empty($mtps)) {
275 275
 			return array();
276 276
 		}
277 277
 		//note contexts could have CHECKBOX fields per context. So we return the objects indexed by context AND field.
278
-		foreach ( $mtps as $mtp ) {
279
-			$mtps_arr[ $mtp->get( 'MTP_context' ) ][ $mtp->get( 'MTP_template_field' ) ] = $mtp;
278
+		foreach ($mtps as $mtp) {
279
+			$mtps_arr[$mtp->get('MTP_context')][$mtp->get('MTP_template_field')] = $mtp;
280 280
 		}
281 281
 		return $mtps_arr;
282 282
 	}
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 * @return boolean true if it is, false if it isn't
289 289
 	 */
290 290
 	public function is_global() {
291
-		return $this->get( 'MTP_is_global' );
291
+		return $this->get('MTP_is_global');
292 292
 	}
293 293
 
294 294
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	 * @return boolean true if it is, false if it isn't
299 299
 	 */
300 300
 	public function is_active() {
301
-		return $this->get( 'MTP_is_active' );
301
+		return $this->get('MTP_is_active');
302 302
 	}
303 303
 
304 304
 
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
 	 * @param bool   $merged  If TRUE then we don't return shortcodes indexed by field but instead an array of the unique shortcodes for all the given (or all) fields.
315 315
 	 * @return mixed (array|bool) an array of shortcodes in the format array( '[shortcode] => 'label') OR FALSE if no shortcodes found.
316 316
 	 */
317
-	public function get_shortcodes( $context, $fields = array(), $merged = FALSE ) {
317
+	public function get_shortcodes($context, $fields = array(), $merged = FALSE) {
318 318
 		$messenger = $this->messenger();
319 319
 		$message_type = $this->message_type();
320
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
321
-		return EEH_MSG_Template::get_shortcodes( $message_type, $messenger, $fields, $context, $merged );
320
+		EE_Registry::instance()->load_helper('MSG_Template');
321
+		return EEH_MSG_Template::get_shortcodes($message_type, $messenger, $fields, $context, $merged);
322 322
 	}
323 323
 
324 324
 
@@ -331,20 +331,20 @@  discard block
 block discarded – undo
331 331
 	 * @throws EE_Error
332 332
 	 * @return array    an array of EE_Shortcode objects
333 333
 	 */
334
-	private function _get_shortcode_objects( $sc_refs ) {
334
+	private function _get_shortcode_objects($sc_refs) {
335 335
 		$sc_objs = array();
336 336
 		EED_Messages::set_autoloaders();
337
-		foreach ( $sc_refs as $shortcode_ref ) {
338
-			$ref = ucwords( str_replace( '_', ' ', $shortcode_ref ) );
339
-			$ref = str_replace( ' ', '_', $ref );
340
-			$classname = 'EE_' . $ref . '_Shortcodes';
341
-			if ( ! class_exists( $classname ) ) {
342
-				$msg[ ] = __( 'Shortcode library loading fail.', 'event_espresso' );
343
-				$msg[ ] = sprintf( __( 'The class name checked was "%s". Please check the spelling and case of this reference and make sure it matches the appropriate shortcode library file name (minus the extension) in the "/library/shortcodes/" directory', 'event_espresso' ), $classname );
344
-				throw new EE_Error( implode( '||', $msg ) );
337
+		foreach ($sc_refs as $shortcode_ref) {
338
+			$ref = ucwords(str_replace('_', ' ', $shortcode_ref));
339
+			$ref = str_replace(' ', '_', $ref);
340
+			$classname = 'EE_'.$ref.'_Shortcodes';
341
+			if ( ! class_exists($classname)) {
342
+				$msg[] = __('Shortcode library loading fail.', 'event_espresso');
343
+				$msg[] = sprintf(__('The class name checked was "%s". Please check the spelling and case of this reference and make sure it matches the appropriate shortcode library file name (minus the extension) in the "/library/shortcodes/" directory', 'event_espresso'), $classname);
344
+				throw new EE_Error(implode('||', $msg));
345 345
 			}
346
-			$a = new ReflectionClass( $classname );
347
-			$sc_objs[ ] = $a->newInstance();
346
+			$a = new ReflectionClass($classname);
347
+			$sc_objs[] = $a->newInstance();
348 348
 		}
349 349
 		return $sc_objs;
350 350
 	}
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 	 * @return string
360 360
 	 */
361 361
 	public function get_template_pack_name() {
362
-		return $this->get_extra_meta( 'MTP_template_pack', TRUE, 'default' );
362
+		return $this->get_extra_meta('MTP_template_pack', TRUE, 'default');
363 363
 	}
364 364
 
365 365
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 	public function get_template_pack() {
376 376
 		$pack_name = $this->get_template_pack_name();
377 377
 
378
-		return EED_Messages::get_template_pack( $pack_name );
378
+		return EED_Messages::get_template_pack($pack_name);
379 379
 	}
380 380
 
381 381
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	 * @return string
389 389
 	 */
390 390
 	public function get_template_pack_variation() {
391
-		return $this->get_extra_meta( 'MTP_variation', TRUE, 'default' );
391
+		return $this->get_extra_meta('MTP_variation', TRUE, 'default');
392 392
 	}
393 393
 
394 394
 
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 	 *
402 402
 	 * @param string $template_pack_name What message template pack is assigned.
403 403
 	 */
404
-	public function set_template_pack_name( $template_pack_name ) {
405
-		return $this->update_extra_meta( 'MTP_template_pack', $template_pack_name );
404
+	public function set_template_pack_name($template_pack_name) {
405
+		return $this->update_extra_meta('MTP_template_pack', $template_pack_name);
406 406
 	}
407 407
 
408 408
 
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
 	 *
416 416
 	 * @param string $variation What variation is being set on the message template group.
417 417
 	 */
418
-	public function set_template_pack_variation( $variation ) {
419
-		return $this->update_extra_meta( 'MTP_variation', $variation );
418
+	public function set_template_pack_variation($variation) {
419
+		return $this->update_extra_meta('MTP_variation', $variation);
420 420
 	}
421 421
 }
422 422
 //end EE_Message_Template_Group class
Please login to merge, or discard this patch.
core/db_classes/EE_Payment.class.php 3 patches
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	 * @access        public
288 288
 	 */
289 289
 	public function amount() {
290
-		return $this->get( 'PAY_amount' );
290
+		return $this->get('PAY_amount');
291 291
 	}
292 292
 
293 293
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	 * @return mixed
297 297
 	 */
298 298
 	public function amount_no_code() {
299
-		return $this->get_pretty( 'PAY_amount', 'no_currency_code' );
299
+		return $this->get_pretty('PAY_amount', 'no_currency_code');
300 300
 	}
301 301
 
302 302
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 * @access        public
307 307
 	 */
308 308
 	public function gateway_response() {
309
-		return $this->get( 'PAY_gateway_response' );
309
+		return $this->get('PAY_gateway_response');
310 310
 	}
311 311
 
312 312
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	 * @access        public
317 317
 	 */
318 318
 	public function txn_id_chq_nmbr() {
319
-		return $this->get( 'PAY_txn_id_chq_nmbr' );
319
+		return $this->get('PAY_txn_id_chq_nmbr');
320 320
 	}
321 321
 
322 322
 
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 	 * @access        public
327 327
 	 */
328 328
 	public function po_number() {
329
-		return $this->get( 'PAY_po_number' );
329
+		return $this->get('PAY_po_number');
330 330
 	}
331 331
 
332 332
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	 * @access        public
337 337
 	 */
338 338
 	public function extra_accntng() {
339
-		return $this->get( 'PAY_extra_accntng' );
339
+		return $this->get('PAY_extra_accntng');
340 340
 	}
341 341
 
342 342
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 	 * @access        public
357 357
 	 */
358 358
 	public function details() {
359
-		return $this->get( 'PAY_details' );
359
+		return $this->get('PAY_details');
360 360
 	}
361 361
 
362 362
 
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
 	 * @param bool $show_icons
386 386
 	 * @return void
387 387
 	 */
388
-	public function e_pretty_status( $show_icons = FALSE ) {
389
-		echo $this->pretty_status( $show_icons );
388
+	public function e_pretty_status($show_icons = FALSE) {
389
+		echo $this->pretty_status($show_icons);
390 390
 	}
391 391
 
392 392
 
@@ -396,10 +396,10 @@  discard block
 block discarded – undo
396 396
 	 * @param bool $show_icons
397 397
 	 * @return string
398 398
 	 */
399
-	public function pretty_status( $show_icons = FALSE ) {
400
-		$status = EEM_Status::instance()->localized_status( array( $this->STS_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' );
399
+	public function pretty_status($show_icons = FALSE) {
400
+		$status = EEM_Status::instance()->localized_status(array($this->STS_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence');
401 401
 		$icon = '';
402
-		switch ( $this->STS_ID() ) {
402
+		switch ($this->STS_ID()) {
403 403
 			case EEM_Payment::status_id_approved:
404 404
 				$icon = $show_icons ? '<span class="dashicons dashicons-yes ee-icon-size-24 green-text"></span>' : '';
405 405
 				break;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 				$icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : '';
414 414
 				break;
415 415
 		}
416
-		return $icon . $status[ $this->STS_ID() ];
416
+		return $icon.$status[$this->STS_ID()];
417 417
 	}
418 418
 
419 419
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 	 * @return boolean whether the payment is approved or not
425 425
 	 */
426 426
 	public function is_approved() {
427
-		return $this->status_is( EEM_Payment::status_id_approved );
427
+		return $this->status_is(EEM_Payment::status_id_approved);
428 428
 	}
429 429
 
430 430
 
@@ -436,8 +436,8 @@  discard block
 block discarded – undo
436 436
 	 *                       one of the status_id_* on the EEM_Payment model
437 437
 	 * @return boolean whether the status of this payment equals the status id
438 438
 	 */
439
-	protected function status_is( $STS_ID ) {
440
-		if ( $STS_ID == $this->STS_ID() ) {
439
+	protected function status_is($STS_ID) {
440
+		if ($STS_ID == $this->STS_ID()) {
441 441
 			return TRUE;
442 442
 		} else {
443 443
 			return FALSE;
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 	 * @return boolean whether the payment is pending or not
452 452
 	 */
453 453
 	public function is_pending() {
454
-		return $this->status_is( EEM_Payment::status_id_pending );
454
+		return $this->status_is(EEM_Payment::status_id_pending);
455 455
 	}
456 456
 
457 457
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	 * @return boolean
462 462
 	 */
463 463
 	public function is_cancelled() {
464
-		return $this->status_is( EEM_Payment::status_id_cancelled );
464
+		return $this->status_is(EEM_Payment::status_id_cancelled);
465 465
 	}
466 466
 
467 467
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	 * @return boolean
472 472
 	 */
473 473
 	public function is_declined() {
474
-		return $this->status_is( EEM_Payment::status_id_declined );
474
+		return $this->status_is(EEM_Payment::status_id_declined);
475 475
 	}
476 476
 
477 477
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 	 * @return boolean
482 482
 	 */
483 483
 	public function is_failed() {
484
-		return $this->status_is( EEM_Payment::status_id_failed );
484
+		return $this->status_is(EEM_Payment::status_id_failed);
485 485
 	}
486 486
 
487 487
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 	 * @return EE_Status
492 492
 	 */
493 493
 	public function status_obj() {
494
-		return $this->get_first_related( 'Status' );
494
+		return $this->get_first_related('Status');
495 495
 	}
496 496
 
497 497
 
@@ -501,8 +501,8 @@  discard block
 block discarded – undo
501 501
 	 * @param array $query_params like EEM_Base::get_all
502 502
 	 * @return EE_Extra_Meta
503 503
 	 */
504
-	public function extra_meta( $query_params = array() ) {
505
-		return $this->get_many_related( 'Extra_Meta', $query_params );
504
+	public function extra_meta($query_params = array()) {
505
+		return $this->get_many_related('Extra_Meta', $query_params);
506 506
 	}
507 507
 
508 508
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	 * offline ones, dont' create payments)
514 514
 	 * @return EE_Payment_Method
515 515
 	 */
516
-	function payment_method(){
516
+	function payment_method() {
517 517
 		return $this->get_first_related('Payment_Method');
518 518
 	}
519 519
 
@@ -528,12 +528,12 @@  discard block
 block discarded – undo
528 528
 	 * @param string $inside_form_html
529 529
 	 * @return string html
530 530
 	 */
531
-	function redirect_form( $inside_form_html = NULL ) {
531
+	function redirect_form($inside_form_html = NULL) {
532 532
 		$redirect_url = $this->redirect_url();
533
-		if ( ! empty( $redirect_url )) {
533
+		if ( ! empty($redirect_url)) {
534 534
 			EE_Registry::instance()->load_helper('HTML');
535 535
 			// what ? no inner form content?
536
-			if( $inside_form_html === NULL ) {
536
+			if ($inside_form_html === NULL) {
537 537
 				$inside_form_html = EEH_HTML::p(
538 538
 					sprintf(
539 539
 						__('If you are not automatically redirected to the payment website within 10 seconds... %1$s %2$s Click Here %3$s', 'event_espresso'),
@@ -545,10 +545,10 @@  discard block
 block discarded – undo
545 545
 				);
546 546
 			}
547 547
 			$method = $this->redirect_args() ? 'POST' : 'GET';
548
-			$form = EEH_HTML::nl(1) . '<form method="' . $method . '" name="gateway_form" action="' . $redirect_url . '">';
549
-			$form .= EEH_HTML::nl(1) . $this->redirect_args_as_inputs();
548
+			$form = EEH_HTML::nl(1).'<form method="'.$method.'" name="gateway_form" action="'.$redirect_url.'">';
549
+			$form .= EEH_HTML::nl(1).$this->redirect_args_as_inputs();
550 550
 			$form .= $inside_form_html;
551
-			$form .= EEH_HTML::nl(-1) . '</form>' . EEH_HTML::nl(-1);
551
+			$form .= EEH_HTML::nl(-1).'</form>'.EEH_HTML::nl(-1);
552 552
 			return $form;
553 553
 		} else {
554 554
 			return NULL;
@@ -562,12 +562,12 @@  discard block
 block discarded – undo
562 562
 	 * Changes all the name-value pairs of
563 563
 	 * @return string
564 564
 	 */
565
-	function redirect_args_as_inputs(){
565
+	function redirect_args_as_inputs() {
566 566
 		$html = '';
567
-		if( $this->redirect_args() !== NULL && is_array( $this->redirect_args() )) {
567
+		if ($this->redirect_args() !== NULL && is_array($this->redirect_args())) {
568 568
 			EE_Registry::instance()->load_helper('HTML');
569
-			foreach($this->redirect_args() as $name => $value){
570
-				$html .= EEH_HTML::nl(0) . '<input type="hidden" name="' . $name . '" value="' . esc_attr( $value ) . '"/>';
569
+			foreach ($this->redirect_args() as $name => $value) {
570
+				$html .= EEH_HTML::nl(0).'<input type="hidden" name="'.$name.'" value="'.esc_attr($value).'"/>';
571 571
 			}
572 572
 		}
573 573
 		return $html;
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 	 * object itself)
583 583
 	 * @return string for the currency code
584 584
 	 */
585
-	public function currency_code(){
585
+	public function currency_code() {
586 586
 		return EE_Config::instance()->currency->code;
587 587
 	}
588 588
 
@@ -596,14 +596,14 @@  discard block
 block discarded – undo
596 596
 	 * @access        private
597 597
 	 * @param        mixed $item
598 598
 	 */
599
-	private function _strip_all_tags_within_array( &$item ) {
600
-		if( is_object( $item ) ) {
599
+	private function _strip_all_tags_within_array(&$item) {
600
+		if (is_object($item)) {
601 601
 			$item = (array) $item;
602 602
 		}
603
-		if( is_array( $item ) ){
604
-			array_walk_recursive( $item, array( $this, '_strip_all_tags_within_array' ) );
605
-		}else{
606
-			$item = wp_strip_all_tags( $item );
603
+		if (is_array($item)) {
604
+			array_walk_recursive($item, array($this, '_strip_all_tags_within_array'));
605
+		} else {
606
+			$item = wp_strip_all_tags($item);
607 607
 		}
608 608
 	}
609 609
 
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
 	 * is approved and was created during this request). False otherwise.
613 613
 	 * @return boolean
614 614
 	 */
615
-	public function just_approved(){
616
-		EE_Registry::instance()->load_helper( 'Array' );
617
-		$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() );
615
+	public function just_approved() {
616
+		EE_Registry::instance()->load_helper('Array');
617
+		$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());
618 618
 		$current_status = $this->status();
619
-		if( $original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved ){
619
+		if ($original_status !== EEM_Payment::status_id_approved && $current_status === EEM_Payment::status_id_approved) {
620 620
 			return TRUE;
621
-		}else{
621
+		} else {
622 622
 			return FALSE;
623 623
 		}
624 624
 	}
@@ -630,11 +630,11 @@  discard block
 block discarded – undo
630 630
 	 * @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.)
631 631
 	 * @return mixed
632 632
 	 */
633
-	public function get_pretty($field_name, $extra_cache_ref = NULL){
634
-		if( $field_name == 'PAY_gateway' ){
633
+	public function get_pretty($field_name, $extra_cache_ref = NULL) {
634
+		if ($field_name == 'PAY_gateway') {
635 635
 			return $this->gateway();
636 636
 		}
637
-		return  $this->_get_cached_property( $field_name, TRUE, $extra_cache_ref );
637
+		return  $this->_get_cached_property($field_name, TRUE, $extra_cache_ref);
638 638
 	}
639 639
 }
640 640
 
Please login to merge, or discard this patch.
core/db_classes/EE_Price_Type.class.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
32 32
 	 * @param array $props_n_values
33 33
 	 * @return EE_Price_Type
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
 block discarded – undo
43 43
 	 * @param array $props_n_values
44 44
 	 * @return EE_Price_Type
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,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 * @access        public
56 56
 	 * @param        string $PRT_name
57 57
 	 */
58
-	public function set_name( $PRT_name = '' ) {
59
-		$this->set( 'PRT_name', $PRT_name );
58
+	public function set_name($PRT_name = '') {
59
+		$this->set('PRT_name', $PRT_name);
60 60
 	}
61 61
 
62 62
 
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 	 * @access        public
68 68
 	 * @param        bool $PRT_is_percent
69 69
 	 */
70
-	public function set_is_percent( $PRT_is_percent = FALSE ) {
71
-		$this->set( 'PRT_is_percent', $PRT_is_percent );
70
+	public function set_is_percent($PRT_is_percent = FALSE) {
71
+		$this->set('PRT_is_percent', $PRT_is_percent);
72 72
 	}
73 73
 
74 74
 
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 * @access        public
80 80
 	 * @param        int $PRT_order
81 81
 	 */
82
-	public function set_order( $PRT_order = 0 ) {
83
-		$this->set( 'PRT_order', $PRT_order );
82
+	public function set_order($PRT_order = 0) {
83
+		$this->set('PRT_order', $PRT_order);
84 84
 	}
85 85
 
86 86
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 *
90 90
 	 */
91 91
 	public function move_to_trash() {
92
-		$this->set( 'PRT_deleted', TRUE );
92
+		$this->set('PRT_deleted', TRUE);
93 93
 	}
94 94
 
95 95
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 *
99 99
 	 */
100 100
 	public function restore_from_trash() {
101
-		$this->set( 'PRT_deleted', FALSE );
101
+		$this->set('PRT_deleted', FALSE);
102 102
 	}
103 103
 
104 104
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @access        public
109 109
 	 */
110 110
 	public function name() {
111
-		return $this->get( 'PRT_name' );
111
+		return $this->get('PRT_name');
112 112
 	}
113 113
 
114 114
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * @access        public
119 119
 	 */
120 120
 	public function base_type() {
121
-		return $this->get( 'PBT_ID' );
121
+		return $this->get('PBT_ID');
122 122
 	}
123 123
 
124 124
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @return mixed
128 128
 	 */
129 129
 	public function base_type_name() {
130
-		return $this->get_pretty( 'PBT_ID' );
130
+		return $this->get_pretty('PBT_ID');
131 131
 	}
132 132
 
133 133
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @access        public
138 138
 	 */
139 139
 	public function is_percent() {
140
-		return $this->get( 'PRT_is_percent' );
140
+		return $this->get('PRT_is_percent');
141 141
 	}
142 142
 
143 143
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @return bool
147 147
 	 */
148 148
 	public function is_discount() {
149
-		return $this->get( 'PBT_ID' ) == 2 ? TRUE : FALSE;
149
+		return $this->get('PBT_ID') == 2 ? TRUE : FALSE;
150 150
 	}
151 151
 
152 152
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 * @access        public
170 170
 	 */
171 171
 	public function order() {
172
-		return $this->get( 'PRT_order' );
172
+		return $this->get('PRT_order');
173 173
 	}
174 174
 
175 175
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * @access        public
180 180
 	 */
181 181
 	public function deleted() {
182
-		return $this->get( 'PRT_deleted' );
182
+		return $this->get('PRT_deleted');
183 183
 	}
184 184
 }
185 185
 
Please login to merge, or discard this patch.
core/db_classes/EE_Question_Form_Input.class.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 	 * @access public
83 83
 	 * @return \EE_Question_Form_Input
84 84
 	 */
85
-	public function __construct( EE_Question $QST = NULL, EE_Answer $ANS = NULL, $q_meta = array() ) {
86
-		if ( empty( $QST ) || empty( $ANS ) ) {
87
-			EE_Error::add_error( __( 'An error occurred. A valid EE_Question or EE_Answer object was not received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
85
+	public function __construct(EE_Question $QST = NULL, EE_Answer $ANS = NULL, $q_meta = array()) {
86
+		if (empty($QST) || empty($ANS)) {
87
+			EE_Error::add_error(__('An error occurred. A valid EE_Question or EE_Answer object was not received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
88 88
 			return NULL;
89 89
 		}
90 90
 		$this->_QST = $QST;
91 91
 		$this->_ANS = $ANS;
92
-		$this->set_question_form_input_meta( $q_meta );
92
+		$this->set_question_form_input_meta($q_meta);
93 93
 		$this->set_question_form_input_init();
94 94
 	}
95 95
 
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 	 * @param array $q_meta
102 102
 	 * @return void
103 103
 	 */
104
-	public function set_question_form_input_meta( $q_meta = array() ) {
105
-		$default_q_meta = array( 'att_nmbr' => 1, 'ticket_id' => '', 'date' => '', 'time' => '', 'input_name' => '', 'input_id' => '', 'input_class' => '', 'input_prefix' => 'qstn', 'append_qstn_id' => TRUE, 'htmlentities' => TRUE, 'allow_null' => FALSE );
106
-		$this->_QST_meta = array_merge( $default_q_meta, $q_meta );
104
+	public function set_question_form_input_meta($q_meta = array()) {
105
+		$default_q_meta = array('att_nmbr' => 1, 'ticket_id' => '', 'date' => '', 'time' => '', 'input_name' => '', 'input_id' => '', 'input_class' => '', 'input_prefix' => 'qstn', 'append_qstn_id' => TRUE, 'htmlentities' => TRUE, 'allow_null' => FALSE);
106
+		$this->_QST_meta = array_merge($default_q_meta, $q_meta);
107 107
 	}
108 108
 
109 109
 
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function set_question_form_input_init() {
117 117
 		$qstn_id = $this->_QST->system_ID() ? $this->_QST->system_ID() : $this->_QST->ID();
118
-		$this->_set_input_name( $qstn_id );
119
-		$this->_set_input_id( $qstn_id );
120
-		$this->_set_input_class( $qstn_id );
121
-		$this->set_question_form_input_answer( $qstn_id );
118
+		$this->_set_input_name($qstn_id);
119
+		$this->_set_input_id($qstn_id);
120
+		$this->_set_input_class($qstn_id);
121
+		$this->set_question_form_input_answer($qstn_id);
122 122
 	}
123 123
 
124 124
 
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 	 * @param $qstn_id
130 130
 	 * @return void
131 131
 	 */
132
-	private function _set_input_name( $qstn_id ) {
133
-		if ( ! empty( $qstn_id ) ) {
134
-			$ANS_ID = $this->get( 'ANS_ID' );
135
-			$qstn_id = ! empty( $ANS_ID ) ? '[' . $qstn_id . '][' . $ANS_ID . ']' : '[' . $qstn_id . ']';
132
+	private function _set_input_name($qstn_id) {
133
+		if ( ! empty($qstn_id)) {
134
+			$ANS_ID = $this->get('ANS_ID');
135
+			$qstn_id = ! empty($ANS_ID) ? '['.$qstn_id.']['.$ANS_ID.']' : '['.$qstn_id.']';
136 136
 		}
137
-		$this->QST_input_name = $this->_QST_meta[ 'append_qstn_id' ] && ! empty( $qstn_id ) ? $this->_QST_meta[ 'input_prefix' ] . $this->_QST_meta[ 'input_name' ] . $qstn_id : $this->_QST_meta[ 'input_prefix' ] . $this->_QST_meta[ 'input_name' ];
137
+		$this->QST_input_name = $this->_QST_meta['append_qstn_id'] && ! empty($qstn_id) ? $this->_QST_meta['input_prefix'].$this->_QST_meta['input_name'].$qstn_id : $this->_QST_meta['input_prefix'].$this->_QST_meta['input_name'];
138 138
 	}
139 139
 
140 140
 
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 	 * @param    string $property
146 146
 	 * @return mixed
147 147
 	 */
148
-	public function get( $property = NULL ) {
149
-		if ( ! empty( $property ) ) {
150
-			if ( EEM_Question::instance()->has_field( $property ) ) {
151
-				return $this->_QST->get( $property );
152
-			} else if ( EEM_Answer::instance()->has_field( $property ) ) {
153
-				return $this->_ANS->get( $property );
154
-			} else if ( $this->_question_form_input_property_exists( __CLASS__, $property ) ) {
148
+	public function get($property = NULL) {
149
+		if ( ! empty($property)) {
150
+			if (EEM_Question::instance()->has_field($property)) {
151
+				return $this->_QST->get($property);
152
+			} else if (EEM_Answer::instance()->has_field($property)) {
153
+				return $this->_ANS->get($property);
154
+			} else if ($this->_question_form_input_property_exists(__CLASS__, $property)) {
155 155
 				return $this->{$property};
156 156
 			}
157 157
 		}
@@ -167,13 +167,13 @@  discard block
 block discarded – undo
167 167
 	 * @param    string $property
168 168
 	 * @return boolean
169 169
 	 */
170
-	private function _question_form_input_property_exists( $classname, $property ) {
170
+	private function _question_form_input_property_exists($classname, $property) {
171 171
 		// first try regular property exists method which works as expected in PHP 5.3+
172
-		$prop = EEH_Class_Tools::has_property( $classname, $property );
173
-		if ( ! $prop ) {
172
+		$prop = EEH_Class_Tools::has_property($classname, $property);
173
+		if ( ! $prop) {
174 174
 			// use reflection for < PHP 5.3 as a double check when property is not found, possible due to access restriction
175
-			$reflector = new ReflectionClass( $classname );
176
-			$prop = $reflector->hasProperty( $property );
175
+			$reflector = new ReflectionClass($classname);
176
+			$prop = $reflector->hasProperty($property);
177 177
 		}
178 178
 		return $prop;
179 179
 	}
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
 	 * @param $qstn_id
187 187
 	 * @return void
188 188
 	 */
189
-	private function _set_input_id( $qstn_id ) {
190
-		$input_id = isset( $this->_QST_meta[ 'input_id' ] ) && ! empty( $this->_QST_meta[ 'input_id' ] ) ? $this->_QST_meta[ 'input_id' ] : sanitize_key( strip_tags( $this->_QST->get( 'QST_display_text' ) ) );
191
-		$this->QST_input_id = $this->_QST_meta[ 'append_qstn_id' ] && ! empty( $qstn_id ) ? $input_id . '-' . $qstn_id : $input_id;
189
+	private function _set_input_id($qstn_id) {
190
+		$input_id = isset($this->_QST_meta['input_id']) && ! empty($this->_QST_meta['input_id']) ? $this->_QST_meta['input_id'] : sanitize_key(strip_tags($this->_QST->get('QST_display_text')));
191
+		$this->QST_input_id = $this->_QST_meta['append_qstn_id'] && ! empty($qstn_id) ? $input_id.'-'.$qstn_id : $input_id;
192 192
 	}
193 193
 
194 194
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 * @return void
200 200
 	 */
201 201
 	private function _set_input_class() {
202
-		$this->QST_input_class = isset( $this->_QST_meta[ 'input_class' ] ) ? $this->_QST_meta[ 'input_class' ] : '';
202
+		$this->QST_input_class = isset($this->_QST_meta['input_class']) ? $this->_QST_meta['input_class'] : '';
203 203
 	}
204 204
 
205 205
 
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
 	 * @param mixed    int | string    $qstn_id
211 211
 	 * @return void
212 212
 	 */
213
-	public function set_question_form_input_answer( $qstn_id ) {
213
+	public function set_question_form_input_answer($qstn_id) {
214 214
 		// check for answer in $_REQUEST in case we are reprocessing a form after an error
215
-		if ( isset( $this->_QST_meta[ 'EVT_ID' ] ) && isset( $this->_QST_meta[ 'att_nmbr' ] ) && isset( $this->_QST_meta[ 'date' ] ) && isset( $this->_QST_meta[ 'time' ] ) && isset( $this->_QST_meta[ 'price_id' ] ) ) {
216
-			if ( isset( $_REQUEST[ 'qstn' ][ $this->_QST_meta[ 'EVT_ID' ] ][ $this->_QST_meta[ 'att_nmbr' ] ][ $this->_QST_meta[ 'date' ] ][ $this->_QST_meta[ 'time' ] ][ $this->_QST_meta[ 'price_id' ] ][ $qstn_id ] ) ) {
217
-				$answer = $_REQUEST[ 'qstn' ][ $this->_QST_meta[ 'EVT_ID' ] ][ $this->_QST_meta[ 'att_nmbr' ] ][ $this->_QST_meta[ 'date' ] ][ $this->_QST_meta[ 'time' ] ][ $this->_QST_meta[ 'price_id' ] ][ $qstn_id ];
218
-				$this->_ANS->set( 'ANS_value', $answer );
215
+		if (isset($this->_QST_meta['EVT_ID']) && isset($this->_QST_meta['att_nmbr']) && isset($this->_QST_meta['date']) && isset($this->_QST_meta['time']) && isset($this->_QST_meta['price_id'])) {
216
+			if (isset($_REQUEST['qstn'][$this->_QST_meta['EVT_ID']][$this->_QST_meta['att_nmbr']][$this->_QST_meta['date']][$this->_QST_meta['time']][$this->_QST_meta['price_id']][$qstn_id])) {
217
+				$answer = $_REQUEST['qstn'][$this->_QST_meta['EVT_ID']][$this->_QST_meta['att_nmbr']][$this->_QST_meta['date']][$this->_QST_meta['time']][$this->_QST_meta['price_id']][$qstn_id];
218
+				$this->_ANS->set('ANS_value', $answer);
219 219
 			}
220 220
 		}
221 221
 	}
@@ -230,40 +230,40 @@  discard block
 block discarded – undo
230 230
 	 * @param    array    $input_types
231 231
 	 * @return        array
232 232
 	 */
233
-	static function generate_question_form_inputs_for_object( $object = FALSE, $input_types = array() ) {
234
-		if ( ! is_object( $object ) ) {
233
+	static function generate_question_form_inputs_for_object($object = FALSE, $input_types = array()) {
234
+		if ( ! is_object($object)) {
235 235
 			return FALSE;
236 236
 		}
237 237
 		$inputs = array();
238
-		$fields = $object->get_model()->field_settings( FALSE );
238
+		$fields = $object->get_model()->field_settings(FALSE);
239 239
 		//		$pk = $object->ID(); <<< NO!
240 240
 		//		EEH_Debug_Tools::printr( $object, get_class( $object ) . '<br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
241 241
 		//		EEH_Debug_Tools::printr( $fields, '$fields  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
242 242
 		//		EEH_Debug_Tools::printr( $input_types, '$input_types  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
243
-		foreach ( $fields as $field_ID => $field ) {
244
-			if ( $field instanceof EE_Model_Field_Base ) {
243
+		foreach ($fields as $field_ID => $field) {
244
+			if ($field instanceof EE_Model_Field_Base) {
245 245
 				//			echo '<h4>$field_ID : ' . $field_ID . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
246 246
 				//			EEH_Debug_Tools::printr( $field, '$field  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
247
-				if ( isset( $input_types[ $field_ID ] ) ) {
247
+				if (isset($input_types[$field_ID])) {
248 248
 					// get saved value for field
249
-					$value = $object->get( $field_ID );
249
+					$value = $object->get($field_ID);
250 250
 					//				echo '<h4>$value : ' . $value . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
251 251
 					// if no saved value, then use default
252 252
 					$value = $value !== NULL ? $value : $field->get_default_value();
253 253
 					//			if ( $field_ID == 'CNT_active' )
254 254
 					//				echo '<h4>$value : ' . $value . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
255 255
 					// determine question type
256
-					$type = isset( $input_types[ $field_ID ] ) ? $input_types[ $field_ID ][ 'type' ] : 'TEXT';
256
+					$type = isset($input_types[$field_ID]) ? $input_types[$field_ID]['type'] : 'TEXT';
257 257
 					// input name
258
-					$input_name = isset( $input_types[ $field_ID ] ) && isset( $input_types[ $field_ID ][ 'input_name' ] ) ? $input_types[ $field_ID ][ 'input_name' ] . '[' . $field_ID . ']' : $field_ID;
258
+					$input_name = isset($input_types[$field_ID]) && isset($input_types[$field_ID]['input_name']) ? $input_types[$field_ID]['input_name'].'['.$field_ID.']' : $field_ID;
259 259
 					// css class for input
260
-					$class = isset( $input_types[ $field_ID ][ 'class' ] ) && ! empty( $input_types[ $field_ID ][ 'class' ] ) ? ' ' . $input_types[ $field_ID ][ 'class' ] : '';
260
+					$class = isset($input_types[$field_ID]['class']) && ! empty($input_types[$field_ID]['class']) ? ' '.$input_types[$field_ID]['class'] : '';
261 261
 					// whether to apply htmlentities to answer
262
-					$htmlentities = isset( $input_types[ $field_ID ][ 'htmlentities' ] ) ? $input_types[ $field_ID ][ 'htmlentities' ] : TRUE;
262
+					$htmlentities = isset($input_types[$field_ID]['htmlentities']) ? $input_types[$field_ID]['htmlentities'] : TRUE;
263 263
 					// whether to apply htmlentities to answer
264
-					$label_b4 = isset( $input_types[ $field_ID ][ 'label_b4' ] ) ? $input_types[ $field_ID ][ 'label_b4' ] : FALSE;
264
+					$label_b4 = isset($input_types[$field_ID]['label_b4']) ? $input_types[$field_ID]['label_b4'] : FALSE;
265 265
 					// whether to apply htmlentities to answer
266
-					$use_desc_4_label = isset( $input_types[ $field_ID ][ 'use_desc_4_label' ] ) ? $input_types[ $field_ID ][ 'use_desc_4_label' ] : FALSE;
266
+					$use_desc_4_label = isset($input_types[$field_ID]['use_desc_4_label']) ? $input_types[$field_ID]['use_desc_4_label'] : FALSE;
267 267
 
268 268
 					// create EE_Question_Form_Input object
269 269
 					$QFI = new EE_Question_Form_Input(
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
 							)
284 284
 						),
285 285
 						array(
286
-							'input_id' => $field_ID . '-' . $object->ID(),
286
+							'input_id' => $field_ID.'-'.$object->ID(),
287 287
 							'input_name' => $input_name,
288
-							'input_class' => $field_ID . $class,
288
+							'input_class' => $field_ID.$class,
289 289
 							'input_prefix' => '',
290 290
 							'append_qstn_id' => FALSE,
291 291
 							'htmlentities' => $htmlentities,
@@ -294,21 +294,21 @@  discard block
 block discarded – undo
294 294
 						)
295 295
 					);
296 296
 					// does question type have options ?
297
-					if ( in_array( $type, array( 'DROPDOWN', 'RADIO_BTN', 'CHECKBOX' ) ) && isset ( $input_types[ $field_ID ] ) && isset ( $input_types[ $field_ID ][ 'options' ] ) ) {
298
-						foreach ( $input_types[ $field_ID ][ 'options' ] as $option ) {
299
-							$option = stripslashes_deep( $option );
300
-							$option_id = ! empty( $option[ 'id' ] ) ? $option[ 'id' ] : 0;
301
-							$QSO = EE_Question_Option::new_instance( array( 'QSO_value' => (string)$option_id, 'QSO_desc' => $option[ 'text' ], 'QSO_deleted' => FALSE ) );
297
+					if (in_array($type, array('DROPDOWN', 'RADIO_BTN', 'CHECKBOX')) && isset ($input_types[$field_ID]) && isset ($input_types[$field_ID]['options'])) {
298
+						foreach ($input_types[$field_ID]['options'] as $option) {
299
+							$option = stripslashes_deep($option);
300
+							$option_id = ! empty($option['id']) ? $option['id'] : 0;
301
+							$QSO = EE_Question_Option::new_instance(array('QSO_value' => (string) $option_id, 'QSO_desc' => $option['text'], 'QSO_deleted' => FALSE));
302 302
 							// all QST (and ANS) properties can be accessed indirectly thru QFI
303
-							$QFI->add_temp_option( $QSO );
303
+							$QFI->add_temp_option($QSO);
304 304
 						}
305 305
 					}
306 306
 					// we don't want ppl manually changing primary keys cuz that would just lead to total craziness man
307
-					if ( $field_ID == $object->get_model()->primary_key_name() ) {
308
-						$QFI->set( 'QST_disabled', TRUE );
307
+					if ($field_ID == $object->get_model()->primary_key_name()) {
308
+						$QFI->set('QST_disabled', TRUE);
309 309
 					}
310 310
 					//EEH_Debug_Tools::printr( $QFI, '$QFI  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
311
-					$inputs[ $field_ID ] = $QFI;
311
+					$inputs[$field_ID] = $QFI;
312 312
 					//			if ( $field_ID == 'CNT_active' ) {
313 313
 					//				EEH_Debug_Tools::printr( $QFI, '$QFI  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
314 314
 					//			}
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 	 * @param \EE_Question_Option $QSO EE_Question_Option
327 327
 	 * @return boolean
328 328
 	 */
329
-	public function add_temp_option( EE_Question_Option $QSO ) {
330
-		$this->_QST->add_temp_option( $QSO );
329
+	public function add_temp_option(EE_Question_Option $QSO) {
330
+		$this->_QST->add_temp_option($QSO);
331 331
 	}
332 332
 
333 333
 
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
 	 * @param    mixed  $value
340 340
 	 * @return mixed
341 341
 	 */
342
-	public function set( $property = NULL, $value = NULL ) {
343
-		if ( ! empty( $property ) ) {
344
-			if ( EEM_Question::instance()->has_field( $property ) ) {
345
-				$this->_QST->set( $property, $value );
346
-			} else if ( EEM_Answer::instance()->has_field( $property ) ) {
347
-				$this->_ANS->set( $property, $value );
348
-			} else if ( $this->_question_form_input_property_exists( __CLASS__, $property ) ) {
342
+	public function set($property = NULL, $value = NULL) {
343
+		if ( ! empty($property)) {
344
+			if (EEM_Question::instance()->has_field($property)) {
345
+				$this->_QST->set($property, $value);
346
+			} else if (EEM_Answer::instance()->has_field($property)) {
347
+				$this->_ANS->set($property, $value);
348
+			} else if ($this->_question_form_input_property_exists(__CLASS__, $property)) {
349 349
 				echo "<hr>$property is a prop of QFI";
350 350
 				$this->{$property} = $value;
351 351
 				return TRUE;
@@ -366,9 +366,9 @@  discard block
 block discarded – undo
366 366
 	 *                                                       whether it was trashed or not.
367 367
 	 * @return EE_Question_Option
368 368
 	 */
369
-	public function options( $notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL ) {
369
+	public function options($notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL) {
370 370
 		$temp_options = $this->_QST->temp_options();
371
-		return ! empty( $temp_options ) ? $temp_options : $this->_QST->options( $notDeletedOptionsOnly, $selected_value_to_always_include );
371
+		return ! empty($temp_options) ? $temp_options : $this->_QST->options($notDeletedOptionsOnly, $selected_value_to_always_include);
372 372
 	}
373 373
 
374 374
 
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 	 * @param mixed $key
380 380
 	 * @return mixed
381 381
 	 */
382
-	public function get_meta( $key = FALSE ) {
383
-		return $key && isset( $this->_QST_meta[ $key ] ) ? $this->_QST_meta[ $key ] : FALSE;
382
+	public function get_meta($key = FALSE) {
383
+		return $key && isset($this->_QST_meta[$key]) ? $this->_QST_meta[$key] : FALSE;
384 384
 	}
385 385
 
386 386
 
Please login to merge, or discard this patch.
core/db_classes/EE_Question_Group.class.php 2 patches
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
32 32
 	 * @param array $props_n_values
33 33
 	 * @return EE_Question_Group|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
 block discarded – undo
43 43
 	 * @param array $props_n_values
44 44
 	 * @return EE_Question_Group
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,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 * @param bool $pretty
56 56
 	 * @return string
57 57
 	 */
58
-	public function name( $pretty = FALSE ) {
59
-		return $pretty ? $this->get_pretty( 'QSG_name' ) : $this->get( 'QSG_name' );
58
+	public function name($pretty = FALSE) {
59
+		return $pretty ? $this->get_pretty('QSG_name') : $this->get('QSG_name');
60 60
 	}
61 61
 
62 62
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return string
69 69
 	 */
70 70
 	public function identifier() {
71
-		return $this->get( 'QSG_identifier' );
71
+		return $this->get('QSG_identifier');
72 72
 	}
73 73
 
74 74
 
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 * @param bool $pretty
80 80
 	 * @return string
81 81
 	 */
82
-	public function desc( $pretty = FALSE ) {
83
-		return $pretty ? $this->get_pretty( 'QSG_desc' ) : $this->get( 'QSG_desc' );
82
+	public function desc($pretty = FALSE) {
83
+		return $pretty ? $this->get_pretty('QSG_desc') : $this->get('QSG_desc');
84 84
 	}
85 85
 
86 86
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 * @return int
93 93
 	 */
94 94
 	public function order() {
95
-		return $this->get( 'QSG_order' );
95
+		return $this->get('QSG_order');
96 96
 	}
97 97
 
98 98
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 * @return boolean
104 104
 	 */
105 105
 	public function show_group_name() {
106
-		return $this->get( 'QSG_show_group_name' );
106
+		return $this->get('QSG_show_group_name');
107 107
 	}
108 108
 
109 109
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 * @return boolean
116 116
 	 */
117 117
 	public function show_group_desc() {
118
-		return $this->get( 'QSG_show_group_desc' );
118
+		return $this->get('QSG_show_group_desc');
119 119
 	}
120 120
 
121 121
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return boolean
129 129
 	 */
130 130
 	public function system_group() {
131
-		return $this->get( 'QSG_system' );
131
+		return $this->get('QSG_system');
132 132
 	}
133 133
 
134 134
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 * @return boolean
154 154
 	 */
155 155
 	public function deleted() {
156
-		return $this->get( 'QST_deleted' );
156
+		return $this->get('QST_deleted');
157 157
 	}
158 158
 
159 159
 
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	public function questions_in_and_not_in_group() {
166 166
 		$questions_in_group = $this->questions();
167
-		$exclude_question_ids = ! empty( $questions_in_group ) ? array_keys( $questions_in_group ) : array();
168
-		$questions_not_in_group = $this->questions_not_in_group( $exclude_question_ids );
167
+		$exclude_question_ids = ! empty($questions_in_group) ? array_keys($questions_in_group) : array();
168
+		$questions_not_in_group = $this->questions_not_in_group($exclude_question_ids);
169 169
 		return $questions_in_group + $questions_not_in_group;
170 170
 	}
171 171
 
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 	 * @param array $query_params
177 177
 	 * @return EE_Question[]
178 178
 	 */
179
-	public function questions( $query_params = array() ) {
180
-		$query_params = ! empty( $query_params ) ? $query_params : array( 'order_by' => array( 'Question_Group_Question.QGQ_order' => 'ASC' ) );
181
-		return $this->ID() ? $this->get_many_related( 'Question', $query_params ) : array();
179
+	public function questions($query_params = array()) {
180
+		$query_params = ! empty($query_params) ? $query_params : array('order_by' => array('Question_Group_Question.QGQ_order' => 'ASC'));
181
+		return $this->ID() ? $this->get_many_related('Question', $query_params) : array();
182 182
 	}
183 183
 
184 184
 
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
 	 * @param  mixed $question_IDS_in_group if empty array then all questions returned.  if FALSE then we first get questions in this group and exclude them from questions get all. IF empty array then we just return all questions.
189 189
 	 * @return EE_Question[]
190 190
 	 */
191
-	public function questions_not_in_group( $question_IDS_in_group = FALSE ) {
192
-		if ( $question_IDS_in_group === FALSE ) {
191
+	public function questions_not_in_group($question_IDS_in_group = FALSE) {
192
+		if ($question_IDS_in_group === FALSE) {
193 193
 			$questions = $this->questions();
194
-			$question_IDS_in_group = ! empty( $questions ) ? array_keys( $questions ) : array();
194
+			$question_IDS_in_group = ! empty($questions) ? array_keys($questions) : array();
195 195
 		}
196
-		$_where = ! empty( $question_IDS_in_group ) ? array( 'QST_ID' => array( 'not_in', $question_IDS_in_group ) ) : array();
196
+		$_where = ! empty($question_IDS_in_group) ? array('QST_ID' => array('not_in', $question_IDS_in_group)) : array();
197 197
 
198
-		return EEM_Question::instance()->get_all( array( $_where, 'order_by' => array( 'QST_ID' => 'ASC' ) ) );
198
+		return EEM_Question::instance()->get_all(array($_where, 'order_by' => array('QST_ID' => 'ASC')));
199 199
 	}
200 200
 
201 201
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * @return EE_Event[]
206 206
 	 */
207 207
 	public function events() {
208
-		return $this->get_many_related( 'Event' );
208
+		return $this->get_many_related('Event');
209 209
 	}
210 210
 
211 211
 
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	 * @param EE_Question || int $question object or ID
216 216
 	 * @return boolean if successful
217 217
 	 */
218
-	public function add_question( $questionObjectOrID ) {
219
-		return $this->_add_relation_to( $questionObjectOrID, 'Question' );
218
+	public function add_question($questionObjectOrID) {
219
+		return $this->_add_relation_to($questionObjectOrID, 'Question');
220 220
 	}
221 221
 
222 222
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	 * @param EE_Question || int $question object or ID
227 227
 	 * @return boolean of success
228 228
 	 */
229
-	public function remove_question( $questionObjectOrID ) {
230
-		return $this->_remove_relation_to( $questionObjectOrID, 'Question' );
229
+	public function remove_question($questionObjectOrID) {
230
+		return $this->_remove_relation_to($questionObjectOrID, 'Question');
231 231
 	}
232 232
 
233 233
 
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
 	 * @param $qst_order
238 238
 	 * @return int
239 239
 	 */
240
-	public function update_question_order( $questionObjectOrID, $qst_order ) {
241
-		$qst_ID = $questionObjectOrID instanceof EE_Question ? $questionObjectOrID->ID() : (int)$questionObjectOrID;
242
-		return EEM_Question_Group_Question::instance()->update( array( 'QGQ_order' => $qst_order ), array( array( 'QST_ID' => $qst_ID, 'QSG_ID' => $this->ID() ) ) );
240
+	public function update_question_order($questionObjectOrID, $qst_order) {
241
+		$qst_ID = $questionObjectOrID instanceof EE_Question ? $questionObjectOrID->ID() : (int) $questionObjectOrID;
242
+		return EEM_Question_Group_Question::instance()->update(array('QGQ_order' => $qst_order), array(array('QST_ID' => $qst_ID, 'QSG_ID' => $this->ID())));
243 243
 	}
244 244
 
245 245
 
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	public function has_questions_with_answers() {
252 252
 		$has_answers = FALSE;
253
-		$questions = $this->get_many_related( 'Question' );
254
-		foreach ( $questions as $question ) {
255
-			if ( $question->count_related( 'Answer' ) > 0 )
253
+		$questions = $this->get_many_related('Question');
254
+		foreach ($questions as $question) {
255
+			if ($question->count_related('Answer') > 0)
256 256
 				$has_answers = TRUE;
257 257
 		}
258 258
 		return $has_answers;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 */
269 269
 	public function set_order_to_latest() {
270 270
 		$latest_order = $this->get_model()->get_latest_question_group_order();
271
-		$latest_order ++;
272
-		$this->set( 'QSG_order', $latest_order );
271
+		$latest_order++;
272
+		$this->set('QSG_order', $latest_order);
273 273
 	}
274 274
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -252,8 +252,9 @@
 block discarded – undo
252 252
 		$has_answers = FALSE;
253 253
 		$questions = $this->get_many_related( 'Question' );
254 254
 		foreach ( $questions as $question ) {
255
-			if ( $question->count_related( 'Answer' ) > 0 )
256
-				$has_answers = TRUE;
255
+			if ( $question->count_related( 'Answer' ) > 0 ) {
256
+							$has_answers = TRUE;
257
+			}
257 258
 		}
258 259
 		return $has_answers;
259 260
 	}
Please login to merge, or discard this patch.
core/db_classes/EE_Question_Group_Question.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
core/db_classes/EE_Registration.class.php 3 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 ) ) );
Please login to merge, or discard this patch.
Spacing   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * EE_Registration class
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 	 * @param string $timezone
17 17
 	 * @return EE_Registration
18 18
 	 */
19
-	public static function new_instance( $props_n_values = array(), $timezone = '' ) {
20
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
21
-		return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone );
19
+	public static function new_instance($props_n_values = array(), $timezone = '') {
20
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
21
+		return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone);
22 22
 	}
23 23
 
24 24
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	 * @param string  $timezone
29 29
 	 * @return EE_Registration
30 30
 	 */
31
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) {
32
-		return new self( $props_n_values, TRUE, $timezone );
31
+	public static function new_instance_from_db($props_n_values = array(), $timezone = '') {
32
+		return new self($props_n_values, TRUE, $timezone);
33 33
 	}
34 34
 
35 35
 
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	 * @access        public
41 41
 	 * @param        int $EVT_ID Event ID
42 42
 	 */
43
-	public function set_event( $EVT_ID = 0 ) {
44
-		$this->set( 'EVT_ID', $EVT_ID );
43
+	public function set_event($EVT_ID = 0) {
44
+		$this->set('EVT_ID', $EVT_ID);
45 45
 	}
46 46
 
47 47
 
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
 	 * @param mixed  $field_value
53 53
 	 * @param bool   $use_default
54 54
 	 */
55
-	public function set( $field_name, $field_value, $use_default = FALSE ) {
56
-		switch( $field_name ) {
55
+	public function set($field_name, $field_value, $use_default = FALSE) {
56
+		switch ($field_name) {
57 57
 			case 'REG_code' :
58
-				if ( ! empty( $field_value ) && $this->reg_code() == '' ) {
59
-					$this->set_reg_code( $field_value, $use_default );
58
+				if ( ! empty($field_value) && $this->reg_code() == '') {
59
+					$this->set_reg_code($field_value, $use_default);
60 60
 				}
61 61
 				break;
62 62
 			case 'STS_ID' :
63
-				$this->set_status( $field_value, $use_default );
63
+				$this->set_status($field_value, $use_default);
64 64
 				break;
65 65
 			default :
66
-				parent::set( $field_name, $field_value, $use_default );
66
+				parent::set($field_name, $field_value, $use_default);
67 67
 		}
68 68
 	}
69 69
 
@@ -80,30 +80,30 @@  discard block
 block discarded – undo
80 80
 	 * @param boolean $use_default
81 81
 	 * @return bool
82 82
 	 */
83
-	public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) {
83
+	public function set_status($new_STS_ID = NULL, $use_default = FALSE) {
84 84
 		// get current REG_Status
85 85
 		$old_STS_ID = $this->status_ID();
86 86
 		// if status has changed
87
-		if ( $old_STS_ID != $new_STS_ID  ) {
87
+		if ($old_STS_ID != $new_STS_ID) {
88 88
 			// TO approved
89
-			if ( $new_STS_ID == EEM_Registration::status_id_approved ) {
89
+			if ($new_STS_ID == EEM_Registration::status_id_approved) {
90 90
 				// reserve a space by incrementing ticket and datetime sold values
91 91
 				$this->_reserve_registration_space();
92
-				do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID );
92
+				do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID);
93 93
 			// OR FROM  approved
94
-			} else if ( $old_STS_ID == EEM_Registration::status_id_approved ) {
94
+			} else if ($old_STS_ID == EEM_Registration::status_id_approved) {
95 95
 				// release a space by decrementing ticket and datetime sold values
96 96
 				$this->_release_registration_space();
97
-				do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID );
97
+				do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID);
98 98
 			}
99 99
 			// update status
100
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
101
-			do_action( 'AHEE__EE_Registration__set_status__after_update', $this );
100
+			parent::set('STS_ID', $new_STS_ID, $use_default);
101
+			do_action('AHEE__EE_Registration__set_status__after_update', $this);
102 102
 			return TRUE;
103
-		}else{
103
+		} else {
104 104
 			//even though the old value matches the new value, it's still good to
105 105
 			//allow the parent set method to have a say
106
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
106
+			parent::set('STS_ID', $new_STS_ID, $use_default);
107 107
 			return TRUE;
108 108
 		}
109 109
 		return FALSE;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @access        public
117 117
 	 */
118 118
 	public function status_ID() {
119
-		return $this->get( 'STS_ID' );
119
+		return $this->get('STS_ID');
120 120
 	}
121 121
 
122 122
 
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 		$ticket->increase_sold();
131 131
 		$ticket->save();
132 132
 		$datetimes = $ticket->datetimes();
133
-		if ( is_array( $datetimes ) ) {
134
-			foreach ( $datetimes as $datetime ) {
135
-				if ( $datetime instanceof EE_Datetime ) {
133
+		if (is_array($datetimes)) {
134
+			foreach ($datetimes as $datetime) {
135
+				if ($datetime instanceof EE_Datetime) {
136 136
 					$datetime->increase_sold();
137 137
 					$datetime->save();
138 138
 				}
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
 	 * @param boolean $include_archived whether to include archived tickets or not.
151 151
 	 * @return EE_Ticket
152 152
 	 */
153
-	public function ticket( $include_archived = TRUE ) {
153
+	public function ticket($include_archived = TRUE) {
154 154
 		$query_params = array();
155
-		if ( $include_archived ) {
156
-			$query_params[ 'default_where_conditions' ] = 'none';
155
+		if ($include_archived) {
156
+			$query_params['default_where_conditions'] = 'none';
157 157
 		}
158
-		return $this->get_first_related( 'Ticket', $query_params );
158
+		return $this->get_first_related('Ticket', $query_params);
159 159
 	}
160 160
 
161 161
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 * @return EE_Event
166 166
 	 */
167 167
 	public function event() {
168
-		return $this->get_first_related( 'Event' );
168
+		return $this->get_first_related('Event');
169 169
 	}
170 170
 
171 171
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 */
180 180
 	public function wp_user() {
181 181
 		$event = $this->event();
182
-		if ( $event instanceof EE_Event ) {
182
+		if ($event instanceof EE_Event) {
183 183
 			return $event->wp_user();
184 184
 		}
185 185
 		return 0;
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
 		$ticket->decrease_sold();
197 197
 		$ticket->save();
198 198
 		$datetimes = $ticket->datetimes();
199
-		if ( is_array( $datetimes ) ) {
200
-			foreach ( $datetimes as $datetime ) {
201
-				if ( $datetime instanceof EE_Datetime ) {
199
+		if (is_array($datetimes)) {
200
+			foreach ($datetimes as $datetime) {
201
+				if ($datetime instanceof EE_Datetime) {
202 202
 					$datetime->decrease_sold();
203 203
 					$datetime->save();
204 204
 				}
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 	 * @access        public
215 215
 	 * @param        int $ATT_ID Attendee ID
216 216
 	 */
217
-	public function set_attendee_id( $ATT_ID = 0 ) {
218
-		$this->set( 'ATT_ID', $ATT_ID );
217
+	public function set_attendee_id($ATT_ID = 0) {
218
+		$this->set('ATT_ID', $ATT_ID);
219 219
 	}
220 220
 
221 221
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	 * @access        public
227 227
 	 * @param        int $TXN_ID Transaction ID
228 228
 	 */
229
-	public function set_transaction_id( $TXN_ID = 0 ) {
230
-		$this->set( 'TXN_ID', $TXN_ID );
229
+	public function set_transaction_id($TXN_ID = 0) {
230
+		$this->set('TXN_ID', $TXN_ID);
231 231
 	}
232 232
 
233 233
 
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 	 * @access    public
239 239
 	 * @param    string $REG_session PHP Session ID
240 240
 	 */
241
-	public function set_session( $REG_session = '' ) {
242
-		$this->set( 'REG_session', $REG_session );
241
+	public function set_session($REG_session = '') {
242
+		$this->set('REG_session', $REG_session);
243 243
 	}
244 244
 
245 245
 
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
 	 * @access    public
251 251
 	 * @param    string $REG_url_link Registration URL Link
252 252
 	 */
253
-	public function set_reg_url_link( $REG_url_link = '' ) {
254
-		$this->set( 'REG_url_link', $REG_url_link );
253
+	public function set_reg_url_link($REG_url_link = '') {
254
+		$this->set('REG_url_link', $REG_url_link);
255 255
 	}
256 256
 
257 257
 
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
 	 * @access        public
263 263
 	 * @param        int $REG_count Primary Attendee
264 264
 	 */
265
-	public function set_count( $REG_count = 1 ) {
266
-		$this->set( 'REG_count', $REG_count );
265
+	public function set_count($REG_count = 1) {
266
+		$this->set('REG_count', $REG_count);
267 267
 	}
268 268
 
269 269
 
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 	 * @access        public
275 275
 	 * @param        boolean $REG_group_size Group Registration
276 276
 	 */
277
-	public function set_group_size( $REG_group_size = FALSE ) {
278
-		$this->set( 'REG_group_size', $REG_group_size );
277
+	public function set_group_size($REG_group_size = FALSE) {
278
+		$this->set('REG_group_size', $REG_group_size);
279 279
 	}
280 280
 
281 281
 
@@ -358,8 +358,8 @@  discard block
 block discarded – undo
358 358
 	 * @access        public
359 359
 	 * @param        mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date
360 360
 	 */
361
-	public function set_reg_date( $REG_date = FALSE ) {
362
-		$this->set( 'REG_date', $REG_date );
361
+	public function set_reg_date($REG_date = FALSE) {
362
+		$this->set('REG_date', $REG_date);
363 363
 	}
364 364
 
365 365
 
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
 	 * @access    public
371 371
 	 * @param    float $REG_final_price
372 372
 	 */
373
-	public function set_price_paid( $REG_final_price = 0.00 ) {
374
-		$this->set( 'REG_final_price', $REG_final_price );
373
+	public function set_price_paid($REG_final_price = 0.00) {
374
+		$this->set('REG_final_price', $REG_final_price);
375 375
 	}
376 376
 
377 377
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	 * @return string of price, with correct decimal places and currency symbol
381 381
 	 */
382 382
 	public function pretty_price_paid() {
383
-		return $this->get_pretty( 'REG_final_price' );
383
+		return $this->get_pretty('REG_final_price');
384 384
 	}
385 385
 
386 386
 
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
 	 * @access        public
392 392
 	 * @param        boolean $REG_att_is_going Attendee Is Going
393 393
 	 */
394
-	public function set_att_is_going( $REG_att_is_going = FALSE ) {
395
-		$this->set( 'REG_att_is_going', $REG_att_is_going );
394
+	public function set_att_is_going($REG_att_is_going = FALSE) {
395
+		$this->set('REG_att_is_going', $REG_att_is_going);
396 396
 	}
397 397
 
398 398
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 	 * @return EE_Attendee
403 403
 	 */
404 404
 	public function attendee() {
405
-		return $this->get_first_related( 'Attendee' );
405
+		return $this->get_first_related('Attendee');
406 406
 	}
407 407
 
408 408
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 * @access        public
413 413
 	 */
414 414
 	public function event_ID() {
415
-		return $this->get( 'EVT_ID' );
415
+		return $this->get('EVT_ID');
416 416
 	}
417 417
 
418 418
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 	 */
424 424
 	public function event_name() {
425 425
 		$event = $this->event_obj();
426
-		if ( $event ) {
426
+		if ($event) {
427 427
 			return $event->name();
428 428
 		} else {
429 429
 			return NULL;
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 	 * @return EE_Event
438 438
 	 */
439 439
 	public function event_obj() {
440
-		return $this->get_first_related( 'Event' );
440
+		return $this->get_first_related('Event');
441 441
 	}
442 442
 
443 443
 
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	 * @access        public
448 448
 	 */
449 449
 	public function attendee_ID() {
450
-		return $this->get( 'ATT_ID' );
450
+		return $this->get('ATT_ID');
451 451
 	}
452 452
 
453 453
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 	 * @access        public
458 458
 	 */
459 459
 	public function session_ID() {
460
-		return $this->get( 'REG_session' );
460
+		return $this->get('REG_session');
461 461
 	}
462 462
 
463 463
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
468 468
 	 * @return string
469 469
 	 */
470
-	public function receipt_url( $messenger = 'html' ) {
470
+	public function receipt_url($messenger = 'html') {
471 471
 
472 472
 		/**
473 473
 		 * The below will be deprecated one version after this.  We check first if there is a custom receipt template already in use on old system.  If there is then we just return the standard url for it.
@@ -476,12 +476,12 @@  discard block
 block discarded – undo
476 476
 		 */
477 477
 		EE_Registry::instance()->load_helper('Template');
478 478
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php';
479
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
479
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
480 480
 
481
-		if ( $has_custom ) {
482
-			return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) );
481
+		if ($has_custom) {
482
+			return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch'));
483 483
 		}
484
-		return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' );
484
+		return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt');
485 485
 	}
486 486
 
487 487
 
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
493 493
 	 * @return string
494 494
 	 */
495
-	public function invoice_url( $messenger = 'html' ) {
495
+	public function invoice_url($messenger = 'html') {
496 496
 		/**
497 497
 		 * The below will be deprecated one version after this.  We check first if there is a custom invoice template already in use on old system.  If there is then we just return the standard url for it.
498 498
 		 *
@@ -500,21 +500,21 @@  discard block
 block discarded – undo
500 500
 		 */
501 501
 		EE_Registry::instance()->load_helper('Template');
502 502
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php';
503
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
503
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
504 504
 
505
-		if ( $has_custom ) {
506
-			if ( $messenger == 'html' ) {
507
-				return $this->invoice_url( 'launch' );
505
+		if ($has_custom) {
506
+			if ($messenger == 'html') {
507
+				return $this->invoice_url('launch');
508 508
 			}
509 509
 			$route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice';
510 510
 
511
-			$query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() );
512
-			if ( $messenger == 'html' ) {
511
+			$query_args = array('ee' => $route, 'id' => $this->reg_url_link());
512
+			if ($messenger == 'html') {
513 513
 				$query_args['html'] = TRUE;
514 514
 			}
515
-			return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) );
515
+			return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id));
516 516
 		}
517
-		return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' );
517
+		return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice');
518 518
 	}
519 519
 
520 520
 
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	 * @access        public
525 525
 	 */
526 526
 	public function reg_url_link() {
527
-		return $this->get( 'REG_url_link' );
527
+		return $this->get('REG_url_link');
528 528
 	}
529 529
 
530 530
 
@@ -534,8 +534,8 @@  discard block
 block discarded – undo
534 534
 	 * @param string $type 'download','launch', or 'html' (default is 'launch')
535 535
 	 * @return void
536 536
 	 */
537
-	public function e_invoice_url( $type = 'launch' ) {
538
-		echo $this->invoice_url( $type );
537
+	public function e_invoice_url($type = 'launch') {
538
+		echo $this->invoice_url($type);
539 539
 	}
540 540
 
541 541
 
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 	 * @return string
556 556
 	 */
557 557
 	public function payment_overview_url() {
558
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), get_permalink( EE_Registry::instance()->CFG->core->reg_page_id ) );
558
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), get_permalink(EE_Registry::instance()->CFG->core->reg_page_id));
559 559
 	}
560 560
 
561 561
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 	 * @return string
567 567
 	 */
568 568
 	public function edit_attendee_information_url() {
569
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), get_permalink( EE_Registry::instance()->CFG->core->reg_page_id ) );
569
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), get_permalink(EE_Registry::instance()->CFG->core->reg_page_id));
570 570
 	}
571 571
 
572 572
 
@@ -576,8 +576,8 @@  discard block
 block discarded – undo
576 576
 	 * @return string
577 577
 	 */
578 578
 	public function get_admin_edit_url() {
579
-		EE_Registry::instance()->load_helper( 'URL' );
580
-		return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) );
579
+		EE_Registry::instance()->load_helper('URL');
580
+		return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php'));
581 581
 	}
582 582
 
583 583
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	 * @access        public
588 588
 	 */
589 589
 	public function is_primary_registrant() {
590
-		return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE;
590
+		return $this->get('REG_count') == 1 ? TRUE : FALSE;
591 591
 	}
592 592
 
593 593
 
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 	 * This returns the primary registration object for this registration group (which may be this object).
597 597
 	 * @return EE_Registration
598 598
 	 */
599
-	public function get_primary_registration()  {
600
-		if ( $this->is_primary_registrant() )
599
+	public function get_primary_registration() {
600
+		if ($this->is_primary_registrant())
601 601
 			return $this;
602 602
 
603 603
 		//k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1
604
-		$primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) );
604
+		$primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1)));
605 605
 		return $primary_registrant;
606 606
 	}
607 607
 
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 	* 		@access		public
613 613
 	*/
614 614
 	public function count() {
615
-		return $this->get( 'REG_count' );
615
+		return $this->get('REG_count');
616 616
 	}
617 617
 
618 618
 
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	 * @access        public
623 623
 	 */
624 624
 	public function group_size() {
625
-		return $this->get( 'REG_group_size' );
625
+		return $this->get('REG_group_size');
626 626
 	}
627 627
 
628 628
 
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 	 * @access        public
633 633
 	 */
634 634
 	public function date() {
635
-		return $this->get( 'REG_date' );
635
+		return $this->get('REG_date');
636 636
 	}
637 637
 
638 638
 
@@ -643,8 +643,8 @@  discard block
 block discarded – undo
643 643
 	 * @param string $time_format
644 644
 	 * @return string
645 645
 	 */
646
-	public function pretty_date( $date_format = NULL, $time_format = NULL ) {
647
-		return $this->get_datetime( 'REG_date', $date_format, $time_format );
646
+	public function pretty_date($date_format = NULL, $time_format = NULL) {
647
+		return $this->get_datetime('REG_date', $date_format, $time_format);
648 648
 	}
649 649
 
650 650
 
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 	 * @access        public
655 655
 	 */
656 656
 	public function price_paid() {
657
-		return $this->get( 'REG_final_price' );
657
+		return $this->get('REG_final_price');
658 658
 	}
659 659
 
660 660
 
@@ -664,8 +664,8 @@  discard block
 block discarded – undo
664 664
 	 * @param bool $show_icons
665 665
 	 * @return void
666 666
 	 */
667
-	public function e_pretty_status( $show_icons = FALSE ) {
668
-		echo $this->pretty_status( $show_icons );
667
+	public function e_pretty_status($show_icons = FALSE) {
668
+		echo $this->pretty_status($show_icons);
669 669
 	}
670 670
 
671 671
 
@@ -676,10 +676,10 @@  discard block
 block discarded – undo
676 676
 	 * @param bool $show_icons
677 677
 	 * @return string
678 678
 	 */
679
-	public function pretty_status( $show_icons = FALSE ) {
680
-		$status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' );
679
+	public function pretty_status($show_icons = FALSE) {
680
+		$status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence');
681 681
 		$icon = '';
682
-		switch ( $this->status_ID() ) {
682
+		switch ($this->status_ID()) {
683 683
 			case EEM_Registration::status_id_approved:
684 684
 				$icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : '';
685 685
 				break;
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 				$icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : '';
700 700
 				break;
701 701
 		}
702
-		return $icon . $status[ $this->status_ID() ];
702
+		return $icon.$status[$this->status_ID()];
703 703
 	}
704 704
 
705 705
 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 	 * @access        public
710 710
 	 */
711 711
 	public function att_is_going() {
712
-		return $this->get( 'REG_att_is_going' );
712
+		return $this->get('REG_att_is_going');
713 713
 	}
714 714
 
715 715
 
@@ -719,8 +719,8 @@  discard block
 block discarded – undo
719 719
 	 * @param array $query_params like EEM_Base::get_all
720 720
 	 * @return EE_Answer[]
721 721
 	 */
722
-	public function answers( $query_params = NULL ) {
723
-		return $this->get_many_related( 'Answer', $query_params );
722
+	public function answers($query_params = NULL) {
723
+		return $this->get_many_related('Answer', $query_params);
724 724
 	}
725 725
 
726 726
 
@@ -734,9 +734,9 @@  discard block
 block discarded – undo
734 734
 	 * (because the answer might be an array of answer values, so passing pretty_value=true
735 735
 	 * will convert it into some kind of string)
736 736
 	 */
737
-	public function answer_value_to_question( $question, $pretty_value=true ) {
737
+	public function answer_value_to_question($question, $pretty_value = true) {
738 738
 		$question_id = EEM_Question::instance()->ensure_is_ID($question);
739
-		return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value);
739
+		return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value);
740 740
 	}
741 741
 
742 742
 	/**
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
 	 * @return string
746 746
 	 */
747 747
 	public function reg_date() {
748
-		return $this->get_datetime( 'REG_date' );
748
+		return $this->get_datetime('REG_date');
749 749
 	}
750 750
 
751 751
 
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 	 * @return EE_Datetime_Ticket
758 758
 	 */
759 759
 	public function datetime_ticket() {
760
-		return $this->get_first_related( 'Datetime_Ticket' );
760
+		return $this->get_first_related('Datetime_Ticket');
761 761
 	}
762 762
 
763 763
 
@@ -767,15 +767,15 @@  discard block
 block discarded – undo
767 767
 	 * @param EE_Datetime_Ticket $datetime_ticket
768 768
 	 * @return EE_Datetime_Ticket
769 769
 	 */
770
-	public function set_datetime_ticket( $datetime_ticket ) {
771
-		return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' );
770
+	public function set_datetime_ticket($datetime_ticket) {
771
+		return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket');
772 772
 	}
773 773
 	/**
774 774
 	 * Gets deleted
775 775
 	 * @return boolean
776 776
 	 */
777 777
 	public function deleted() {
778
-		return $this->get( 'REG_deleted' );
778
+		return $this->get('REG_deleted');
779 779
 	}
780 780
 
781 781
 	/**
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 	 * @return boolean
785 785
 	 */
786 786
 	public function set_deleted($deleted) {
787
-		$this->set( 'REG_deleted', $deleted );
787
+		$this->set('REG_deleted', $deleted);
788 788
 	}
789 789
 
790 790
 
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 	 * @return EE_Status
795 795
 	 */
796 796
 	public function status_obj() {
797
-		return $this->get_first_related( 'Status' );
797
+		return $this->get_first_related('Status');
798 798
 	}
799 799
 
800 800
 
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 	 * @return int
806 806
 	 */
807 807
 	public function count_checkins() {
808
-		return $this->get_model()->count_related( $this, 'Checkin' );
808
+		return $this->get_model()->count_related($this, 'Checkin');
809 809
 	}
810 810
 
811 811
 
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 	 * @return int
816 816
 	 */
817 817
 	public function count_checkins_not_checkedout() {
818
-		return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) );
818
+		return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1)));
819 819
 	}
820 820
 
821 821
 
@@ -828,15 +828,15 @@  discard block
 block discarded – undo
828 828
 	 *
829 829
 	 * @return bool
830 830
 	 */
831
-	public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) {
832
-		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID );
831
+	public function can_checkin($DTT_OR_ID, $check_approved = TRUE) {
832
+		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID);
833 833
 
834 834
 		//first check registration status
835
-		if (  $check_approved && ! $this->is_approved() ) {
835
+		if ($check_approved && ! $this->is_approved()) {
836 836
 			return false;
837 837
 		}
838 838
 		//is there a datetime ticket that matches this dtt_ID?
839
-		return EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) );
839
+		return EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID)));
840 840
 	}
841 841
 
842 842
 
@@ -852,25 +852,25 @@  discard block
 block discarded – undo
852 852
 	 * @param  bool $verify  If true then can_checkin() is used to verify whether the person can be checked in or not.  Otherwise this forces change in checkin status.
853 853
 	 * @return int|BOOL            the chk_in status toggled to OR false if nothing got changed.
854 854
 	 */
855
-	public function toggle_checkin_status( $DTT_ID = NULL, $verify = FALSE ) {
856
-		if ( empty( $DTT_ID ) ) {
855
+	public function toggle_checkin_status($DTT_ID = NULL, $verify = FALSE) {
856
+		if (empty($DTT_ID)) {
857 857
 			$datetime = $this->get_related_primary_datetime();
858 858
 			$DTT_ID = $datetime->ID();
859 859
 		//verify the registration can checkin for the given DTT_ID
860
-		} elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) {
861
-			EE_Error::add_error( sprintf( __( 'The given registration (ID:%d) can not be checked in to the given DTT_ID (%d), because the registration does not have access', 'event_espresso'), $this->ID(), $DTT_ID ), __FILE__, __FUNCTION__, __LINE__ );
860
+		} elseif ( ! $this->can_checkin($DTT_ID, $verify)) {
861
+			EE_Error::add_error(sprintf(__('The given registration (ID:%d) can not be checked in to the given DTT_ID (%d), because the registration does not have access', 'event_espresso'), $this->ID(), $DTT_ID), __FILE__, __FUNCTION__, __LINE__);
862 862
 			return FALSE;
863 863
 		}
864
-		$status_paths = array( 0 => 1, 1 => 2, 2 => 1 );
864
+		$status_paths = array(0 => 1, 1 => 2, 2 => 1);
865 865
 		//start by getting the current status so we know what status we'll be changing to.
866
-		$cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL );
867
-		$status_to = $status_paths[ $cur_status ];
866
+		$cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL);
867
+		$status_to = $status_paths[$cur_status];
868 868
 		//add relation - note Check-ins are always creating new rows because we are keeping track of Check-ins over time.  Eventually we'll probably want to show a list table for the individual Check-ins so that can be managed.
869 869
 		$new_status = $status_to == 2 ? 0 : $status_to;
870
-		$chk_data = array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID, 'CHK_in' => $new_status );
871
-		$checkin = EE_Checkin::new_instance( $chk_data );
870
+		$chk_data = array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID, 'CHK_in' => $new_status);
871
+		$checkin = EE_Checkin::new_instance($chk_data);
872 872
 		$updated = $checkin->save();
873
-		if ( $updated === 0 ) {
873
+		if ($updated === 0) {
874 874
 			$status_to = FALSE;
875 875
 		}
876 876
 		return $status_to;
@@ -894,22 +894,22 @@  discard block
 block discarded – undo
894 894
 	 * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id.
895 895
 	 * @return int            Integer representing Check-in status.
896 896
 	 */
897
-	public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) {
898
-		if ( empty( $DTT_ID ) && ! $checkin instanceof EE_Checkin ) {
897
+	public function check_in_status_for_datetime($DTT_ID = 0, $checkin = NULL) {
898
+		if (empty($DTT_ID) && ! $checkin instanceof EE_Checkin) {
899 899
 			$datetime = $this->get_related_primary_datetime();
900
-			if ( ! $datetime instanceof EE_Datetime ) {
900
+			if ( ! $datetime instanceof EE_Datetime) {
901 901
 				return 0;
902 902
 			}
903 903
 			$DTT_ID = $datetime->ID();
904 904
 		//verify the registration can checkin for the given DTT_ID
905
-		} elseif ( ! $checkin instanceof EE_Checkin && ! $this->can_checkin( $DTT_ID, false ) ) {
906
-			EE_Error::add_error( sprintf( __( 'The checkin status for the given registration (ID:%d) and DTT_ID (%d) cannot be retrieved because the registration does not have access to that date and time.  So there is no status for this registration.', 'event_espresso'), $this->ID(), $DTT_ID ) );
905
+		} elseif ( ! $checkin instanceof EE_Checkin && ! $this->can_checkin($DTT_ID, false)) {
906
+			EE_Error::add_error(sprintf(__('The checkin status for the given registration (ID:%d) and DTT_ID (%d) cannot be retrieved because the registration does not have access to that date and time.  So there is no status for this registration.', 'event_espresso'), $this->ID(), $DTT_ID));
907 907
 			return false;
908 908
 		}
909 909
 		//get checkin object (if exists)
910
-		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ), 'order_by' => array( 'CHK_timestamp' => 'DESC' ) ) );
911
-		if ( $checkin instanceof EE_Checkin ) {
912
-			if ( $checkin->get( 'CHK_in' ) ) {
910
+		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related('Checkin', array(array('DTT_ID' => $DTT_ID), 'order_by' => array('CHK_timestamp' => 'DESC')));
911
+		if ($checkin instanceof EE_Checkin) {
912
+			if ($checkin->get('CHK_in')) {
913 913
 				return 1; //checked in
914 914
 			} else {
915 915
 				return 2; //had checked in but is now checked out.
@@ -927,28 +927,28 @@  discard block
 block discarded – undo
927 927
 	 * @param bool $error  This just flags that you want an error message returned. This is put in so that the error message can be customized with the attendee name.
928 928
 	 * @return string         internationalized message
929 929
 	 */
930
-	public function get_checkin_msg( $DTT_ID, $error = FALSE ) {
930
+	public function get_checkin_msg($DTT_ID, $error = FALSE) {
931 931
 		//let's get the attendee first so we can include the name of the attendee
932
-		$attendee = $this->get_first_related( 'Attendee' );
933
-		if ( $attendee instanceof EE_Attendee ) {
934
-			if ( $error ) {
935
-				return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() );
932
+		$attendee = $this->get_first_related('Attendee');
933
+		if ($attendee instanceof EE_Attendee) {
934
+			if ($error) {
935
+				return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name());
936 936
 			}
937
-			$cur_status = $this->check_in_status_for_datetime( $DTT_ID );
937
+			$cur_status = $this->check_in_status_for_datetime($DTT_ID);
938 938
 			//what is the status message going to be?
939
-			switch ( $cur_status ) {
939
+			switch ($cur_status) {
940 940
 				case 0 :
941
-					return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() );
941
+					return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name());
942 942
 					break;
943 943
 				case 1 :
944
-					return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() );
944
+					return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name());
945 945
 					break;
946 946
 				case 2 :
947
-					return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() );
947
+					return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name());
948 948
 					break;
949 949
 			}
950 950
 		}
951
-		return __( "The check-in status could not be determined.", "event_espresso" );
951
+		return __("The check-in status could not be determined.", "event_espresso");
952 952
 	}
953 953
 
954 954
 
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
 	 * @return EE_Transaction
959 959
 	 */
960 960
 	public function transaction() {
961
-		return $this->get_first_related( 'Transaction' );
961
+		return $this->get_first_related('Transaction');
962 962
 	}
963 963
 
964 964
 
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 	 * @access        public
970 970
 	 */
971 971
 	public function reg_code() {
972
-		return $this->get( 'REG_code' );
972
+		return $this->get('REG_code');
973 973
 	}
974 974
 
975 975
 
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 	 * @access        public
980 980
 	 */
981 981
 	public function transaction_ID() {
982
-		return $this->get( 'TXN_ID' );
982
+		return $this->get('TXN_ID');
983 983
 	}
984 984
 
985 985
 
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 	 * @return int
989 989
 	 */
990 990
 	public function ticket_ID() {
991
-		return $this->get( 'TKT_ID' );
991
+		return $this->get('TKT_ID');
992 992
 	}
993 993
 
994 994
 
@@ -1000,17 +1000,17 @@  discard block
 block discarded – undo
1000 1000
 	 * @param    string $REG_code Registration Code
1001 1001
 	 * @param	boolean $use_default
1002 1002
 	 */
1003
-	public function set_reg_code( $REG_code, $use_default = FALSE ) {
1004
-		if ( empty( $REG_code )) {
1005
-			EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1003
+	public function set_reg_code($REG_code, $use_default = FALSE) {
1004
+		if (empty($REG_code)) {
1005
+			EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1006 1006
 			return;
1007 1007
 		}
1008
-		if ( ! $this->reg_code() ) {
1009
-			parent::set( 'REG_code', $REG_code, $use_default );
1008
+		if ( ! $this->reg_code()) {
1009
+			parent::set('REG_code', $REG_code, $use_default);
1010 1010
 		} else {
1011 1011
 			EE_Error::doing_it_wrong(
1012
-				__CLASS__ . '::' . __FUNCTION__,
1013
-				__( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ),
1012
+				__CLASS__.'::'.__FUNCTION__,
1013
+				__('Can not change a registration REG_code once it has been set.', 'event_espresso'),
1014 1014
 				'4.6.0'
1015 1015
 			);
1016 1016
 		}
@@ -1027,17 +1027,17 @@  discard block
 block discarded – undo
1027 1027
 	 * @return EE_Registration[]  or empty array if this isn't a group registration.
1028 1028
 	 */
1029 1029
 	public function get_all_other_registrations_in_group() {
1030
-		if ( $this->group_size() < 2 ) {
1030
+		if ($this->group_size() < 2) {
1031 1031
 			return array();
1032 1032
 		}
1033 1033
 
1034 1034
 		$query[0] = array(
1035 1035
 			'TXN_ID' => $this->transaction_ID(),
1036
-			'REG_ID' => array( '!=', $this->ID() ),
1036
+			'REG_ID' => array('!=', $this->ID()),
1037 1037
 			'TKT_ID' => $this->ticket_ID()
1038 1038
 			);
1039 1039
 
1040
-		$registrations = $this->get_model()->get_all( $query );
1040
+		$registrations = $this->get_model()->get_all($query);
1041 1041
 		return $registrations;
1042 1042
 	}
1043 1043
 }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -618,9 +618,9 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
core/db_classes/EE_Soft_Delete_Base_Class.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
core/db_classes/EE_Status.class.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.