Completed
Branch FET-7988-evertec-needs (20e248)
by
unknown
1119:58 queued 1106:57
created
core/db_models/EEM_Currency.model.php 2 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('No direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -84,7 +85,7 @@  discard block
 block discarded – undo
84 85
 	public function is_valid() {
85 86
 		if(count($this->_validation_errors)){
86 87
 			return false;
87
-		}else{
88
+		} else{
88 89
 			return true;
89 90
 		}
90 91
 	}
@@ -113,7 +114,7 @@  discard block
 block discarded – undo
113 114
 		if($message_or_object instanceof EE_Validation_Error){
114 115
 			$validation_error= $message_or_object;
115 116
 			$validation_error->set_form_section($this);
116
-		}else{
117
+		} else{
117 118
 			$validation_error = new EE_Validation_Error($message_or_object, $error_code, $this, $previous_exception);
118 119
 		}
119 120
 		$this->_validation_errors[] = $validation_error;
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 
6 6
 /**
@@ -25,30 +25,30 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EEM_Currency extends EEM_Base{
28
+class EEM_Currency extends EEM_Base {
29 29
 		// private instance of the Attendee object
30 30
 	protected static $_instance = NULL;
31 31
 
32
-	protected function __construct( $timezone = NULL ) {
33
-		$this->singular_item = __('Currency','event_espresso');
34
-		$this->plural_item = __('Currencies','event_espresso');
32
+	protected function __construct($timezone = NULL) {
33
+		$this->singular_item = __('Currency', 'event_espresso');
34
+		$this->plural_item = __('Currencies', 'event_espresso');
35 35
 		$this->_tables = array(
36 36
 			'Currency'=> new EE_Primary_Table('esp_currency', 'CUR_code')
37 37
 		);
38 38
 		$this->_fields = array(
39 39
 			'Currency'=>array(
40
-				'CUR_code'=> new EE_Primary_Key_String_Field('CUR_code', __('Currency COde','event_espresso')),
41
-				'CUR_single' => new EE_Plain_Text_Field('CUR_single', __('Currency Name Singular','event_espresso'), false),
42
-				'CUR_plural' => new EE_Plain_Text_Field('CUR_plural', __('Currency Name Plural','event_espresso'), false),
43
-				'CUR_sign' => new EE_Plain_Text_Field('CUR_sign', __('Currency Sign','event_espresso'), false),
44
-				'CUR_dec_plc' => new EE_Integer_Field('CUR_dec_plc', __('Currency Decimal Places','event_espresso'), false, 2),
45
-				'CUR_active'=>new EE_Boolean_Field('CUR_active', __("Active?", 'event_espresso'), false,true),
40
+				'CUR_code'=> new EE_Primary_Key_String_Field('CUR_code', __('Currency COde', 'event_espresso')),
41
+				'CUR_single' => new EE_Plain_Text_Field('CUR_single', __('Currency Name Singular', 'event_espresso'), false),
42
+				'CUR_plural' => new EE_Plain_Text_Field('CUR_plural', __('Currency Name Plural', 'event_espresso'), false),
43
+				'CUR_sign' => new EE_Plain_Text_Field('CUR_sign', __('Currency Sign', 'event_espresso'), false),
44
+				'CUR_dec_plc' => new EE_Integer_Field('CUR_dec_plc', __('Currency Decimal Places', 'event_espresso'), false, 2),
45
+				'CUR_active'=>new EE_Boolean_Field('CUR_active', __("Active?", 'event_espresso'), false, true),
46 46
 			));
47 47
 		$this->_model_relations = array(
48 48
 			'Payment_Method'=>new EE_HABTM_Relation('Currency_Payment_Method'),
49 49
 		);
50 50
 
51
-		parent::__construct( $timezone );
51
+		parent::__construct($timezone);
52 52
 	}
53 53
 
54 54
 	/**
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 	 * @param array $query_params see EEM_Base::get_all
58 58
 	 * @return EE_Currency[]
59 59
 	 */
60
-	public function get_all_active($query_params = array()){
60
+	public function get_all_active($query_params = array()) {
61 61
 		$query_params[0]['CUR_active'] = true;
62
-		if( ! isset($query_params['order_by'])){
63
-			$query_params['order_by'] = array('CUR_code'=>'ASC','CUR_single'=>'ASC');
62
+		if ( ! isset($query_params['order_by'])) {
63
+			$query_params['order_by'] = array('CUR_code'=>'ASC', 'CUR_single'=>'ASC');
64 64
 		}
65 65
 		return $this->get_all($query_params);
66 66
 	}
@@ -69,17 +69,17 @@  discard block
 block discarded – undo
69 69
 	 * @param EE_PMT_Base $payment_method_type
70 70
 	 * @return EE_Currency[]
71 71
 	 */
72
-	public function get_all_currencies_usable_by($payment_method_type){
73
-		if($payment_method_type instanceof EE_PMT_Base &&
74
-				$payment_method_type->get_gateway()){
72
+	public function get_all_currencies_usable_by($payment_method_type) {
73
+		if ($payment_method_type instanceof EE_PMT_Base &&
74
+				$payment_method_type->get_gateway()) {
75 75
 			$currencies_supported = $payment_method_type->get_gateway()->currencies_supported();
76
-		}else{
76
+		} else {
77 77
 			$currencies_supported = EE_Gateway::all_currencies_supported;
78 78
 		}
79
-		if($currencies_supported == EE_Gateway::all_currencies_supported || empty( $currencies_supported ) ) {
79
+		if ($currencies_supported == EE_Gateway::all_currencies_supported || empty($currencies_supported)) {
80 80
 			$currencies = $this->get_all_active();
81
-		}else{
82
-			$currencies = $this->get_all_active(array(array('CUR_code'=>array('IN',$currencies_supported))));
81
+		} else {
82
+			$currencies = $this->get_all_active(array(array('CUR_code'=>array('IN', $currencies_supported))));
83 83
 		}
84 84
 		return $currencies;
85 85
 	}
Please login to merge, or discard this patch.
core/db_models/EEM_Currency_Payment_Method.model.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 /**
6 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 
6 6
 /**
@@ -25,29 +25,29 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EEM_Currency_Payment_Method extends EEM_Base{
28
+class EEM_Currency_Payment_Method extends EEM_Base {
29 29
 	// private instance of the Attendee object
30 30
 	protected static $_instance = NULL;
31 31
 
32 32
 
33
-	protected function __construct( $timezone = NULL ) {
34
-		$this->singular_item = __('Currency Usable by Payment Method','event_espresso');
35
-		$this->plural_item = __('Currencies Usable by Payment Methods','event_espresso');
33
+	protected function __construct($timezone = NULL) {
34
+		$this->singular_item = __('Currency Usable by Payment Method', 'event_espresso');
35
+		$this->plural_item = __('Currencies Usable by Payment Methods', 'event_espresso');
36 36
 		$this->_tables = array(
37
-			'Currency_Payment_Method'=>new EE_Primary_Table('esp_currency_payment_method','CPM_ID')
37
+			'Currency_Payment_Method'=>new EE_Primary_Table('esp_currency_payment_method', 'CPM_ID')
38 38
 		);
39 39
 		$this->_fields = array(
40 40
 			'Currency_Payment_Method'=>array(
41
-				'CPM_ID'=>new EE_Primary_Key_Int_Field('CPM_ID', __('Currency to Payment Method LInk ID','event_espresso')),
42
-				'CUR_code'=>new EE_Foreign_Key_String_Field('CUR_code', __('Currency Code','event_espresso'), false, 0, 'Currency'),
43
-				'PMD_ID'=>new EE_Foreign_Key_Int_Field('PMD_ID', __('Paymetn Method ID','event_espresso'), false, 0, 'Payment_Method')
41
+				'CPM_ID'=>new EE_Primary_Key_Int_Field('CPM_ID', __('Currency to Payment Method LInk ID', 'event_espresso')),
42
+				'CUR_code'=>new EE_Foreign_Key_String_Field('CUR_code', __('Currency Code', 'event_espresso'), false, 0, 'Currency'),
43
+				'PMD_ID'=>new EE_Foreign_Key_Int_Field('PMD_ID', __('Paymetn Method ID', 'event_espresso'), false, 0, 'Payment_Method')
44 44
 			)
45 45
 		);
46 46
 		$this->_model_relations = array(
47 47
 			'Currency'=>new EE_Belongs_To_Relation(),
48 48
 			'Payment_Method'=>new EE_Belongs_To_Relation()
49 49
 		);
50
-		parent::__construct( $timezone );
50
+		parent::__construct($timezone);
51 51
 	}
52 52
 }
53 53
 
Please login to merge, or discard this patch.
core/db_models/EEM_Datetime_Ticket.model.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
25
-require_once ( EE_CLASSES . 'EE_Datetime_Ticket.class.php' );
24
+require_once (EE_MODELS.'EEM_Base.model.php');
25
+require_once (EE_CLASSES.'EE_Datetime_Ticket.class.php');
26 26
 
27 27
 class EEM_Datetime_Ticket extends EEM_Base {
28 28
 
@@ -37,24 +37,24 @@  discard block
 block discarded – undo
37 37
 	 *		@param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
38 38
 	 *		@return void
39 39
 	 */
40
-	protected function __construct( $timezone ) {
41
-		$this->singular_item = __('Datetime Ticket','event_espresso');
42
-		$this->plural_item = __('Datetime Tickets','event_espresso');
40
+	protected function __construct($timezone) {
41
+		$this->singular_item = __('Datetime Ticket', 'event_espresso');
42
+		$this->plural_item = __('Datetime Tickets', 'event_espresso');
43 43
 
44 44
 		$this->_tables = array(
45 45
 			'Datetime_Ticket'=> new EE_Primary_Table('esp_datetime_ticket', 'DTK_ID')
46 46
 		);
47 47
 		$this->_fields = array(
48 48
 			'Datetime_Ticket'=>array(
49
-				'DTK_ID'=>new EE_Primary_Key_Int_Field('DTK_ID', __('Datetime Ticket ID','event_espresso')),
50
-				'DTT_ID'=>new EE_Foreign_Key_Int_Field('DTT_ID', __('The ID to the Datetime','event_espresso'), false, 0, 'Datetime' ),
51
-				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('The ID to the Ticket','event_espresso'), false, 0, 'Ticket' )
49
+				'DTK_ID'=>new EE_Primary_Key_Int_Field('DTK_ID', __('Datetime Ticket ID', 'event_espresso')),
50
+				'DTT_ID'=>new EE_Foreign_Key_Int_Field('DTT_ID', __('The ID to the Datetime', 'event_espresso'), false, 0, 'Datetime'),
51
+				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('The ID to the Ticket', 'event_espresso'), false, 0, 'Ticket')
52 52
 			));
53 53
 		$this->_model_relations = array(
54 54
 			'Ticket'=>new EE_Belongs_To_Relation(),
55 55
 			'Datetime'=>new EE_Belongs_To_Relation()
56 56
 		);
57 57
 
58
-		parent::__construct( $timezone );
58
+		parent::__construct($timezone);
59 59
 	}
60 60
 } //end EEM_Datetime_Ticket class
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_models/EEM_Line_Item.model.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -103,40 +103,40 @@  discard block
 block discarded – undo
103 103
 	 * @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
104 104
 	 * @return \EEM_Line_Item
105 105
 	 */
106
-	protected function __construct( $timezone ) {
107
-		$this->singular_item = __('Line Item','event_espresso');
108
-		$this->plural_item = __('Line Items','event_espresso');
106
+	protected function __construct($timezone) {
107
+		$this->singular_item = __('Line Item', 'event_espresso');
108
+		$this->plural_item = __('Line Items', 'event_espresso');
109 109
 
110 110
 		$this->_tables = array(
111
-			'Line_Item'=>new EE_Primary_Table('esp_line_item','LIN_ID')
111
+			'Line_Item'=>new EE_Primary_Table('esp_line_item', 'LIN_ID')
112 112
 		);
113
-		$line_items_can_be_for = array('Ticket','Price');
113
+		$line_items_can_be_for = array('Ticket', 'Price');
114 114
 		$this->_fields = array(
115 115
 			'Line_Item' => array(
116
-				'LIN_ID' 				=> new EE_Primary_Key_Int_Field( 'LIN_ID', __( "ID", "event_espresso" ) ),
117
-				'LIN_code' 			=> new EE_Slug_Field( 'LIN_code', __( "Code for index into Cart", "event_espresso" ), TRUE ),
118
-				'TXN_ID' 				=> new EE_Foreign_Key_Int_Field( 'TXN_ID', __( "Transaction ID", "event_espresso" ), TRUE, NULL, 'Transaction' ),
119
-				'LIN_name' 			=> new EE_Full_HTML_Field( 'LIN_name', __( "Line Item Name", "event_espresso" ), FALSE, '' ),
120
-				'LIN_desc' 			=> new EE_Full_HTML_Field( 'LIN_desc', __( "Line Item Description", "event_espresso" ), TRUE ),
121
-				'LIN_unit_price' 	=> new EE_Money_Field( 'LIN_unit_price', __( "Unit Price", "event_espresso" ), FALSE, 0 ),
122
-				'LIN_percent' 		=> new EE_Float_Field( 'LIN_percent', __( "Percent", "event_espresso" ), FALSE, 0 ),
123
-				'LIN_is_taxable' 	=> new EE_Boolean_Field( 'LIN_is_taxable', __( "Taxable", "event_espresso" ), FALSE, FALSE ),
124
-				'LIN_order' 			=> new EE_Integer_Field( 'LIN_order', __( "Order of Application towards total of parent", "event_espresso" ), FALSE, 1 ),
125
-				'LIN_total' 			=> new EE_Money_Field( 'LIN_total', __( "Total (unit price x quantity)", "event_espresso" ), FALSE, 0 ),
126
-				'LIN_quantity' 	=> new EE_Integer_Field( 'LIN_quantity', __( "Quantity", "event_espresso" ), TRUE, NULL ),
127
-				'LIN_parent' 		=> new EE_Integer_Field( 'LIN_parent', __( "Parent ID (this item goes towards that Line Item's total)", "event_espresso" ), TRUE, NULL ),
128
-				'LIN_type' 			=> new EE_Enum_Text_Field( 'LIN_type', __( "Type", "event_espresso" ), FALSE, 'line-item', array(
116
+				'LIN_ID' 				=> new EE_Primary_Key_Int_Field('LIN_ID', __("ID", "event_espresso")),
117
+				'LIN_code' 			=> new EE_Slug_Field('LIN_code', __("Code for index into Cart", "event_espresso"), TRUE),
118
+				'TXN_ID' 				=> new EE_Foreign_Key_Int_Field('TXN_ID', __("Transaction ID", "event_espresso"), TRUE, NULL, 'Transaction'),
119
+				'LIN_name' 			=> new EE_Full_HTML_Field('LIN_name', __("Line Item Name", "event_espresso"), FALSE, ''),
120
+				'LIN_desc' 			=> new EE_Full_HTML_Field('LIN_desc', __("Line Item Description", "event_espresso"), TRUE),
121
+				'LIN_unit_price' 	=> new EE_Money_Field('LIN_unit_price', __("Unit Price", "event_espresso"), FALSE, 0),
122
+				'LIN_percent' 		=> new EE_Float_Field('LIN_percent', __("Percent", "event_espresso"), FALSE, 0),
123
+				'LIN_is_taxable' 	=> new EE_Boolean_Field('LIN_is_taxable', __("Taxable", "event_espresso"), FALSE, FALSE),
124
+				'LIN_order' 			=> new EE_Integer_Field('LIN_order', __("Order of Application towards total of parent", "event_espresso"), FALSE, 1),
125
+				'LIN_total' 			=> new EE_Money_Field('LIN_total', __("Total (unit price x quantity)", "event_espresso"), FALSE, 0),
126
+				'LIN_quantity' 	=> new EE_Integer_Field('LIN_quantity', __("Quantity", "event_espresso"), TRUE, NULL),
127
+				'LIN_parent' 		=> new EE_Integer_Field('LIN_parent', __("Parent ID (this item goes towards that Line Item's total)", "event_espresso"), TRUE, NULL),
128
+				'LIN_type' 			=> new EE_Enum_Text_Field('LIN_type', __("Type", "event_espresso"), FALSE, 'line-item', array(
129 129
 						self::type_line_item		=>  __("Line Item", "event_espresso"),
130 130
 						self::type_sub_line_item	=>  __("Sub-Item", "event_espresso"),
131 131
 						self::type_sub_total		=>  __("Subtotal", "event_espresso"),
132 132
 						self::type_tax_sub_total 	=> __("Tax Subtotal", "event_espresso"),
133 133
 						self::type_tax					=>  __("Tax", "event_espresso"),
134 134
 						self::type_total				=>  __("Total", "event_espresso"),
135
-						self::type_cancellation	=> __( 'Cancellation', 'event_espresso' )
135
+						self::type_cancellation	=> __('Cancellation', 'event_espresso')
136 136
 					)
137 137
 				),
138
-				'OBJ_ID' 					=> new EE_Foreign_Key_Int_Field( 'OBJ_ID', __( 'ID of Item purchased.', 'event_espresso' ), TRUE, NULL, $line_items_can_be_for ),
139
-				'OBJ_type'				=>new EE_Any_Foreign_Model_Name_Field( 'OBJ_type', __( "Model Name this Line Item is for", "event_espresso" ), TRUE, NULL, $line_items_can_be_for ),
138
+				'OBJ_ID' 					=> new EE_Foreign_Key_Int_Field('OBJ_ID', __('ID of Item purchased.', 'event_espresso'), TRUE, NULL, $line_items_can_be_for),
139
+				'OBJ_type'				=>new EE_Any_Foreign_Model_Name_Field('OBJ_type', __("Model Name this Line Item is for", "event_espresso"), TRUE, NULL, $line_items_can_be_for),
140 140
 			)
141 141
 		);
142 142
 		$this->_model_relations = array(
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		);
147 147
 		$this->_model_chain_to_wp_user = 'Transaction.Registration.Event';
148 148
 		$this->_caps_slug = 'transactions';
149
-		parent::__construct( $timezone );
149
+		parent::__construct($timezone);
150 150
 	}
151 151
 
152 152
 
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
 	 * @param EE_Transaction|int $transaction
158 158
 	 * @return EE_Line_Item[]
159 159
 	 */
160
-	public function get_all_of_type_for_transaction( $line_item_type, $transaction ){
161
-		$transaction = EEM_Transaction::instance()->ensure_is_ID( $transaction );
162
-		return $this->get_all( array( array(
160
+	public function get_all_of_type_for_transaction($line_item_type, $transaction) {
161
+		$transaction = EEM_Transaction::instance()->ensure_is_ID($transaction);
162
+		return $this->get_all(array(array(
163 163
 			'LIN_type' => $line_item_type,
164 164
 			'TXN_ID' => $transaction
165 165
 		)));
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
 	 * (eg shipping, promotions, and miscellaneous other stuff should probably fit in this category)
171 171
 	 * @param EE_Transaction|int $transaction
172 172
 	 */
173
-	public function get_all_non_ticket_line_items_for_transaction( $transaction ) {
174
-		$transaction = EEM_Transaction::instance()->ensure_is_ID( $transaction );
175
-		return $this->get_all( array( array(
173
+	public function get_all_non_ticket_line_items_for_transaction($transaction) {
174
+		$transaction = EEM_Transaction::instance()->ensure_is_ID($transaction);
175
+		return $this->get_all(array(array(
176 176
 			'LIN_type' => self::type_line_item,
177 177
 			'TXN_ID' => $transaction,
178 178
 			'OR' => array(
179
-				'OBJ_type*notticket' => array( '!=', 'Ticket'),
180
-				'OBJ_type*null' => array( 'IS_NULL' ))
179
+				'OBJ_type*notticket' => array('!=', 'Ticket'),
180
+				'OBJ_type*null' => array('IS_NULL'))
181 181
 		)));
182 182
 	}
183 183
 
Please login to merge, or discard this patch.
core/db_models/EEM_Payment.model.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 
18 18
 
19 19
 /**
20
-	 * Status id in esp_status table that represents an approved payment
21
-	 */
20
+ * Status id in esp_status table that represents an approved payment
21
+ */
22 22
 	const status_id_approved = 'PAP';
23 23
 
24 24
 
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 
112 112
 
113 113
 	/**
114
-	*		retrieve  all payments from db for a particular transaction, optionally with
114
+	 *		retrieve  all payments from db for a particular transaction, optionally with
115 115
 	 *		a particular status
116
-	*
117
-	* 		@access		public
118
-	* 		@param		$TXN_ID
116
+	 *
117
+	 * 		@access		public
118
+	 * 		@param		$TXN_ID
119 119
 	 *		@param	string	$status_of_payment one of EEM_Payment::status_id_*, like 'PAP','PCN',etc. If none is provided, gets payments with any status
120
-	*		@return		EE_Payment[]
121
-	*/
120
+	 *		@return		EE_Payment[]
121
+	 */
122 122
 	public function get_payments_for_transaction( $TXN_ID = FALSE, $status_of_payment = null ) {
123 123
 		// all payments for a TXN ordered chronologically
124 124
 		$query_params = array( array( 'TXN_ID' => $TXN_ID ), 'order_by' => array( 'PAY_timestamp' => 'ASC' ));
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 
146 146
 
147 147
 	/**
148
-	*		retrieve  all payments from db between two dates
149
-	*
150
-	* 		@access		public
151
-	* 		@param		string		$start_date
152
-	* 		@param		string		$end_date
153
-	*		@return 	EE_Payment[]
154
-	*/
148
+	 *		retrieve  all payments from db between two dates
149
+	 *
150
+	 * 		@access		public
151
+	 * 		@param		string		$start_date
152
+	 * 		@param		string		$end_date
153
+	 *		@return 	EE_Payment[]
154
+	 */
155 155
 	public function get_payments_made_between_dates( $start_date = '', $end_date = '' ) {
156 156
 		// initial values
157 157
 		$start_date = ! empty( $start_date ) ? $start_date : date('Y-m-d',current_time('timestamp'));
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
  * Payment Model
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @author				Michael Nelson, Brent Christensen
10 10
  *
11 11
  */
12
-class EEM_Payment extends EEM_Base implements EEMI_Payment{
12
+class EEM_Payment extends EEM_Base implements EEMI_Payment {
13 13
 
14 14
   	// private instance of the Payment object
15 15
 	protected static $_instance = NULL;
@@ -57,28 +57,28 @@  discard block
 block discarded – undo
57 57
 	 *		@param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
58 58
 	 *		@return EEM_Payment
59 59
 	 */
60
-	protected function __construct( $timezone ) {
60
+	protected function __construct($timezone) {
61 61
 
62
-		$this->singular_item = __('Payment','event_espresso');
63
-		$this->plural_item = __('Payments','event_espresso');
62
+		$this->singular_item = __('Payment', 'event_espresso');
63
+		$this->plural_item = __('Payments', 'event_espresso');
64 64
 
65 65
 		$this->_tables = array(
66
-			'Payment'=>new EE_Primary_Table('esp_payment','PAY_ID')
66
+			'Payment'=>new EE_Primary_Table('esp_payment', 'PAY_ID')
67 67
 		);
68 68
 		$this->_fields = array(
69 69
 			'Payment'=>array(
70
-				'PAY_ID'=>new EE_Primary_Key_Int_Field('PAY_ID', __('Payment ID','event_espresso')),
71
-				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso'), false, 0, 'Transaction'),
72
-				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Payment::status_id_failed, 'Status'),
73
-				'PAY_timestamp'=> new EE_Datetime_Field('PAY_timestamp', __('Timestamp of when payment was attempted','event_espresso'), false, current_time('timestamp'), $timezone ),
74
-				'PAY_source'=>new EE_All_Caps_Text_Field('PAY_source', __('User-friendly description of payment','event_espresso'), false, 'CART'),
75
-				'PAY_amount'=>new EE_Money_Field('PAY_amount', __('Amount Payment should be for','event_espresso'), false, 0),
70
+				'PAY_ID'=>new EE_Primary_Key_Int_Field('PAY_ID', __('Payment ID', 'event_espresso')),
71
+				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso'), false, 0, 'Transaction'),
72
+				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Payment::status_id_failed, 'Status'),
73
+				'PAY_timestamp'=> new EE_Datetime_Field('PAY_timestamp', __('Timestamp of when payment was attempted', 'event_espresso'), false, current_time('timestamp'), $timezone),
74
+				'PAY_source'=>new EE_All_Caps_Text_Field('PAY_source', __('User-friendly description of payment', 'event_espresso'), false, 'CART'),
75
+				'PAY_amount'=>new EE_Money_Field('PAY_amount', __('Amount Payment should be for', 'event_espresso'), false, 0),
76 76
 				'PMD_ID'=>new EE_Foreign_Key_Int_Field('PMD_ID', __("Payment Method ID", 'event_espresso'), false, NULL, 'Payment_Method'),
77
-				'PAY_gateway_response'=>new EE_Plain_Text_Field('PAY_gateway_response', __('Response from Gateway about the payment','event_espresso'), false, ''),
78
-				'PAY_txn_id_chq_nmbr'=>new EE_Plain_Text_Field('PAY_txn_id_chq_nmbr', __('Gateway Transaction ID or Cheque Number','event_espresso'), true, ''),
79
-				'PAY_po_number'=>new EE_Plain_Text_Field('PAY_po_number', __('Purchase or Sales Number','event_espresso'), true, ''),
80
-				'PAY_extra_accntng'=>new EE_Simple_HTML_Field('PAY_extra_accntng', __('Extra Account Info','event_espresso'), true, ''),
81
-				'PAY_details'=>new EE_Serialized_Text_Field('PAY_details', __('Full Gateway response about payment','event_espresso'), true, ''),
77
+				'PAY_gateway_response'=>new EE_Plain_Text_Field('PAY_gateway_response', __('Response from Gateway about the payment', 'event_espresso'), false, ''),
78
+				'PAY_txn_id_chq_nmbr'=>new EE_Plain_Text_Field('PAY_txn_id_chq_nmbr', __('Gateway Transaction ID or Cheque Number', 'event_espresso'), true, ''),
79
+				'PAY_po_number'=>new EE_Plain_Text_Field('PAY_po_number', __('Purchase or Sales Number', 'event_espresso'), true, ''),
80
+				'PAY_extra_accntng'=>new EE_Simple_HTML_Field('PAY_extra_accntng', __('Extra Account Info', 'event_espresso'), true, ''),
81
+				'PAY_details'=>new EE_Serialized_Text_Field('PAY_details', __('Full Gateway response about payment', 'event_espresso'), true, ''),
82 82
 				'PAY_redirect_url'=>new EE_Plain_Text_Field('PAY_redirect_url', __("Redirect URL", 'event_espresso'), true),
83 83
 				'PAY_redirect_args'=>new EE_Serialized_Text_Field('PAY_redirect_args', __("Key-Value POST vars to send along with redirect", 'event_espresso'), true)
84 84
 			)
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 			'Payment_Method'=>new EE_Belongs_To_Relation(),
90 90
 		);
91 91
 		$this->_model_chain_to_wp_user = 'Payment_Method';
92
-		parent::__construct( $timezone );
92
+		parent::__construct($timezone);
93 93
 	}
94 94
 
95 95
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @param string $PAY_txn_id_chq_nmbr
102 102
 	 * @return EE_Payment
103 103
 	 */
104
-	public function get_payment_by_txn_id_chq_nmbr( $PAY_txn_id_chq_nmbr ){
104
+	public function get_payment_by_txn_id_chq_nmbr($PAY_txn_id_chq_nmbr) {
105 105
 		return $this->get_one(array(array('PAY_txn_id_chq_nmbr'=>$PAY_txn_id_chq_nmbr)));
106 106
 	}
107 107
 
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 	 *		@param	string	$status_of_payment one of EEM_Payment::status_id_*, like 'PAP','PCN',etc. If none is provided, gets payments with any status
118 118
 	*		@return		EE_Payment[]
119 119
 	*/
120
-	public function get_payments_for_transaction( $TXN_ID = FALSE, $status_of_payment = null ) {
120
+	public function get_payments_for_transaction($TXN_ID = FALSE, $status_of_payment = null) {
121 121
 		// all payments for a TXN ordered chronologically
122
-		$query_params = array( array( 'TXN_ID' => $TXN_ID ), 'order_by' => array( 'PAY_timestamp' => 'ASC' ));
122
+		$query_params = array(array('TXN_ID' => $TXN_ID), 'order_by' => array('PAY_timestamp' => 'ASC'));
123 123
 		// if provided with a status, search specifically for that status. Otherwise get them all
124
-		if ( $status_of_payment ){
124
+		if ($status_of_payment) {
125 125
 			$query_params[0]['STS_ID'] = $status_of_payment;
126 126
 		}
127 127
 		// retrieve payments
128
-		return $this->get_all ( $query_params );
128
+		return $this->get_all($query_params);
129 129
 	}
130 130
 
131 131
 
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 	 * @param int $TXN_ID
136 136
 	 * @return EE_Payment[]
137 137
 	 */
138
-	public function get_approved_payments_for_transaction( $TXN_ID = 0 ) {
139
-		return $this->get_payments_for_transaction( $TXN_ID, EEM_Payment::status_id_approved );
138
+	public function get_approved_payments_for_transaction($TXN_ID = 0) {
139
+		return $this->get_payments_for_transaction($TXN_ID, EEM_Payment::status_id_approved);
140 140
 
141 141
 	}
142 142
 
@@ -150,20 +150,20 @@  discard block
 block discarded – undo
150 150
 	* 		@param		string		$end_date
151 151
 	*		@return 	EE_Payment[]
152 152
 	*/
153
-	public function get_payments_made_between_dates( $start_date = '', $end_date = '' ) {
153
+	public function get_payments_made_between_dates($start_date = '', $end_date = '') {
154 154
 		// initial values
155
-		$start_date = ! empty( $start_date ) ? $start_date : date('Y-m-d',current_time('timestamp'));
156
-		$end_date = ! empty( $end_date ) ? $end_date : date('Y-m-d',current_time('timestamp'));
155
+		$start_date = ! empty($start_date) ? $start_date : date('Y-m-d', current_time('timestamp'));
156
+		$end_date = ! empty($end_date) ? $end_date : date('Y-m-d', current_time('timestamp'));
157 157
 		// make sure our timestamps start and end right at the boundaries for each day
158
-		$start_date = date( 'Y-m-d', strtotime( $start_date )) . ' 00:00:00';
159
-		$end_date = date( 'Y-m-d', strtotime( $end_date )) . ' 23:59:59';
158
+		$start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
159
+		$end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
160 160
 		// convert to timestamps
161
-		$start_date = strtotime( $start_date );
162
-		$end_date = strtotime( $end_date );
161
+		$start_date = strtotime($start_date);
162
+		$end_date = strtotime($end_date);
163 163
 		// make sure our start date is the lowest value and vice versa
164
-		$start_date = min( $start_date, $end_date );
165
-		$end_date = max( $start_date, $end_date );
166
-		return $this->get_all(array(array('PAY_timestamp'=>array('>=',$start_date),'PAY_timestamp*'=>array('<=',$end_date))));
164
+		$start_date = min($start_date, $end_date);
165
+		$end_date = max($start_date, $end_date);
166
+		return $this->get_all(array(array('PAY_timestamp'=>array('>=', $start_date), 'PAY_timestamp*'=>array('<=', $end_date))));
167 167
 	}
168 168
 
169 169
 	/**
@@ -173,35 +173,35 @@  discard block
 block discarded – undo
173 173
 	 * returns a string for the approved status
174 174
 	 * @return 	string
175 175
 	 */
176
-	function approved_status(){
176
+	function approved_status() {
177 177
 		return self::status_id_approved;
178 178
 	}
179 179
 	/**
180 180
 	 * returns a string for the pending status
181 181
 	 * @return 	string
182 182
 	 */
183
-	function pending_status(){
183
+	function pending_status() {
184 184
 		return self::status_id_pending;
185 185
 	}
186 186
 	/**
187 187
 	 * returns a string for the cancelled status
188 188
 	 * @return 	string
189 189
 	 */
190
-	function cancelled_status(){
190
+	function cancelled_status() {
191 191
 		return self::status_id_cancelled;
192 192
 	}
193 193
 	/**
194 194
 	 * returns a string for the failed status
195 195
 	 * @return 	string
196 196
 	 */
197
-	function failed_status(){
197
+	function failed_status() {
198 198
 		return self::status_id_failed;
199 199
 	}
200 200
 	/**
201 201
 	 * returns a string for the declined status
202 202
 	 * @return 	string
203 203
 	 */
204
-	function declined_status(){
204
+	function declined_status() {
205 205
 		return self::status_id_declined;
206 206
 	}
207 207
 
Please login to merge, or discard this patch.
core/db_models/EEM_Price.model.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * 		instantiate a new price object with blank/empty properties
83 83
 	 *
84 84
 	 * 		@access		public
85
-	 * 		@return		mixed		array on success, FALSE on fail
85
+	 * 		@return		boolean		array on success, FALSE on fail
86 86
 	 */
87 87
 	public function get_new_price() {
88 88
 		return $this->create_default_object();
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 * 		retrieve all active prices for a particular event
110 110
 	 *
111 111
 	 * 		@access		public
112
-	 * 		@return 		array				on success
113
-	 * 		@return 		boolean			false on fail
112
+	 * 		@return 		EE_Base_Class[]				on success
113
+	 * 		@return 		EE_Base_Class[]			false on fail
114 114
 	 */
115 115
 	public function get_all_event_prices( $EVT_ID ) {
116 116
 		return $this->get_all(array(
@@ -184,8 +184,6 @@  discard block
 block discarded – undo
184 184
 	 * 		retrieve all prices for an ticket plus default global prices, but not taxes
185 185
 	 *
186 186
 	 * 		@access		public
187
-	 * 		@param int     $TKT          the id of the event.  If not included then we assume that this is a new ticket.
188
-	 * 		@return 		boolean			false on fail
189 187
 	 */
190 188
 	public function get_all_ticket_prices_for_admin( $TKT_ID = FALSE ) {
191 189
 		$ticket_prices = array();
@@ -272,7 +270,7 @@  discard block
 block discarded – undo
272 270
 	 *
273 271
 	 * 		@access		public
274 272
 	 * 		@param 		int 				$type - PRT_ID
275
-	 * 		@return 		boolean		false on fail
273
+	 * 		@return 		EE_Base_Class[]		false on fail
276 274
 	 */
277 275
 	public function get_all_prices_that_are_type($type = FALSE) {
278 276
 		return $this->get_all(array(
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
25
-require_once ( EE_CLASSES . 'EE_Price.class.php' );
24
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
25
+require_once (EE_CLASSES.'EE_Price.class.php');
26 26
 
27 27
 
28 28
 class EEM_Price extends EEM_Soft_Delete_Base {
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
 	 * 		@param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).  Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
40 40
 	 * 		@return void
41 41
 	 */
42
-	protected function __construct( $timezone ) {
43
-		require_once( EE_MODELS . 'EEM_Price_Type.model.php');
44
-		$this->singular_item = __('Price','event_espresso');
45
-		$this->plural_item = __('Prices','event_espresso');
42
+	protected function __construct($timezone) {
43
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
44
+		$this->singular_item = __('Price', 'event_espresso');
45
+		$this->plural_item = __('Prices', 'event_espresso');
46 46
 
47 47
 		$this->_tables = array(
48
-			'Price'=>new EE_Primary_Table('esp_price','PRC_ID')
48
+			'Price'=>new EE_Primary_Table('esp_price', 'PRC_ID')
49 49
 		);
50 50
 		$this->_fields = array(
51 51
 			'Price'=> array(
52 52
 				'PRC_ID'=>new EE_Primary_Key_Int_Field('PRC_ID', 'Price ID'),
53
-				'PRT_ID'=>new EE_Foreign_Key_Int_Field('PRT_ID', 'Price type Id', false,  NULL, 'Price_Type'),
53
+				'PRT_ID'=>new EE_Foreign_Key_Int_Field('PRT_ID', 'Price type Id', false, NULL, 'Price_Type'),
54 54
 				'PRC_amount'=>new EE_Money_Field('PRC_amount', 'Price Amount', false, 0),
55 55
 				'PRC_name'=>new EE_Plain_Text_Field('PRC_name', 'Name of Price', false, ''),
56 56
 				'PRC_desc'=>new EE_Post_Content_Field('PRC_desc', 'Price Description', false, ''),
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 				'PRC_overrides'=>new EE_Integer_Field('PRC_overrides', 'Price ID for a global Price that will be overridden by this Price  ( for replacing default prices )', true, 0),
59 59
 				'PRC_order'=>new EE_Integer_Field('PRC_order', 'Order of Application of Price (lower numbers apply first?)', false, 1),
60 60
 				'PRC_deleted'=>new EE_Trashed_Flag_Field('PRC_deleted', 'Flag Indicating if this has been deleted or not', false, false),
61
-				'PRC_parent' => new EE_Integer_Field('PRC_parent', __('Indicates what PRC_ID is the parent of this PRC_ID'), true, 0 ),
62
-				'PRC_wp_user' => new EE_WP_User_Field('PRC_wp_user', __('Price Creator ID', 'event_espresso'), FALSE ),
61
+				'PRC_parent' => new EE_Integer_Field('PRC_parent', __('Indicates what PRC_ID is the parent of this PRC_ID'), true, 0),
62
+				'PRC_wp_user' => new EE_WP_User_Field('PRC_wp_user', __('Price Creator ID', 'event_espresso'), FALSE),
63 63
 			)
64 64
 		);
65 65
 		$this->_model_relations = array(
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 			'Price_Type'=>new EE_Belongs_To_Relation(),
68 68
 			'WP_User' => new EE_Belongs_To_Relation(),
69 69
 		);
70
-		parent::__construct( $timezone );
70
+		parent::__construct($timezone);
71 71
 
72
-		require_once ( EE_CLASSES . 'EE_Price.class.php' );
72
+		require_once (EE_CLASSES.'EE_Price.class.php');
73 73
 
74 74
 	}
75 75
 
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
 	 * 		@return 		array				on success
110 110
 	 * 		@return 		boolean			false on fail
111 111
 	 */
112
-	public function get_all_event_prices( $EVT_ID ) {
112
+	public function get_all_event_prices($EVT_ID) {
113 113
 		return $this->get_all(array(
114 114
 			array(
115 115
 				'EVT_ID'=>$EVT_ID,
116
-				'Price_Type.PBT_ID'=>array('!=',  EEM_Price_Type::base_type_tax)
116
+				'Price_Type.PBT_ID'=>array('!=', EEM_Price_Type::base_type_tax)
117 117
 			),
118 118
 			'order_by'=>$this->_order_by_array_for_get_all_method()
119 119
 		));
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 	 * 		@return 		array				on success
129 129
 	 * 		@return 		boolean			false on fail
130 130
 	 */
131
-	public function get_all_default_prices( $count = FALSE ) {
131
+	public function get_all_default_prices($count = FALSE) {
132 132
 		$_where = array(
133
-			'Price_Type.PBT_ID'=>array('!=',4),
133
+			'Price_Type.PBT_ID'=>array('!=', 4),
134 134
 			'PRC_deleted' => 0,
135 135
 			'PRC_is_default' => 1
136 136
 		);
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
 	public function get_all_prices_that_are_taxes() {
162 162
 		$taxes = array();
163 163
 		$all_taxes = $this->get_all(array(
164
-			array( 'Price_Type.PBT_ID'=>  EEM_Price_Type::base_type_tax ),
165
-			'order_by' => array( 'Price_Type.PRT_order' => 'ASC', 'PRC_order' => 'ASC' )
164
+			array('Price_Type.PBT_ID'=>  EEM_Price_Type::base_type_tax),
165
+			'order_by' => array('Price_Type.PRT_order' => 'ASC', 'PRC_order' => 'ASC')
166 166
 		));
167 167
 //		$all_taxes = $this->_select_all_prices_where(
168 168
 //				array( 'prt.PBT_ID' => 4, 'prc.PRC_deleted' => FALSE )
169 169
 //		);
170
-		foreach ( $all_taxes as $tax ) {
171
-			$taxes[ $tax->order() ][ $tax->ID() ] = $tax;
170
+		foreach ($all_taxes as $tax) {
171
+			$taxes[$tax->order()][$tax->ID()] = $tax;
172 172
 		}
173 173
 		return $taxes;
174 174
 	}
@@ -184,18 +184,18 @@  discard block
 block discarded – undo
184 184
 	 * 		@param int     $TKT          the id of the event.  If not included then we assume that this is a new ticket.
185 185
 	 * 		@return 		boolean			false on fail
186 186
 	 */
187
-	public function get_all_ticket_prices_for_admin( $TKT_ID = FALSE ) {
187
+	public function get_all_ticket_prices_for_admin($TKT_ID = FALSE) {
188 188
 		$ticket_prices = array();
189
-		if ( empty($TKT_ID) ) {
189
+		if (empty($TKT_ID)) {
190 190
 
191 191
 			//if there is no tkt, get prices with no tkt ID, are global, are not a tax, and are active
192 192
 			//return that list
193 193
 			$ticket_prices = $this->get_all_default_prices();
194 194
 
195
-			if ( $global_prices ) {
195
+			if ($global_prices) {
196 196
 				$array_of_price_objects = array();
197 197
 				foreach ($global_prices as $price) {
198
-						$array_of_price_objects[ $price->type() ][] = $price;
198
+						$array_of_price_objects[$price->type()][] = $price;
199 199
 				}
200 200
 				return $array_of_price_objects;
201 201
 			} else {
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 			));
214 214
 		}
215 215
 
216
-		if ( !empty( $ticket_prices ) ) {
217
-			foreach ( $ticket_prices as $price ) {
218
-				$array_of_price_objects[ $price->type() ][] = $price;
216
+		if ( ! empty($ticket_prices)) {
217
+			foreach ($ticket_prices as $price) {
218
+				$array_of_price_objects[$price->type()][] = $price;
219 219
 			}
220 220
 			return $array_of_price_objects;
221 221
 
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
 	 * 		@access		private
235 235
 	 * 		@return 		boolean			false on fail
236 236
 	 */
237
-	private function _sort_event_prices_by_type( $price_a, $price_b ) {
237
+	private function _sort_event_prices_by_type($price_a, $price_b) {
238 238
 		$PRT = EEM_Price_Type::instance();
239
-		if ( $price_a->type_obj()->order() == $price_b->type_obj()->order() ) {
240
-			return $this->_sort_event_prices_by_order( $price_a, $price_b );
239
+		if ($price_a->type_obj()->order() == $price_b->type_obj()->order()) {
240
+			return $this->_sort_event_prices_by_order($price_a, $price_b);
241 241
 		}
242 242
 		return $price_a->type_obj()->order() < $price_b->type_obj()->order() ? -1 : 1;
243 243
 	}
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
 	 * 		@return 		boolean			false on fail
254 254
 	 */
255 255
 	private function _sort_event_prices_by_order($price_a, $price_b) {
256
-		if ( $price_a->order() == $price_b->order() ) {
257
-			return $this->_sort_event_prices_by_start_date( $price_a, $price_b );
256
+		if ($price_a->order() == $price_b->order()) {
257
+			return $this->_sort_event_prices_by_start_date($price_a, $price_b);
258 258
 		}
259 259
 		return $price_a->order() < $price_b->order() ? -1 : 1;
260 260
 	}
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 * Of course you don't have to use it, but this is the order we usually want to sort prices by
286 286
 	 * @return array which can be used like so: $this->get_all(array(array(...where stuff...),'order_by'=>$this->_order_by_array_for_get_all_method()));
287 287
 	 */
288
-	public function _order_by_array_for_get_all_method(){
288
+	public function _order_by_array_for_get_all_method() {
289 289
 		return array(
290 290
 				'PRC_order'=>'ASC',
291 291
 				'Price_Type.PRT_order'=>'ASC',
Please login to merge, or discard this patch.
core/db_models/EEM_Question.model.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
25
-require_once( EE_CLASSES . 'EE_Question.class.php');
24
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
25
+require_once(EE_CLASSES.'EE_Question.class.php');
26 26
 
27 27
 class EEM_Question extends EEM_Soft_Delete_Base {
28 28
 
@@ -67,42 +67,42 @@  discard block
 block discarded – undo
67 67
 	 * but they can be extended
68 68
 	 * @return string[]
69 69
 	 */
70
-	public function allowed_question_types(){
70
+	public function allowed_question_types() {
71 71
 		return $this->_allowed_question_types;
72 72
 	}
73
-	protected function __construct( $timezone = NULL ) {
74
-		$this->singular_item = __('Question','event_espresso');
75
-		$this->plural_item = __('Questions','event_espresso');
76
-		$this->_allowed_question_types=apply_filters(
73
+	protected function __construct($timezone = NULL) {
74
+		$this->singular_item = __('Question', 'event_espresso');
75
+		$this->plural_item = __('Questions', 'event_espresso');
76
+		$this->_allowed_question_types = apply_filters(
77 77
 			'FHEE__EEM_Question__construct__allowed_question_types',
78 78
 			array(
79
-				EEM_Question::QST_type_text =>__('Text','event_espresso'),
80
-				EEM_Question::QST_type_textarea =>__('Textarea','event_espresso'),
81
-				EEM_Question::QST_type_checkbox =>__('Checkboxes','event_espresso'),
82
-				EEM_Question::QST_type_radio =>__('Radio Buttons','event_espresso'),
83
-				EEM_Question::QST_type_dropdown =>__('Dropdown','event_espresso'),
84
-				EEM_Question::QST_type_state =>__('State/Province Dropdown','event_espresso'),
85
-				EEM_Question::QST_type_country =>__('Country Dropdown','event_espresso'),
86
-				EEM_Question::QST_type_date =>__('Date Picker','event_espresso')
79
+				EEM_Question::QST_type_text =>__('Text', 'event_espresso'),
80
+				EEM_Question::QST_type_textarea =>__('Textarea', 'event_espresso'),
81
+				EEM_Question::QST_type_checkbox =>__('Checkboxes', 'event_espresso'),
82
+				EEM_Question::QST_type_radio =>__('Radio Buttons', 'event_espresso'),
83
+				EEM_Question::QST_type_dropdown =>__('Dropdown', 'event_espresso'),
84
+				EEM_Question::QST_type_state =>__('State/Province Dropdown', 'event_espresso'),
85
+				EEM_Question::QST_type_country =>__('Country Dropdown', 'event_espresso'),
86
+				EEM_Question::QST_type_date =>__('Date Picker', 'event_espresso')
87 87
 			)
88 88
 		);
89 89
 
90 90
 		$this->_tables = array(
91
-			'Question'=>new EE_Primary_Table('esp_question','QST_ID')
91
+			'Question'=>new EE_Primary_Table('esp_question', 'QST_ID')
92 92
 		);
93 93
 		$this->_fields = array(
94 94
 			'Question'=>array(
95
-				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID','event_espresso')),
96
-				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text','event_espresso'), true, ''),
97
-				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)','event_espresso'), true, ''),
98
-				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question','event_espresso'), TRUE, NULL ),
99
-				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type','event_espresso'),false, 'TEXT',$this->_allowed_question_types),
100
-				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?','event_espresso'), false, false),
101
-				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided','event_espresso'), true, ''),
102
-				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order','event_espresso'), false, 0),
103
-				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?','event_espresso'), false, false),
104
-				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID','event_espresso'), false ),
105
-				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted','event_espresso'), false, false)
95
+				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso')),
96
+				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text', 'event_espresso'), true, ''),
97
+				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)', 'event_espresso'), true, ''),
98
+				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question', 'event_espresso'), TRUE, NULL),
99
+				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type', 'event_espresso'), false, 'TEXT', $this->_allowed_question_types),
100
+				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?', 'event_espresso'), false, false),
101
+				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided', 'event_espresso'), true, ''),
102
+				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order', 'event_espresso'), false, 0),
103
+				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?', 'event_espresso'), false, false),
104
+				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID', 'event_espresso'), false),
105
+				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted', 'event_espresso'), false, false)
106 106
 			)
107 107
 		);
108 108
 		$this->_model_relations = array(
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 			'Question_Group_Question'=>new EE_Has_Many_Relation()
115 115
 		);
116 116
 
117
-		parent::__construct( $timezone );
117
+		parent::__construct($timezone);
118 118
 	}
119 119
 
120 120
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 * which system question QST_ID corresponds to the QST_system 'city', use EEM_Question::instance()->get_Question_ID_from_system_string('city');
125 125
 	 * @return int of QST_ID for the question that corresponds to that QST_system
126 126
 	 */
127
-	public function get_Question_ID_from_system_string($QST_system){
127
+	public function get_Question_ID_from_system_string($QST_system) {
128 128
 		 $conversion_array = array(
129 129
 			'fname'=> EEM_Attendee::fname_question_id,
130 130
 			'lname'=> EEM_Attendee::lname_question_id,
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			'phone'=> EEM_Attendee::phone_question_id
139 139
 		);
140 140
 
141
-		return isset( $conversion_array[ $QST_system ] ) ? $conversion_array[ $QST_system ] : NULL;
141
+		return isset($conversion_array[$QST_system]) ? $conversion_array[$QST_system] : NULL;
142 142
 
143 143
 	}
144 144
 
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	public function get_latest_question_order() {
152 152
 		$columns_to_select = array(
153
-			'max_order' => array("MAX(QST_order)","%d")
153
+			'max_order' => array("MAX(QST_order)", "%d")
154 154
 			);
155
-		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select );
155
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
156 156
 		return $max[0]['max_order'];
157 157
 	}
158 158
 
Please login to merge, or discard this patch.
core/db_models/EEM_Question_Group.model.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
25
-require_once( EE_CLASSES . 'EE_Question_Group.class.php');
24
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
25
+require_once(EE_CLASSES.'EE_Question_Group.class.php');
26 26
 class EEM_Question_Group extends EEM_Soft_Delete_Base {
27 27
 	const system_personal = 1;
28 28
 	const system_address = 2;
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	protected static $_instance = NULL;
31 31
 
32 32
 
33
-	protected function __construct( $timezone = NULL ) {
34
-		$this->singular_item = __('Question Group','event_espresso');
35
-		$this->plural_item = __('Question Groups','event_espresso');
33
+	protected function __construct($timezone = NULL) {
34
+		$this->singular_item = __('Question Group', 'event_espresso');
35
+		$this->plural_item = __('Question Groups', 'event_espresso');
36 36
 
37 37
 		$this->_tables = array(
38
-			'Question_Group'=>new EE_Primary_Table('esp_question_group','QSG_ID')
38
+			'Question_Group'=>new EE_Primary_Table('esp_question_group', 'QSG_ID')
39 39
 		);
40 40
 		$this->_fields = array(
41 41
 			'Question_Group'=>array(
42
-				'QSG_ID'=>new EE_Primary_Key_Int_Field('QSG_ID', __('Question Group ID','event_espresso')),
43
-				'QSG_name'=>new EE_Plain_Text_Field('QSG_name', __('Question Group Name','event_espresso'), false, ''),
44
-				'QSG_identifier'=>new EE_Plain_Text_Field('QSG_identifier', __('Text ID for question Group','event_espresso'), false, ''),
45
-				'QSG_desc'=>new EE_Full_HTML_Field('QSG_desc', __('Description of Question Group','event_espresso'), true, ''),
46
-				'QSG_order'=>new EE_Integer_Field('QSG_order', __('Order in which to show the question group','event_espresso'), true, 0),
47
-				'QSG_show_group_name'=>new EE_Boolean_Field('QSG_show_group_name', __('Flag indicating whether to show the group\'s name on the registration page','event_espresso'), false, true),
48
-				'QSG_show_group_desc'=>new EE_Boolean_Field('QSG_show_group_desc', __('Flag indicating whether to show the group\s description on the registration page','event_espresso'), false, false),
49
-				'QSG_wp_user' => new EE_WP_User_Field('QSG_wp_user', __('Question Group Creator ID', 'event_espresso'), FALSE ),
50
-				'QSG_system'=>new EE_Integer_Field('QSG_system', __('Indicate IF this is a system group and if it is what system group it corresponds to.','event_espresso'), false, 0),
51
-				'QSG_deleted'=>new EE_Trashed_Flag_Field('QSG_deleted', __('Flag indicating this question group was deleted','event_espresso'), false, false)
42
+				'QSG_ID'=>new EE_Primary_Key_Int_Field('QSG_ID', __('Question Group ID', 'event_espresso')),
43
+				'QSG_name'=>new EE_Plain_Text_Field('QSG_name', __('Question Group Name', 'event_espresso'), false, ''),
44
+				'QSG_identifier'=>new EE_Plain_Text_Field('QSG_identifier', __('Text ID for question Group', 'event_espresso'), false, ''),
45
+				'QSG_desc'=>new EE_Full_HTML_Field('QSG_desc', __('Description of Question Group', 'event_espresso'), true, ''),
46
+				'QSG_order'=>new EE_Integer_Field('QSG_order', __('Order in which to show the question group', 'event_espresso'), true, 0),
47
+				'QSG_show_group_name'=>new EE_Boolean_Field('QSG_show_group_name', __('Flag indicating whether to show the group\'s name on the registration page', 'event_espresso'), false, true),
48
+				'QSG_show_group_desc'=>new EE_Boolean_Field('QSG_show_group_desc', __('Flag indicating whether to show the group\s description on the registration page', 'event_espresso'), false, false),
49
+				'QSG_wp_user' => new EE_WP_User_Field('QSG_wp_user', __('Question Group Creator ID', 'event_espresso'), FALSE),
50
+				'QSG_system'=>new EE_Integer_Field('QSG_system', __('Indicate IF this is a system group and if it is what system group it corresponds to.', 'event_espresso'), false, 0),
51
+				'QSG_deleted'=>new EE_Trashed_Flag_Field('QSG_deleted', __('Flag indicating this question group was deleted', 'event_espresso'), false, false)
52 52
 			)
53 53
 		);
54 54
 		$this->_model_relations = array(
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			'Event_Question_Group'=>new EE_Has_Many_Relation(),
58 58
 			'WP_User' => new EE_Belongs_To_Relation(),
59 59
 		);
60
-		parent::__construct( $timezone );
60
+		parent::__construct($timezone);
61 61
 	}
62 62
 
63 63
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function get_latest_question_group_order() {
71 71
 		$columns_to_select = array(
72
-			'max_order' => array("MAX(QSG_order)","%d")
72
+			'max_order' => array("MAX(QSG_order)", "%d")
73 73
 			);
74
-		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select );
74
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
75 75
 		return $max[0]['max_order'];
76 76
 	}
77 77
 
Please login to merge, or discard this patch.
core/db_models/EEM_Question_Group_Question.model.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,33 +26,33 @@
 block discarded – undo
26 26
  *
27 27
  * ------------------------------------------------------------------------
28 28
  */
29
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
30
-require_once( EE_CLASSES . 'EE_Question_Group_Question.class.php');
29
+require_once (EE_MODELS.'EEM_Base.model.php');
30
+require_once(EE_CLASSES.'EE_Question_Group_Question.class.php');
31 31
 class EEM_Question_Group_Question extends EEM_Base {
32 32
 
33 33
   	// private instance of the Attendee object
34 34
 	protected static $_instance = NULL;
35 35
 
36 36
 
37
-	protected function __construct( $timezone = NULL ) {
38
-		$this->singular_item = __('Question Group to Question Link','event_espresso');
39
-		$this->plural_item = __('Question Group to Question Links','event_espresso');
37
+	protected function __construct($timezone = NULL) {
38
+		$this->singular_item = __('Question Group to Question Link', 'event_espresso');
39
+		$this->plural_item = __('Question Group to Question Links', 'event_espresso');
40 40
 		$this->_tables = array(
41
-			'Question_Group_Question'=>new EE_Primary_Table('esp_question_group_question','QGQ_ID')
41
+			'Question_Group_Question'=>new EE_Primary_Table('esp_question_group_question', 'QGQ_ID')
42 42
 		);
43 43
 		$this->_fields = array(
44 44
 			'Question_Group_Question'=>array(
45
-				'QGQ_ID'=>new EE_Primary_Key_Int_Field('QGQ_ID', __('Question Group to Question Link ID','event_espresso')),
46
-				'QSG_ID'=>new EE_Foreign_Key_Int_Field('QSG_ID', __('Question Group ID','event_espresso'), false, 0, 'Question_Group'),
47
-				'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question Id','event_espresso'), false, 0, 'Question'),
48
-				'QGQ_order' => new EE_Integer_Field('QGQ_order', __('Question Group Question Order', 'event_espresso'), false, 0 )
45
+				'QGQ_ID'=>new EE_Primary_Key_Int_Field('QGQ_ID', __('Question Group to Question Link ID', 'event_espresso')),
46
+				'QSG_ID'=>new EE_Foreign_Key_Int_Field('QSG_ID', __('Question Group ID', 'event_espresso'), false, 0, 'Question_Group'),
47
+				'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question Id', 'event_espresso'), false, 0, 'Question'),
48
+				'QGQ_order' => new EE_Integer_Field('QGQ_order', __('Question Group Question Order', 'event_espresso'), false, 0)
49 49
 			)
50 50
 		);
51 51
 		$this->_model_relations = array(
52 52
 			'Question_Group'=>new EE_Belongs_To_Relation(),
53 53
 			'Question'=>new EE_Belongs_To_Relation()
54 54
 		);
55
-		parent::__construct( $timezone );
55
+		parent::__construct($timezone);
56 56
 	}
57 57
 
58 58
 
Please login to merge, or discard this patch.