@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | * @param bool $bydb |
35 | 35 | * @param string $timezone |
36 | 36 | */ |
37 | - protected function __construct( $fieldValues = array(), $bydb = FALSE, $timezone = '' ) { |
|
38 | - if ( ! isset( $fieldValues[ 'slug' ] ) ) { |
|
39 | - $fieldValues[ 'slug' ] = $fieldValues[ 'name' ]; |
|
37 | + protected function __construct($fieldValues = array(), $bydb = FALSE, $timezone = '') { |
|
38 | + if ( ! isset($fieldValues['slug'])) { |
|
39 | + $fieldValues['slug'] = $fieldValues['name']; |
|
40 | 40 | } |
41 | - parent::__construct( $fieldValues, $bydb, $timezone ); |
|
41 | + parent::__construct($fieldValues, $bydb, $timezone); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * @param array $props_n_values |
48 | 48 | * @return EE_Term|mixed |
49 | 49 | */ |
50 | - public static function new_instance( $props_n_values = array() ) { |
|
51 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
52 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
50 | + public static function new_instance($props_n_values = array()) { |
|
51 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
52 | + return $has_object ? $has_object : new self($props_n_values); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | * @param array $props_n_values |
59 | 59 | * @return EE_Term |
60 | 60 | */ |
61 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
62 | - return new self( $props_n_values, TRUE ); |
|
61 | + public static function new_instance_from_db($props_n_values = array()) { |
|
62 | + return new self($props_n_values, TRUE); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @return string |
70 | 70 | */ |
71 | 71 | function name() { |
72 | - return $this->get( 'name' ); |
|
72 | + return $this->get('name'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | * @param string $name |
80 | 80 | * @return boolean |
81 | 81 | */ |
82 | - function set_name( $name ) { |
|
83 | - $this->set( 'name', $name ); |
|
82 | + function set_name($name) { |
|
83 | + $this->set('name', $name); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @return string |
91 | 91 | */ |
92 | 92 | function slug() { |
93 | - return $this->get( 'slug' ); |
|
93 | + return $this->get('slug'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | * @param string $slug |
101 | 101 | * @return boolean |
102 | 102 | */ |
103 | - function set_slug( $slug ) { |
|
104 | - $this->set( 'slug', $slug ); |
|
103 | + function set_slug($slug) { |
|
104 | + $this->set('slug', $slug); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | * @param array $props_n_values |
31 | 31 | * @return EE_Term_Relationship |
32 | 32 | */ |
33 | - public static function new_instance( $props_n_values = array() ) { |
|
34 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
35 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
33 | + public static function new_instance($props_n_values = array()) { |
|
34 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
35 | + return $has_object ? $has_object : new self($props_n_values); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * @param array $props_n_values |
42 | 42 | * @return EE_Term_Relationship |
43 | 43 | */ |
44 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
45 | - return new self( $props_n_values, TRUE ); |
|
44 | + public static function new_instance_from_db($props_n_values = array()) { |
|
45 | + return new self($props_n_values, TRUE); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param array $props_n_values |
33 | 33 | * @return EE_Term_Taxonomy |
34 | 34 | */ |
35 | - public static function new_instance( $props_n_values = array() ) { |
|
36 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
37 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
35 | + public static function new_instance($props_n_values = array()) { |
|
36 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
37 | + return $has_object ? $has_object : new self($props_n_values); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * @param array $props_n_values |
44 | 44 | * @return EE_Term_Taxonomy |
45 | 45 | */ |
46 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
47 | - return new self( $props_n_values, TRUE ); |
|
46 | + public static function new_instance_from_db($props_n_values = array()) { |
|
47 | + return new self($props_n_values, TRUE); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return string |
55 | 55 | */ |
56 | 56 | function taxonomy() { |
57 | - return $this->get( 'taxonomy' ); |
|
57 | + return $this->get('taxonomy'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | * @param string $taxonomy |
65 | 65 | * @return boolean |
66 | 66 | */ |
67 | - function set_taxonomy( $taxonomy ) { |
|
68 | - $this->set( 'taxonomy', $taxonomy ); |
|
67 | + function set_taxonomy($taxonomy) { |
|
68 | + $this->set('taxonomy', $taxonomy); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @return int |
76 | 76 | */ |
77 | 77 | function count() { |
78 | - return $this->get( 'term_count' ); |
|
78 | + return $this->get('term_count'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * @param int $term_count |
86 | 86 | * @return boolean |
87 | 87 | */ |
88 | - function set_count( $term_count ) { |
|
89 | - $this->set( 'term_count', $term_count ); |
|
88 | + function set_count($term_count) { |
|
89 | + $this->set('term_count', $term_count); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return EE_Term |
97 | 97 | */ |
98 | 98 | function term() { |
99 | - return $this->get_first_related( 'Term' ); |
|
99 | + return $this->get_first_related('Term'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @param string $timezone |
36 | 36 | * @return EE_Ticket_Price|mixed |
37 | 37 | */ |
38 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
39 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
40 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
38 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
39 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
40 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @param string $timezone |
48 | 48 | * @return EE_Ticket_Price |
49 | 49 | */ |
50 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
51 | - return new self( $props_n_values, TRUE, $timezone ); |
|
50 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
51 | + return new self($props_n_values, TRUE, $timezone); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @param string $timezone |
36 | 36 | * @return EE_Ticket_Template|mixed |
37 | 37 | */ |
38 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
39 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
40 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
38 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
39 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
40 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @param string $timezone |
48 | 48 | * @return EE_Ticket_Template |
49 | 49 | */ |
50 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
51 | - return new self( $props_n_values, TRUE, $timezone ); |
|
50 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
51 | + return new self($props_n_values, TRUE, $timezone); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |
@@ -742,11 +742,11 @@ |
||
742 | 742 | $pm = $this->get_first_related('Payment_Method'); |
743 | 743 | if( $pm instanceof EE_Payment_Method ){ |
744 | 744 | return $pm; |
745 | - }else{ |
|
745 | + } else{ |
|
746 | 746 | $last_payment = $this->last_payment(); |
747 | 747 | if( $last_payment instanceof EE_Payment && $last_payment->payment_method() ){ |
748 | 748 | return $last_payment->payment_method(); |
749 | - }else{ |
|
749 | + } else{ |
|
750 | 750 | return NULL; |
751 | 751 | } |
752 | 752 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @subpackage includes/classes/EE_Transaction.class.php |
27 | 27 | * @author Brent Christensen |
28 | 28 | */ |
29 | -class EE_Transaction extends EE_Base_Class implements EEI_Transaction{ |
|
29 | +class EE_Transaction extends EE_Base_Class implements EEI_Transaction { |
|
30 | 30 | |
31 | 31 | |
32 | 32 | /** |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @param string $timezone |
36 | 36 | * @return EE_Transaction |
37 | 37 | */ |
38 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
39 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
40 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
38 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
39 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
40 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | * @param string $timezone |
49 | 49 | * @return EE_Transaction |
50 | 50 | */ |
51 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
52 | - return new self( $props_n_values, TRUE, $timezone ); |
|
51 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
52 | + return new self($props_n_values, TRUE, $timezone); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | * @return void |
65 | 65 | */ |
66 | 66 | public function lock() { |
67 | - $locked_transactions = get_option( 'ee_locked_transactions', array() ); |
|
68 | - $locked_transactions[ $this->ID() ] = true; |
|
69 | - update_option( 'ee_locked_transactions', $locked_transactions ); |
|
67 | + $locked_transactions = get_option('ee_locked_transactions', array()); |
|
68 | + $locked_transactions[$this->ID()] = true; |
|
69 | + update_option('ee_locked_transactions', $locked_transactions); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | * @return void |
81 | 81 | */ |
82 | 82 | public function unlock() { |
83 | - $locked_transactions = get_option( 'ee_locked_transactions', array() ); |
|
84 | - unset( $locked_transactions[ $this->ID() ] ); |
|
85 | - update_option( 'ee_locked_transactions', $locked_transactions ); |
|
83 | + $locked_transactions = get_option('ee_locked_transactions', array()); |
|
84 | + unset($locked_transactions[$this->ID()]); |
|
85 | + update_option('ee_locked_transactions', $locked_transactions); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | * @return boolean |
100 | 100 | */ |
101 | 101 | public function is_locked() { |
102 | - $locked_transactions = get_option( 'ee_locked_transactions', array() ); |
|
103 | - return isset( $locked_transactions[ $this->ID() ] ) ? true : false; |
|
102 | + $locked_transactions = get_option('ee_locked_transactions', array()); |
|
103 | + return isset($locked_transactions[$this->ID()]) ? true : false; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * @access public |
112 | 112 | * @param float $total total value of transaction |
113 | 113 | */ |
114 | - public function set_total( $total = 0.00 ) { |
|
115 | - $this->set( 'TXN_total', $total ); |
|
114 | + public function set_total($total = 0.00) { |
|
115 | + $this->set('TXN_total', $total); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | * @access public |
124 | 124 | * @param float $total_paid total amount paid to date (sum of all payments) |
125 | 125 | */ |
126 | - public function set_paid( $total_paid = 0.00 ) { |
|
127 | - $this->set( 'TXN_paid', $total_paid ); |
|
126 | + public function set_paid($total_paid = 0.00) { |
|
127 | + $this->set('TXN_paid', $total_paid); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | * @access public |
136 | 136 | * @param string $status whether the transaction is open, declined, accepted, or any number of custom values that can be set |
137 | 137 | */ |
138 | - public function set_status( $status = '' ) { |
|
139 | - $this->set( 'STS_ID', $status ); |
|
138 | + public function set_status($status = '') { |
|
139 | + $this->set('STS_ID', $status); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | * @access public |
148 | 148 | * @param string $hash_salt required for some payment gateways |
149 | 149 | */ |
150 | - public function set_hash_salt( $hash_salt = '' ) { |
|
151 | - $this->set( 'TXN_hash_salt', $hash_salt ); |
|
150 | + public function set_hash_salt($hash_salt = '') { |
|
151 | + $this->set('TXN_hash_salt', $hash_salt); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | * Sets TXN_reg_steps array |
158 | 158 | * @param array $txn_reg_steps |
159 | 159 | */ |
160 | - function set_reg_steps( $txn_reg_steps ) { |
|
161 | - $this->set( 'TXN_reg_steps', $txn_reg_steps ); |
|
160 | + function set_reg_steps($txn_reg_steps) { |
|
161 | + $this->set('TXN_reg_steps', $txn_reg_steps); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | * @return EE_SPCO_Reg_Step[] |
169 | 169 | */ |
170 | 170 | function reg_steps() { |
171 | - $TXN_reg_steps = $this->get( 'TXN_reg_steps' ); |
|
172 | - return is_array( $TXN_reg_steps ) ? $TXN_reg_steps : array(); |
|
171 | + $TXN_reg_steps = $this->get('TXN_reg_steps'); |
|
172 | + return is_array($TXN_reg_steps) ? $TXN_reg_steps : array(); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @return string of transaction's total cost, with currency symbol and decimal |
180 | 180 | */ |
181 | 181 | public function pretty_total() { |
182 | - return $this->get_pretty( 'TXN_total' ); |
|
182 | + return $this->get_pretty('TXN_total'); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @return string |
190 | 190 | */ |
191 | 191 | public function pretty_paid() { |
192 | - return $this->get_pretty( 'TXN_paid' ); |
|
192 | + return $this->get_pretty('TXN_paid'); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @return float amount remaining |
202 | 202 | */ |
203 | 203 | public function remaining() { |
204 | - return (float)( $this->total() - $this->paid() ); |
|
204 | + return (float) ($this->total() - $this->paid()); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @return float |
213 | 213 | */ |
214 | 214 | public function total() { |
215 | - return $this->get( 'TXN_total' ); |
|
215 | + return $this->get('TXN_total'); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | * @return float |
224 | 224 | */ |
225 | 225 | public function paid() { |
226 | - return $this->get( 'TXN_paid' ); |
|
226 | + return $this->get('TXN_paid'); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | * @access public |
234 | 234 | */ |
235 | 235 | public function get_cart_session() { |
236 | - $session_data = $this->get( 'TXN_session_data' ); |
|
237 | - return isset( $session_data[ 'cart' ] ) && $session_data[ 'cart' ] instanceof EE_Cart ? $session_data[ 'cart' ] : NULL; |
|
236 | + $session_data = $this->get('TXN_session_data'); |
|
237 | + return isset($session_data['cart']) && $session_data['cart'] instanceof EE_Cart ? $session_data['cart'] : NULL; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | |
@@ -244,9 +244,9 @@ discard block |
||
244 | 244 | * @access public |
245 | 245 | */ |
246 | 246 | public function session_data() { |
247 | - $session_data = $this->get( 'TXN_session_data' ); |
|
248 | - if ( empty( $session_data ) ) { |
|
249 | - $session_data = array( 'id' => NULL, 'user_id' => NULL, 'ip_address' => NULL, 'user_agent' => NULL, 'init_access' => NULL, 'last_access' => NULL, 'pages_visited' => array() ); |
|
247 | + $session_data = $this->get('TXN_session_data'); |
|
248 | + if (empty($session_data)) { |
|
249 | + $session_data = array('id' => NULL, 'user_id' => NULL, 'ip_address' => NULL, 'user_agent' => NULL, 'init_access' => NULL, 'last_access' => NULL, 'pages_visited' => array()); |
|
250 | 250 | } |
251 | 251 | return $session_data; |
252 | 252 | } |
@@ -259,11 +259,11 @@ discard block |
||
259 | 259 | * @access public |
260 | 260 | * @param EE_Session|array $session_data |
261 | 261 | */ |
262 | - public function set_txn_session_data( $session_data ) { |
|
263 | - if ( $session_data instanceof EE_Session ) { |
|
264 | - $this->set( 'TXN_session_data', $session_data->get_session_data( NULL, TRUE )); |
|
262 | + public function set_txn_session_data($session_data) { |
|
263 | + if ($session_data instanceof EE_Session) { |
|
264 | + $this->set('TXN_session_data', $session_data->get_session_data(NULL, TRUE)); |
|
265 | 265 | } else { |
266 | - $this->set( 'TXN_session_data', $session_data ); |
|
266 | + $this->set('TXN_session_data', $session_data); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * @access public |
275 | 275 | */ |
276 | 276 | public function hash_salt_() { |
277 | - return $this->get( 'TXN_hash_salt' ); |
|
277 | + return $this->get('TXN_hash_salt'); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | |
@@ -293,13 +293,13 @@ discard block |
||
293 | 293 | * @param boolean $gmt - whether to return a unix timestamp with UTC offset applied (default) or no UTC offset applied |
294 | 294 | * @return string | int |
295 | 295 | */ |
296 | - public function datetime( $format = FALSE, $gmt = FALSE ) { |
|
297 | - if ( $format ) { |
|
298 | - return $this->get_pretty( 'TXN_timestamp' ); |
|
299 | - } else if ( $gmt ) { |
|
300 | - return $this->get_raw( 'TXN_timestamp' ); |
|
296 | + public function datetime($format = FALSE, $gmt = FALSE) { |
|
297 | + if ($format) { |
|
298 | + return $this->get_pretty('TXN_timestamp'); |
|
299 | + } else if ($gmt) { |
|
300 | + return $this->get_raw('TXN_timestamp'); |
|
301 | 301 | } else { |
302 | - return $this->get( 'TXN_timestamp' ); |
|
302 | + return $this->get('TXN_timestamp'); |
|
303 | 303 | } |
304 | 304 | } |
305 | 305 | |
@@ -311,10 +311,10 @@ discard block |
||
311 | 311 | * @param boolean $get_cached TRUE to retrieve cached registrations or FALSE to pull from the db |
312 | 312 | * @return EE_Registration[] |
313 | 313 | */ |
314 | - public function registrations( $query_params = array(), $get_cached = FALSE ) { |
|
315 | - $query_params = ( empty( $query_params ) || ! is_array( $query_params ) ) ? array( 'order_by' => array( 'Event.EVT_name' => 'ASC', 'Attendee.ATT_lname' => 'ASC', 'Attendee.ATT_fname' => 'ASC' ) ) : $query_params; |
|
314 | + public function registrations($query_params = array(), $get_cached = FALSE) { |
|
315 | + $query_params = (empty($query_params) || ! is_array($query_params)) ? array('order_by' => array('Event.EVT_name' => 'ASC', 'Attendee.ATT_lname' => 'ASC', 'Attendee.ATT_fname' => 'ASC')) : $query_params; |
|
316 | 316 | $query_params = $get_cached ? array() : $query_params; |
317 | - return $this->get_many_related( 'Registration', $query_params ); |
|
317 | + return $this->get_many_related('Registration', $query_params); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | * @return mixed EE_Attendee[] by default, int if $output is set to 'COUNT' |
326 | 326 | */ |
327 | 327 | public function attendees() { |
328 | - return $this->get_many_related( 'Attendee', array( array( 'Registration.Transaction.TXN_ID' => $this->ID() ) ) ); |
|
328 | + return $this->get_many_related('Attendee', array(array('Registration.Transaction.TXN_ID' => $this->ID()))); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | * @param array $query_params like EEM_Base::get_all |
336 | 336 | * @return EE_Payment[] |
337 | 337 | */ |
338 | - public function payments( $query_params = array() ) { |
|
339 | - return $this->get_many_related( 'Payment', $query_params ); |
|
338 | + public function payments($query_params = array()) { |
|
339 | + return $this->get_many_related('Payment', $query_params); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | |
@@ -346,8 +346,8 @@ discard block |
||
346 | 346 | * @return EE_Payment[] |
347 | 347 | */ |
348 | 348 | public function approved_payments() { |
349 | - EE_Registry::instance()->load_model( 'Payment' ); |
|
350 | - return $this->get_many_related( 'Payment', array( array( 'STS_ID' => EEM_Payment::status_id_approved ), 'order_by' => array( 'PAY_timestamp' => 'DESC' ) ) ); |
|
349 | + EE_Registry::instance()->load_model('Payment'); |
|
350 | + return $this->get_many_related('Payment', array(array('STS_ID' => EEM_Payment::status_id_approved), 'order_by' => array('PAY_timestamp' => 'DESC'))); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | |
@@ -357,8 +357,8 @@ discard block |
||
357 | 357 | * @param bool $show_icons |
358 | 358 | * @return string |
359 | 359 | */ |
360 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
361 | - echo $this->pretty_status( $show_icons ); |
|
360 | + public function e_pretty_status($show_icons = FALSE) { |
|
361 | + echo $this->pretty_status($show_icons); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | |
@@ -368,10 +368,10 @@ discard block |
||
368 | 368 | * @param bool $show_icons |
369 | 369 | * @return string |
370 | 370 | */ |
371 | - public function pretty_status( $show_icons = FALSE ) { |
|
372 | - $status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
371 | + public function pretty_status($show_icons = FALSE) { |
|
372 | + $status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
373 | 373 | $icon = ''; |
374 | - switch ( $this->status_ID() ) { |
|
374 | + switch ($this->status_ID()) { |
|
375 | 375 | case EEM_Transaction::complete_status_code: |
376 | 376 | $icon = $show_icons ? '<span class="dashicons dashicons-yes ee-icon-size-24 green-text"></span>' : ''; |
377 | 377 | break; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $icon = $show_icons ? '<span class="dashicons dashicons-plus ee-icon-size-16 orange-text"></span>' : ''; |
389 | 389 | break; |
390 | 390 | } |
391 | - return $icon . $status[ $this->status_ID() ]; |
|
391 | + return $icon.$status[$this->status_ID()]; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | * @access public |
399 | 399 | */ |
400 | 400 | public function status_ID() { |
401 | - return $this->get( 'STS_ID' ); |
|
401 | + return $this->get('STS_ID'); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | * @return boolean |
409 | 409 | */ |
410 | 410 | public function is_free() { |
411 | - return (float)$this->get( 'TXN_total' ) == 0 ? TRUE : FALSE; |
|
411 | + return (float) $this->get('TXN_total') == 0 ? TRUE : FALSE; |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | * @access public |
477 | 477 | * @return string |
478 | 478 | */ |
479 | - public function invoice_url( $type = 'html' ) { |
|
479 | + public function invoice_url($type = 'html') { |
|
480 | 480 | $REG = $this->primary_registration(); |
481 | - if ( ! $REG instanceof EE_Registration ) { |
|
481 | + if ( ! $REG instanceof EE_Registration) { |
|
482 | 482 | return ''; |
483 | 483 | } |
484 | - return $REG->invoice_url( $type ); |
|
484 | + return $REG->invoice_url($type); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | * @return EE_Registration |
492 | 492 | */ |
493 | 493 | public function primary_registration() { |
494 | - return $this->get_first_related( 'Registration', array( array( 'REG_count' => EEM_Registration::PRIMARY_REGISTRANT_COUNT ) ) ); |
|
494 | + return $this->get_first_related('Registration', array(array('REG_count' => EEM_Registration::PRIMARY_REGISTRANT_COUNT))); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | |
@@ -501,12 +501,12 @@ discard block |
||
501 | 501 | * @param string $type 'pdf' or 'html' (default is 'html') |
502 | 502 | * @return string |
503 | 503 | */ |
504 | - public function receipt_url( $type = 'html' ) { |
|
504 | + public function receipt_url($type = 'html') { |
|
505 | 505 | $REG = $this->primary_registration(); |
506 | - if ( ! $REG instanceof EE_Registration ) { |
|
506 | + if ( ! $REG instanceof EE_Registration) { |
|
507 | 507 | return ''; |
508 | 508 | } |
509 | - return $REG->receipt_url( $type ); |
|
509 | + return $REG->receipt_url($type); |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | |
@@ -531,15 +531,15 @@ discard block |
||
531 | 531 | * @deprecated |
532 | 532 | * @return boolean |
533 | 533 | */ |
534 | - public function update_based_on_payments(){ |
|
534 | + public function update_based_on_payments() { |
|
535 | 535 | EE_Error::doing_it_wrong( |
536 | - __CLASS__ . '::' . __FUNCTION__, |
|
537 | - sprintf( __( 'This method is deprecated. Please use "%s" instead', 'event_espresso' ), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()' ), |
|
536 | + __CLASS__.'::'.__FUNCTION__, |
|
537 | + sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()'), |
|
538 | 538 | '4.6.0' |
539 | 539 | ); |
540 | 540 | /** @type EE_Transaction_Processor $transaction_processor */ |
541 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
542 | - return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment( $this ); |
|
541 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
542 | + return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment($this); |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | * @return string |
549 | 549 | */ |
550 | 550 | public function gateway_response_on_transaction() { |
551 | - $payment = $this->get_first_related( 'Payment' ); |
|
551 | + $payment = $this->get_first_related('Payment'); |
|
552 | 552 | return $payment instanceof EE_Payment ? $payment->gateway_response() : ''; |
553 | 553 | } |
554 | 554 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | * @return EE_Status |
560 | 560 | */ |
561 | 561 | public function status_obj() { |
562 | - return $this->get_first_related( 'Status' ); |
|
562 | + return $this->get_first_related('Status'); |
|
563 | 563 | } |
564 | 564 | |
565 | 565 | |
@@ -569,8 +569,8 @@ discard block |
||
569 | 569 | * @param array $query_params like EEM_Base::get_all |
570 | 570 | * @return EE_Extra_Meta |
571 | 571 | */ |
572 | - public function extra_meta( $query_params = array() ) { |
|
573 | - return $this->get_many_related( 'Extra_Meta', $query_params ); |
|
572 | + public function extra_meta($query_params = array()) { |
|
573 | + return $this->get_many_related('Extra_Meta', $query_params); |
|
574 | 574 | } |
575 | 575 | |
576 | 576 | |
@@ -580,8 +580,8 @@ discard block |
||
580 | 580 | * @param EE_Registration $registration |
581 | 581 | * @return EE_Base_Class the relation was added to |
582 | 582 | */ |
583 | - public function add_registration( EE_Registration $registration ) { |
|
584 | - return $this->_add_relation_to( $registration, 'Registration' ); |
|
583 | + public function add_registration(EE_Registration $registration) { |
|
584 | + return $this->_add_relation_to($registration, 'Registration'); |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | * @param int $registration_or_id |
593 | 593 | * @return EE_Base_Class that was removed from being related |
594 | 594 | */ |
595 | - public function remove_registration_with_id( $registration_or_id ) { |
|
596 | - return $this->_remove_relation_to( $registration_or_id, 'Registration' ); |
|
595 | + public function remove_registration_with_id($registration_or_id) { |
|
596 | + return $this->_remove_relation_to($registration_or_id, 'Registration'); |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | * @return EE_Line_Item[] |
604 | 604 | */ |
605 | 605 | public function items_purchased() { |
606 | - return $this->line_items( array( array( 'LIN_type' => EEM_Line_Item::type_line_item ) ) ); |
|
606 | + return $this->line_items(array(array('LIN_type' => EEM_Line_Item::type_line_item))); |
|
607 | 607 | } |
608 | 608 | |
609 | 609 | |
@@ -613,8 +613,8 @@ discard block |
||
613 | 613 | * @param EE_Line_Item $line_item |
614 | 614 | * @return EE_Base_Class the relation was added to |
615 | 615 | */ |
616 | - public function add_line_item( EE_Line_Item $line_item ) { |
|
617 | - return $this->_add_relation_to( $line_item, 'Line_Item' ); |
|
616 | + public function add_line_item(EE_Line_Item $line_item) { |
|
617 | + return $this->_add_relation_to($line_item, 'Line_Item'); |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | |
@@ -624,8 +624,8 @@ discard block |
||
624 | 624 | * @param array $query_params |
625 | 625 | * @return EE_Line_Item[] |
626 | 626 | */ |
627 | - public function line_items( $query_params = array() ) { |
|
628 | - return $this->get_many_related( 'Line_Item', $query_params ); |
|
627 | + public function line_items($query_params = array()) { |
|
628 | + return $this->get_many_related('Line_Item', $query_params); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | * @return EE_Line_Item[] |
636 | 636 | */ |
637 | 637 | public function tax_items() { |
638 | - return $this->line_items( array( array( 'LIN_type' => EEM_Line_Item::type_tax ) ) ); |
|
638 | + return $this->line_items(array(array('LIN_type' => EEM_Line_Item::type_tax))); |
|
639 | 639 | } |
640 | 640 | |
641 | 641 | |
@@ -646,9 +646,9 @@ discard block |
||
646 | 646 | * @return EE_Line_Item |
647 | 647 | */ |
648 | 648 | public function total_line_item() { |
649 | - $item = $this->get_first_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_total ) ) ); |
|
650 | - if( ! $item ){ |
|
651 | - EE_Registry::instance()->load_helper( 'Line_Item' ); |
|
649 | + $item = $this->get_first_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_total))); |
|
650 | + if ( ! $item) { |
|
651 | + EE_Registry::instance()->load_helper('Line_Item'); |
|
652 | 652 | $item = EEH_Line_Item::create_default_total_line_item(); |
653 | 653 | } |
654 | 654 | return $item; |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | */ |
664 | 664 | public function tax_total() { |
665 | 665 | $tax_line_item = $this->tax_total_line_item(); |
666 | - if ( $tax_line_item ) { |
|
666 | + if ($tax_line_item) { |
|
667 | 667 | return $tax_line_item->total(); |
668 | 668 | } else { |
669 | 669 | return 0; |
@@ -677,9 +677,9 @@ discard block |
||
677 | 677 | * @return EE_Line_Item |
678 | 678 | */ |
679 | 679 | public function tax_total_line_item() { |
680 | - $item = $this->get_first_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax_sub_total ) ) ); |
|
681 | - if( ! $item ){ |
|
682 | - EE_Registry::instance()->load_helper( 'Line_Item' ); |
|
680 | + $item = $this->get_first_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax_sub_total))); |
|
681 | + if ( ! $item) { |
|
682 | + EE_Registry::instance()->load_helper('Line_Item'); |
|
683 | 683 | $item = EEH_Line_Item::create_default_total_line_item(); |
684 | 684 | } |
685 | 685 | return $item; |
@@ -691,20 +691,20 @@ discard block |
||
691 | 691 | * Gets the array of billing info for the gateway and for this transaction's primary registration's attendee. |
692 | 692 | * @return EE_Form_Section_Proper |
693 | 693 | */ |
694 | - public function billing_info(){ |
|
694 | + public function billing_info() { |
|
695 | 695 | $payment_method = $this->payment_method(); |
696 | - if ( !$payment_method){ |
|
696 | + if ( ! $payment_method) { |
|
697 | 697 | EE_Error::add_error(__("Could not find billing info for transaction because no gateway has been used for it yet", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
698 | 698 | return false; |
699 | 699 | } |
700 | 700 | $primary_reg = $this->primary_registration(); |
701 | - if ( ! $primary_reg ) { |
|
702 | - EE_Error::add_error( __( "Cannot get billing info for gateway %s on transaction because no primary registration exists", "event_espresso" ), __FILE__, __FUNCTION__, __LINE__ ); |
|
701 | + if ( ! $primary_reg) { |
|
702 | + EE_Error::add_error(__("Cannot get billing info for gateway %s on transaction because no primary registration exists", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
|
703 | 703 | return FALSE; |
704 | 704 | } |
705 | 705 | $attendee = $primary_reg->attendee(); |
706 | - if ( ! $attendee ) { |
|
707 | - EE_Error::add_error( __( "Cannot get billing info for gateway %s on transaction because the primary registration has no attendee exists", "event_espresso" ), __FILE__, __FUNCTION__, __LINE__ ); |
|
706 | + if ( ! $attendee) { |
|
707 | + EE_Error::add_error(__("Cannot get billing info for gateway %s on transaction because the primary registration has no attendee exists", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
|
708 | 708 | return FALSE; |
709 | 709 | } |
710 | 710 | return $attendee->billing_info_for_payment_method($payment_method); |
@@ -739,15 +739,15 @@ discard block |
||
739 | 739 | * offline ones, dont' create payments) |
740 | 740 | * @return EE_Payment_Method |
741 | 741 | */ |
742 | - function payment_method(){ |
|
742 | + function payment_method() { |
|
743 | 743 | $pm = $this->get_first_related('Payment_Method'); |
744 | - if( $pm instanceof EE_Payment_Method ){ |
|
744 | + if ($pm instanceof EE_Payment_Method) { |
|
745 | 745 | return $pm; |
746 | - }else{ |
|
746 | + } else { |
|
747 | 747 | $last_payment = $this->last_payment(); |
748 | - if( $last_payment instanceof EE_Payment && $last_payment->payment_method() ){ |
|
748 | + if ($last_payment instanceof EE_Payment && $last_payment->payment_method()) { |
|
749 | 749 | return $last_payment->payment_method(); |
750 | - }else{ |
|
750 | + } else { |
|
751 | 751 | return NULL; |
752 | 752 | } |
753 | 753 | } |
@@ -758,15 +758,15 @@ discard block |
||
758 | 758 | * @return EE_Payment |
759 | 759 | */ |
760 | 760 | public function last_payment() { |
761 | - return $this->get_first_related( 'Payment', array( 'order_by' => array( 'PAY_ID' => 'desc' ) ) ); |
|
761 | + return $this->get_first_related('Payment', array('order_by' => array('PAY_ID' => 'desc'))); |
|
762 | 762 | } |
763 | 763 | |
764 | 764 | /** |
765 | 765 | * Gets all the line items which are unrelated to tickets on this transaction |
766 | 766 | * @return EE_Line_Item[] |
767 | 767 | */ |
768 | - public function non_ticket_line_items(){ |
|
769 | - return EEM_Line_Item::instance()->get_all_non_ticket_line_items_for_transaction( $this->ID() ); |
|
768 | + public function non_ticket_line_items() { |
|
769 | + return EEM_Line_Item::instance()->get_all_non_ticket_line_items_for_transaction($this->ID()); |
|
770 | 770 | } |
771 | 771 | |
772 | 772 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * EE_WP_User class |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * @param array $props_n_values |
23 | 23 | * @return EE_WP_User|mixed |
24 | 24 | */ |
25 | - public static function new_instance( $props_n_values = array() ) { |
|
26 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
27 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
25 | + public static function new_instance($props_n_values = array()) { |
|
26 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
27 | + return $has_object ? $has_object : new self($props_n_values); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | * @param array $props_n_values |
34 | 34 | * @return EE_WP_User |
35 | 35 | */ |
36 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
37 | - return new self( $props_n_values, TRUE ); |
|
36 | + public static function new_instance_from_db($props_n_values = array()) { |
|
37 | + return new self($props_n_values, TRUE); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | * @return WP_User |
43 | 43 | */ |
44 | 44 | public function wp_user_obj() { |
45 | - if( ! $this->_wp_user_obj ) { |
|
46 | - $this->_wp_user_obj = get_user_by('ID', $this->ID() ); |
|
45 | + if ( ! $this->_wp_user_obj) { |
|
46 | + $this->_wp_user_obj = get_user_by('ID', $this->ID()); |
|
47 | 47 | } |
48 | 48 | return $this->_wp_user_obj; |
49 | 49 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -89,7 +91,7 @@ discard block |
||
89 | 91 | if( $answer_obj instanceof EE_Answer ){ |
90 | 92 | if($pretty_answer){ |
91 | 93 | $value = $answer_obj->pretty_value(); |
92 | - }else{ |
|
94 | + } else{ |
|
93 | 95 | $value = $answer_obj->value(); |
94 | 96 | } |
95 | 97 | } |
@@ -129,13 +131,13 @@ discard block |
||
129 | 131 | if($field_name == 'STA_ID'){ |
130 | 132 | $state = $registration->attendee()->state_obj(); |
131 | 133 | $value = $state instanceof EE_State ? $state->name() : sprintf(__('Unknown State (%s)', 'event_espresso'),$registration->attendee()->state_ID()); |
132 | - }else if($field_name == 'CNT_ISO'){ |
|
134 | + } else if($field_name == 'CNT_ISO'){ |
|
133 | 135 | $country = $registration->attendee()->country_obj(); |
134 | 136 | $value = $country instanceof EE_Country ? $country->name() : sprintf(__('Unknown Country (%s)', "event_espresso"),$registration->attendee()->country_ID()); |
135 | - }else{ |
|
137 | + } else{ |
|
136 | 138 | $value = $registration->attendee()->get_pretty($field_name); |
137 | 139 | } |
138 | - }else{ |
|
140 | + } else{ |
|
139 | 141 | $value = $registration->attendee()->get($field_name); |
140 | 142 | } |
141 | 143 | } |
@@ -50,18 +50,18 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * constructor |
52 | 52 | */ |
53 | - protected function __construct( $timezone = NULL ){ |
|
54 | - $this->singular_item = __('Answer','event_espresso'); |
|
55 | - $this->plural_item = __('Answers','event_espresso'); |
|
53 | + protected function __construct($timezone = NULL) { |
|
54 | + $this->singular_item = __('Answer', 'event_espresso'); |
|
55 | + $this->plural_item = __('Answers', 'event_espresso'); |
|
56 | 56 | $this->_tables = array( |
57 | 57 | 'Answer'=> new EE_Primary_Table('esp_answer', 'ANS_ID') |
58 | 58 | ); |
59 | 59 | $this->_fields = array( |
60 | 60 | 'Answer'=>array( |
61 | - 'ANS_ID'=> new EE_Primary_Key_Int_Field('ANS_ID', __('Answer ID','event_espresso')), |
|
62 | - 'REG_ID'=>new EE_Foreign_Key_Int_Field('REG_ID', __('Registration ID','event_espresso'), false, 0, 'Registration'), |
|
63 | - 'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID','event_espresso'), false, 0, 'Question'), |
|
64 | - 'ANS_value'=>new EE_Maybe_Serialized_Text_Field('ANS_value', __('Answer Value','event_espresso'), false, '') |
|
61 | + 'ANS_ID'=> new EE_Primary_Key_Int_Field('ANS_ID', __('Answer ID', 'event_espresso')), |
|
62 | + 'REG_ID'=>new EE_Foreign_Key_Int_Field('REG_ID', __('Registration ID', 'event_espresso'), false, 0, 'Registration'), |
|
63 | + 'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso'), false, 0, 'Question'), |
|
64 | + 'ANS_value'=>new EE_Maybe_Serialized_Text_Field('ANS_value', __('Answer Value', 'event_espresso'), false, '') |
|
65 | 65 | )); |
66 | 66 | $this->_model_relations = array( |
67 | 67 | 'Registration'=>new EE_Belongs_To_Relation(), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ); |
70 | 70 | $this->_model_chain_to_wp_user = 'Registration.Event'; |
71 | 71 | |
72 | - parent::__construct( $timezone ); |
|
72 | + parent::__construct($timezone); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -82,19 +82,19 @@ discard block |
||
82 | 82 | * @param boolean $pretty_answer whether to call 'pretty_value' or just 'value' |
83 | 83 | * @return string |
84 | 84 | */ |
85 | - public function get_answer_value_to_question( EE_Registration $registration, $question_id = NULL,$pretty_answer = FALSE ){ |
|
86 | - $value = $this->get_attendee_property_answer_value( $registration, $question_id, $pretty_answer ); |
|
87 | - if ( $value === NULL ){ |
|
88 | - $answer_obj = $this->get_registration_question_answer_object( $registration, $question_id, $pretty_answer ); |
|
89 | - if( $answer_obj instanceof EE_Answer ){ |
|
90 | - if($pretty_answer){ |
|
85 | + public function get_answer_value_to_question(EE_Registration $registration, $question_id = NULL, $pretty_answer = FALSE) { |
|
86 | + $value = $this->get_attendee_property_answer_value($registration, $question_id, $pretty_answer); |
|
87 | + if ($value === NULL) { |
|
88 | + $answer_obj = $this->get_registration_question_answer_object($registration, $question_id, $pretty_answer); |
|
89 | + if ($answer_obj instanceof EE_Answer) { |
|
90 | + if ($pretty_answer) { |
|
91 | 91 | $value = $answer_obj->pretty_value(); |
92 | - }else{ |
|
92 | + } else { |
|
93 | 93 | $value = $answer_obj->value(); |
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
97 | - return apply_filters( 'FHEE__EEM_Answer__get_answer_value_to_question__answer_value', $value, $registration, $question_id ); |
|
97 | + return apply_filters('FHEE__EEM_Answer__get_answer_value_to_question__answer_value', $value, $registration, $question_id); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | * @param int $question_id |
106 | 106 | * @return EE_Answer |
107 | 107 | */ |
108 | - public function get_registration_question_answer_object( EE_Registration $registration, $question_id = NULL){ |
|
109 | - $answer_obj = $this->get_one( array( array( 'QST_ID'=>$question_id, 'REG_ID'=>$registration->ID() ))); |
|
110 | - return apply_filters( 'FHEE__EEM_Answer__get_registration_question_answer_object__answer_obj', $answer_obj, $registration, $question_id ); |
|
108 | + public function get_registration_question_answer_object(EE_Registration $registration, $question_id = NULL) { |
|
109 | + $answer_obj = $this->get_one(array(array('QST_ID'=>$question_id, 'REG_ID'=>$registration->ID()))); |
|
110 | + return apply_filters('FHEE__EEM_Answer__get_registration_question_answer_object__answer_obj', $answer_obj, $registration, $question_id); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -119,27 +119,27 @@ discard block |
||
119 | 119 | * @param boolean $pretty_answer |
120 | 120 | * @return string |
121 | 121 | */ |
122 | - public function get_attendee_property_answer_value( EE_Registration $registration, $question_id = NULL, $pretty_answer = FALSE ){ |
|
122 | + public function get_attendee_property_answer_value(EE_Registration $registration, $question_id = NULL, $pretty_answer = FALSE) { |
|
123 | 123 | $field_name = NULL; |
124 | 124 | $value = NULL; |
125 | 125 | //only bother checking if the registration has an attendee |
126 | - if( $registration->attendee() instanceof EE_Attendee && isset($this->_question_id_to_att_field_map[$question_id])){ |
|
126 | + if ($registration->attendee() instanceof EE_Attendee && isset($this->_question_id_to_att_field_map[$question_id])) { |
|
127 | 127 | $field_name = $this->_question_id_to_att_field_map[$question_id]; |
128 | - if($pretty_answer){ |
|
129 | - if($field_name == 'STA_ID'){ |
|
128 | + if ($pretty_answer) { |
|
129 | + if ($field_name == 'STA_ID') { |
|
130 | 130 | $state = $registration->attendee()->state_obj(); |
131 | - $value = $state instanceof EE_State ? $state->name() : sprintf(__('Unknown State (%s)', 'event_espresso'),$registration->attendee()->state_ID()); |
|
132 | - }else if($field_name == 'CNT_ISO'){ |
|
131 | + $value = $state instanceof EE_State ? $state->name() : sprintf(__('Unknown State (%s)', 'event_espresso'), $registration->attendee()->state_ID()); |
|
132 | + } else if ($field_name == 'CNT_ISO') { |
|
133 | 133 | $country = $registration->attendee()->country_obj(); |
134 | - $value = $country instanceof EE_Country ? $country->name() : sprintf(__('Unknown Country (%s)', "event_espresso"),$registration->attendee()->country_ID()); |
|
135 | - }else{ |
|
134 | + $value = $country instanceof EE_Country ? $country->name() : sprintf(__('Unknown Country (%s)', "event_espresso"), $registration->attendee()->country_ID()); |
|
135 | + } else { |
|
136 | 136 | $value = $registration->attendee()->get_pretty($field_name); |
137 | 137 | } |
138 | - }else{ |
|
138 | + } else { |
|
139 | 139 | $value = $registration->attendee()->get($field_name); |
140 | 140 | } |
141 | 141 | } |
142 | - return apply_filters( 'FHEE__EEM_Answer__get_attendee_question_answer_value__answer_value', $value, $registration, $question_id ); |
|
142 | + return apply_filters('FHEE__EEM_Answer__get_attendee_question_answer_value__answer_value', $value, $registration, $question_id); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | |
106 | 106 | |
107 | 107 | /** |
108 | - * retrieve a single attendee from db via their ID |
|
109 | - * |
|
110 | - * @access public |
|
111 | - * @param $ATT_ID |
|
112 | - * @return mixed array on success, FALSE on fail |
|
108 | + * retrieve a single attendee from db via their ID |
|
109 | + * |
|
110 | + * @access public |
|
111 | + * @param $ATT_ID |
|
112 | + * @return mixed array on success, FALSE on fail |
|
113 | 113 | * @deprecated |
114 | - */ |
|
114 | + */ |
|
115 | 115 | public function get_attendee_by_ID( $ATT_ID = FALSE ) { |
116 | 116 | // retrieve a particular EE_Attendee |
117 | 117 | return $this->get_one_by_ID( $ATT_ID ); |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | |
122 | 122 | |
123 | 123 | /** |
124 | - * retrieve a single attendee from db via their ID |
|
125 | - * |
|
126 | - * @access public |
|
127 | - * @param array $where_cols_n_values |
|
128 | - * @return mixed array on success, FALSE on fail |
|
129 | - */ |
|
124 | + * retrieve a single attendee from db via their ID |
|
125 | + * |
|
126 | + * @access public |
|
127 | + * @param array $where_cols_n_values |
|
128 | + * @return mixed array on success, FALSE on fail |
|
129 | + */ |
|
130 | 130 | public function get_attendee( $where_cols_n_values = array() ) { |
131 | 131 | |
132 | 132 | if ( empty( $where_cols_n_values )) { |
@@ -174,20 +174,20 @@ discard block |
||
174 | 174 | |
175 | 175 | |
176 | 176 | /** |
177 | - * Takes an incoming array of EE_Registration ids and sends back a list of corresponding non duplicate |
|
178 | - * EE_Attendee objects. |
|
179 | - * |
|
180 | - * @since 4.3.0 |
|
181 | - * @param array $ids array of EE_Registration ids |
|
182 | - * @return EE_Attendee[] |
|
183 | - */ |
|
184 | - public function get_array_of_contacts_from_reg_ids( $ids ) { |
|
185 | - $ids = (array) $ids; |
|
186 | - $_where = array( |
|
187 | - 'Registration.REG_ID' => array( 'in', $ids ) |
|
188 | - ); |
|
189 | - return $this->get_all( array( $_where ) ); |
|
190 | - } |
|
177 | + * Takes an incoming array of EE_Registration ids and sends back a list of corresponding non duplicate |
|
178 | + * EE_Attendee objects. |
|
179 | + * |
|
180 | + * @since 4.3.0 |
|
181 | + * @param array $ids array of EE_Registration ids |
|
182 | + * @return EE_Attendee[] |
|
183 | + */ |
|
184 | + public function get_array_of_contacts_from_reg_ids( $ids ) { |
|
185 | + $ids = (array) $ids; |
|
186 | + $_where = array( |
|
187 | + 'Registration.REG_ID' => array( 'in', $ids ) |
|
188 | + ); |
|
189 | + return $this->get_all( array( $_where ) ); |
|
190 | + } |
|
191 | 191 | |
192 | 192 | |
193 | 193 | } |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
3 | 5 | |
4 | 6 | /** |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
2 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
2 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * |
@@ -19,16 +19,16 @@ discard block |
||
19 | 19 | * QST_ID and QST_systems that relate to attendee attributes. |
20 | 20 | * NOTE: this will be deprecated if we remove system questions |
21 | 21 | */ |
22 | - const fname_question_id=1; |
|
23 | - const lname_question_id=2; |
|
24 | - const email_question_id=3; |
|
25 | - const address_question_id=4; |
|
26 | - const address2_question_id=5; |
|
27 | - const city_question_id=6; |
|
28 | - const state_question_id=7; |
|
29 | - const country_question_id=8; |
|
30 | - const zip_question_id=9; |
|
31 | - const phone_question_id=10; |
|
22 | + const fname_question_id = 1; |
|
23 | + const lname_question_id = 2; |
|
24 | + const email_question_id = 3; |
|
25 | + const address_question_id = 4; |
|
26 | + const address2_question_id = 5; |
|
27 | + const city_question_id = 6; |
|
28 | + const state_question_id = 7; |
|
29 | + const country_question_id = 8; |
|
30 | + const zip_question_id = 9; |
|
31 | + const phone_question_id = 10; |
|
32 | 32 | |
33 | 33 | |
34 | 34 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @access protected |
40 | 40 | * @param null $timezone |
41 | 41 | */ |
42 | - protected function __construct( $timezone = NULL ) { |
|
43 | - $this->singular_item = __('Attendee','event_espresso'); |
|
44 | - $this->plural_item = __('Attendees','event_espresso'); |
|
42 | + protected function __construct($timezone = NULL) { |
|
43 | + $this->singular_item = __('Attendee', 'event_espresso'); |
|
44 | + $this->plural_item = __('Attendees', 'event_espresso'); |
|
45 | 45 | $this->_tables = array( |
46 | 46 | 'Attendee_CPT'=> new EE_Primary_Table('posts', 'ID'), |
47 | 47 | 'Attendee_Meta'=>new EE_Secondary_Table('esp_attendee_meta', 'ATTM_ID', 'ATT_ID') |
@@ -55,35 +55,35 @@ discard block |
||
55 | 55 | 'ATT_created'=>new EE_Datetime_Field('post_date', __("Time Attendee Created", "event_espresso"), false, current_time('timestamp')), |
56 | 56 | 'ATT_short_bio'=>new EE_Simple_HTML_Field('post_excerpt', __("Attendee Short Biography", "event_espresso"), true, __("No Biography Provided", "event_espresso")), |
57 | 57 | 'ATT_modified'=>new EE_Datetime_Field('post_modified', __("Time Attendee Last Modified", "event_espresso"), FALSE, current_time('timestamp')), |
58 | - 'ATT_author'=>new EE_WP_User_Field('post_author', __("Creator ID of the first Event attended", "event_espresso"), false ), |
|
58 | + 'ATT_author'=>new EE_WP_User_Field('post_author', __("Creator ID of the first Event attended", "event_espresso"), false), |
|
59 | 59 | 'ATT_parent'=>new EE_DB_Only_Int_Field('post_parent', __("Parent Attendee (unused)", "event_espresso"), false, 0), |
60 | - 'post_type'=>new EE_WP_Post_Type_Field('espresso_attendees'),// EE_DB_Only_Text_Field('post_type', __("Post Type of Attendee", "event_espresso"), false,'espresso_attendees'), |
|
60 | + 'post_type'=>new EE_WP_Post_Type_Field('espresso_attendees'), // EE_DB_Only_Text_Field('post_type', __("Post Type of Attendee", "event_espresso"), false,'espresso_attendees'), |
|
61 | 61 | 'status' => new EE_WP_Post_Status_Field('post_status', __('Attendee Status', 'event_espresso'), false, 'publish') |
62 | 62 | ), |
63 | 63 | 'Attendee_Meta'=>array( |
64 | - 'ATTM_ID'=> new EE_DB_Only_Int_Field('ATTM_ID', __('Attendee Meta Row ID','event_espresso'), false), |
|
64 | + 'ATTM_ID'=> new EE_DB_Only_Int_Field('ATTM_ID', __('Attendee Meta Row ID', 'event_espresso'), false), |
|
65 | 65 | 'ATT_ID_fk'=>new EE_DB_Only_Int_Field('ATT_ID', __("Foreign Key to Attendee in Post Table", "event_espresso"), false), |
66 | - 'ATT_fname'=>new EE_Plain_Text_Field('ATT_fname', __('First Name','event_espresso'), true, ''), |
|
67 | - 'ATT_lname'=>new EE_Plain_Text_Field('ATT_lname', __('Last Name','event_espresso'), true, ''), |
|
68 | - 'ATT_address'=>new EE_Plain_Text_Field('ATT_address', __('Address Part 1','event_espresso'), true, ''), |
|
69 | - 'ATT_address2'=>new EE_Plain_Text_Field('ATT_address2', __('Address Part 2','event_espresso'), true, ''), |
|
70 | - 'ATT_city'=>new EE_Plain_Text_Field('ATT_city', __('City','event_espresso'), true, ''), |
|
71 | - 'STA_ID'=>new EE_Foreign_Key_Int_Field('STA_ID', __('State','event_espresso'), true,0,'State'), |
|
72 | - 'CNT_ISO'=>new EE_Foreign_Key_String_Field('CNT_ISO', __('Country','event_espresso'), true,'','Country'), |
|
73 | - 'ATT_zip'=>new EE_Plain_Text_Field('ATT_zip', __('ZIP/Postal Code','event_espresso'), true, ''), |
|
74 | - 'ATT_email'=>new EE_Email_Field('ATT_email', __('Email Address','event_espresso'), true, ''), |
|
75 | - 'ATT_phone'=>new EE_Plain_Text_Field('ATT_phone', __('Phone','event_espresso'), true, '') |
|
66 | + 'ATT_fname'=>new EE_Plain_Text_Field('ATT_fname', __('First Name', 'event_espresso'), true, ''), |
|
67 | + 'ATT_lname'=>new EE_Plain_Text_Field('ATT_lname', __('Last Name', 'event_espresso'), true, ''), |
|
68 | + 'ATT_address'=>new EE_Plain_Text_Field('ATT_address', __('Address Part 1', 'event_espresso'), true, ''), |
|
69 | + 'ATT_address2'=>new EE_Plain_Text_Field('ATT_address2', __('Address Part 2', 'event_espresso'), true, ''), |
|
70 | + 'ATT_city'=>new EE_Plain_Text_Field('ATT_city', __('City', 'event_espresso'), true, ''), |
|
71 | + 'STA_ID'=>new EE_Foreign_Key_Int_Field('STA_ID', __('State', 'event_espresso'), true, 0, 'State'), |
|
72 | + 'CNT_ISO'=>new EE_Foreign_Key_String_Field('CNT_ISO', __('Country', 'event_espresso'), true, '', 'Country'), |
|
73 | + 'ATT_zip'=>new EE_Plain_Text_Field('ATT_zip', __('ZIP/Postal Code', 'event_espresso'), true, ''), |
|
74 | + 'ATT_email'=>new EE_Email_Field('ATT_email', __('Email Address', 'event_espresso'), true, ''), |
|
75 | + 'ATT_phone'=>new EE_Plain_Text_Field('ATT_phone', __('Phone', 'event_espresso'), true, '') |
|
76 | 76 | )); |
77 | 77 | $this->_model_relations = array( |
78 | 78 | 'Registration'=>new EE_Has_Many_Relation(), |
79 | 79 | 'State'=>new EE_Belongs_To_Relation(), |
80 | 80 | 'Country'=>new EE_Belongs_To_Relation(), |
81 | - 'Event'=>new EE_HABTM_Relation('Registration', FALSE ), |
|
81 | + 'Event'=>new EE_HABTM_Relation('Registration', FALSE), |
|
82 | 82 | 'WP_User' => new EE_Belongs_To_Relation(), |
83 | 83 | ); |
84 | 84 | require_once('strategies/EE_CPT_Where_Conditions.strategy.php'); |
85 | 85 | $this->_default_where_conditions_strategy = new EE_CPT_Where_Conditions('espresso_attendees', 'ATTM_ID'); |
86 | - parent::__construct( $timezone ); |
|
86 | + parent::__construct($timezone); |
|
87 | 87 | |
88 | 88 | } |
89 | 89 | |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | * @param EE_Transaction/int $transaction_id_or_obj EE_Transaction or its ID |
96 | 96 | * @return EE_Attendee[] |
97 | 97 | */ |
98 | - public function get_attendees_for_transaction( $transaction_id_or_obj ){ |
|
99 | - return $this->get_all( array( array( |
|
98 | + public function get_attendees_for_transaction($transaction_id_or_obj) { |
|
99 | + return $this->get_all(array(array( |
|
100 | 100 | 'Registration.Transaction.TXN_ID' => $transaction_id_or_obj instanceof EE_Transaction ? $transaction_id_or_obj->ID() : $transaction_id_or_obj |
101 | 101 | ))); |
102 | 102 | } |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | * @return mixed array on success, FALSE on fail |
112 | 112 | * @deprecated |
113 | 113 | */ |
114 | - public function get_attendee_by_ID( $ATT_ID = FALSE ) { |
|
114 | + public function get_attendee_by_ID($ATT_ID = FALSE) { |
|
115 | 115 | // retrieve a particular EE_Attendee |
116 | - return $this->get_one_by_ID( $ATT_ID ); |
|
116 | + return $this->get_one_by_ID($ATT_ID); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | * @param array $where_cols_n_values |
127 | 127 | * @return mixed array on success, FALSE on fail |
128 | 128 | */ |
129 | - public function get_attendee( $where_cols_n_values = array() ) { |
|
129 | + public function get_attendee($where_cols_n_values = array()) { |
|
130 | 130 | |
131 | - if ( empty( $where_cols_n_values )) { |
|
131 | + if (empty($where_cols_n_values)) { |
|
132 | 132 | return FALSE; |
133 | 133 | } |
134 | - $attendee = $this->get_all( array($where_cols_n_values )); |
|
135 | - if ( ! empty( $attendee )) { |
|
136 | - return array_shift( $attendee ); |
|
134 | + $attendee = $this->get_all(array($where_cols_n_values)); |
|
135 | + if ( ! empty($attendee)) { |
|
136 | + return array_shift($attendee); |
|
137 | 137 | } else { |
138 | 138 | return FALSE; |
139 | 139 | } |
@@ -149,20 +149,20 @@ discard block |
||
149 | 149 | * @param array $where_cols_n_values |
150 | 150 | * @return bool|mixed |
151 | 151 | */ |
152 | - public function find_existing_attendee( $where_cols_n_values = NULL ) { |
|
152 | + public function find_existing_attendee($where_cols_n_values = NULL) { |
|
153 | 153 | // search by combo of first and last names plus the email address |
154 | - $attendee_data_keys = array( 'ATT_fname' => $this->_ATT_fname, 'ATT_lname' => $this->_ATT_lname, 'ATT_email' => $this->_ATT_email ); |
|
154 | + $attendee_data_keys = array('ATT_fname' => $this->_ATT_fname, 'ATT_lname' => $this->_ATT_lname, 'ATT_email' => $this->_ATT_email); |
|
155 | 155 | // no search params means attendee object already exists. |
156 | - $where_cols_n_values = is_array( $where_cols_n_values ) && ! empty( $where_cols_n_values ) ? $where_cols_n_values : $attendee_data_keys; |
|
156 | + $where_cols_n_values = is_array($where_cols_n_values) && ! empty($where_cols_n_values) ? $where_cols_n_values : $attendee_data_keys; |
|
157 | 157 | $valid_data = TRUE; |
158 | 158 | // check for required values |
159 | - $valid_data = isset( $where_cols_n_values['ATT_fname'] ) && ! empty( $where_cols_n_values['ATT_fname'] ) ? $valid_data : FALSE; |
|
160 | - $valid_data = isset( $where_cols_n_values['ATT_lname'] ) && ! empty( $where_cols_n_values['ATT_lname'] ) ? $valid_data : FALSE; |
|
161 | - $valid_data = isset( $where_cols_n_values['ATT_email'] ) && ! empty( $where_cols_n_values['ATT_email'] ) ? $valid_data : FALSE; |
|
159 | + $valid_data = isset($where_cols_n_values['ATT_fname']) && ! empty($where_cols_n_values['ATT_fname']) ? $valid_data : FALSE; |
|
160 | + $valid_data = isset($where_cols_n_values['ATT_lname']) && ! empty($where_cols_n_values['ATT_lname']) ? $valid_data : FALSE; |
|
161 | + $valid_data = isset($where_cols_n_values['ATT_email']) && ! empty($where_cols_n_values['ATT_email']) ? $valid_data : FALSE; |
|
162 | 162 | |
163 | - if ( $valid_data ) { |
|
164 | - $attendee = $this->get_attendee( $where_cols_n_values ); |
|
165 | - if ( $attendee instanceof EE_Attendee ) { |
|
163 | + if ($valid_data) { |
|
164 | + $attendee = $this->get_attendee($where_cols_n_values); |
|
165 | + if ($attendee instanceof EE_Attendee) { |
|
166 | 166 | return $attendee; |
167 | 167 | } |
168 | 168 | } |
@@ -180,12 +180,12 @@ discard block |
||
180 | 180 | * @param array $ids array of EE_Registration ids |
181 | 181 | * @return EE_Attendee[] |
182 | 182 | */ |
183 | - public function get_array_of_contacts_from_reg_ids( $ids ) { |
|
183 | + public function get_array_of_contacts_from_reg_ids($ids) { |
|
184 | 184 | $ids = (array) $ids; |
185 | 185 | $_where = array( |
186 | - 'Registration.REG_ID' => array( 'in', $ids ) |
|
186 | + 'Registration.REG_ID' => array('in', $ids) |
|
187 | 187 | ); |
188 | - return $this->get_all( array( $_where ) ); |
|
188 | + return $this->get_all(array($_where)); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 |