Completed
Branch BETA-4.9-message-activity (ed01ff)
by
unknown
29:14 queued 12:37
created
core/db_models/EEM_Question_Group.model.php 2 patches
Spacing   +23 added lines, -23 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(
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 			'WP_User' => new EE_Belongs_To_Relation(),
59 59
 		);
60 60
 		//this model is generally available for reading
61
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
62
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('QSG_system');
63
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('QSG_system');
64
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('QSG_system');
65
-		parent::__construct( $timezone );
61
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
62
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('QSG_system');
63
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('QSG_system');
64
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('QSG_system');
65
+		parent::__construct($timezone);
66 66
 
67 67
 	}
68 68
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function get_latest_question_group_order() {
77 77
 		$columns_to_select = array(
78
-			'max_order' => array("MAX(QSG_order)","%d")
78
+			'max_order' => array("MAX(QSG_order)", "%d")
79 79
 			);
80
-		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select );
80
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
81 81
 		return $max[0]['max_order'];
82 82
 	}
83 83
 
Please login to merge, or discard this patch.
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.
core/db_models/EEM_Question_Group_Question.model.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -26,26 +26,26 @@  discard block
 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(
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
 
56 56
 		$this->_model_chain_to_wp_user = 'Question_Group';
57 57
 		//this model is generally available for reading
58
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
59
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system');
60
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system');
61
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system');
58
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
59
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system');
60
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system');
61
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('Question_Group.QSG_system');
62 62
 		//use the caps for question groups
63 63
 		$this->_caps_slug = 'question_groups';
64
-		parent::__construct( $timezone );
64
+		parent::__construct($timezone);
65 65
 	}
66 66
 
67 67
 
Please login to merge, or discard this patch.
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.
core/db_models/EEM_Registration.model.php 4 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
 
220 220
 
221 221
 	/**
222
-	*		retrieve ALL registrations for a particular Attendee from db
223
-	* 		@access		public
224
-	* 		@param		int		$ATT_ID
225
-	*		@return 	EE_Registration[]
226
-	*/
222
+	 *		retrieve ALL registrations for a particular Attendee from db
223
+	 * 		@access		public
224
+	 * 		@param		int		$ATT_ID
225
+	 *		@return 	EE_Registration[]
226
+	 */
227 227
 	public function get_all_registrations_for_attendee( $ATT_ID = 0 ) {
228 228
 		if ( ! $ATT_ID ) {
229 229
 			return FALSE;
@@ -250,14 +250,14 @@  discard block
 block discarded – undo
250 250
 
251 251
 
252 252
 	/**
253
-	*		retrieve registration for a specific transaction attendee from db
254
-	*
255
-	* 		@access		public
256
-	* 		@param	int	$TXN_ID
257
-	* 		@param    int		$ATT_ID
258
-	* 		@param    int		$att_nmbr 	in case the ATT_ID is the same for multiple registrations (same details used) then the attendee number is required
259
-	*		@return 		mixed		array on success, FALSE on fail
260
-	*/
253
+	 *		retrieve registration for a specific transaction attendee from db
254
+	 *
255
+	 * 		@access		public
256
+	 * 		@param	int	$TXN_ID
257
+	 * 		@param    int		$ATT_ID
258
+	 * 		@param    int		$att_nmbr 	in case the ATT_ID is the same for multiple registrations (same details used) then the attendee number is required
259
+	 *		@return 		mixed		array on success, FALSE on fail
260
+	 */
261 261
 	public function get_registration_for_transaction_attendee( $TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0 ) {
262 262
 		return $this->get_one(array(
263 263
 			array(
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
 
271 271
 
272 272
 	/**
273
-	*		get the number of registrations per day  for the Registration Admin page Reports Tab.
273
+	 *		get the number of registrations per day  for the Registration Admin page Reports Tab.
274 274
 	 *		(doesn't utilize models because it's a fairly specialized query)
275
-	* 		@access		public
275
+	 * 		@access		public
276 276
 	 *		@param $period string which can be passed to php's strtotime function (eg "-1 month")
277 277
 	 *		@return stdClass[] with properties regDate and total
278
-	*/
278
+	 */
279 279
 	public function get_registrations_per_day_report( $period = '-1 month' ) {
280 280
 
281 281
 		$sql_date = $this->convert_datetime_for_query( 'REG_date', date("Y-m-d H:i:s", strtotime($period) ), 'Y-m-d H:i:s', 'UTC' );
@@ -304,11 +304,11 @@  discard block
 block discarded – undo
304 304
 
305 305
 
306 306
 	/**
307
-	*		get the number of registrations per event  for the Registration Admin page Reports Tab
308
-	* 		@access		public
307
+	 *		get the number of registrations per event  for the Registration Admin page Reports Tab
308
+	 * 		@access		public
309 309
 	 * @param $period string which can be passed to php's strtotime function (eg "-1 month")
310 310
 	 *		@return stdClass[] each with properties event_name, reg_limit, and total
311
-	*/
311
+	 */
312 312
 	public function get_registrations_per_event_report( $period = '-1 month' ) {
313 313
 
314 314
 		$date_sql = $this->convert_datetime_for_query( 'REG_date', date( "Y-m-d H:i:s", strtotime( $period )), 'Y-m-d H:i:s', 'UTC' );
Please login to merge, or discard this patch.
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   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@
 block discarded – undo
257 257
 	* 		@param	int	$TXN_ID
258 258
 	* 		@param    int		$ATT_ID
259 259
 	* 		@param    int		$att_nmbr 	in case the ATT_ID is the same for multiple registrations (same details used) then the attendee number is required
260
-	*		@return 		mixed		array on success, FALSE on fail
260
+	*		@return 		EE_Base_Class|null		array on success, FALSE on fail
261 261
 	*/
262 262
 	public function get_registration_for_transaction_attendee( $TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0 ) {
263 263
 		return $this->get_one(array(
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  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_Soft_Delete_Base.model.php' );
3
-require_once ( EE_CLASSES . 'EE_Registration.class.php' );
2
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
3
+require_once (EE_CLASSES.'EE_Registration.class.php');
4 4
 /**
5 5
  *
6 6
  * Registration Model
@@ -92,31 +92,31 @@  discard block
 block discarded – undo
92 92
 	 *    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)
93 93
 	 * @return \EEM_Registration
94 94
 	 */
95
-	protected function __construct( $timezone ) {
96
-		$this->singular_item = __('Registration','event_espresso');
97
-		$this->plural_item = __('Registrations','event_espresso');
95
+	protected function __construct($timezone) {
96
+		$this->singular_item = __('Registration', 'event_espresso');
97
+		$this->plural_item = __('Registrations', 'event_espresso');
98 98
 
99 99
 		$this->_tables = array(
100
-			'Registration'=>new EE_Primary_Table('esp_registration','REG_ID')
100
+			'Registration'=>new EE_Primary_Table('esp_registration', 'REG_ID')
101 101
 		);
102 102
 		$this->_fields = array(
103 103
 			'Registration'=>array(
104
-				'REG_ID'=>new EE_Primary_Key_Int_Field('REG_ID', __('Registration ID','event_espresso')),
105
-				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID','event_espresso'), false, 0, 'Event'),
106
-				'ATT_ID'=>new EE_Foreign_Key_Int_Field('ATT_ID', __('Attendee ID','event_espresso'), false, 0, 'Attendee'),
107
-				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso'), false, 0, 'Transaction'),
108
-				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('Ticket ID','event_espresso'), false, 0, 'Ticket'),
109
-				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Registration::status_id_incomplete, 'Status'),
110
-				'REG_date'=>new EE_Datetime_Field('REG_date', __('Time registration occurred','event_espresso'), false, time(), $timezone ),
111
-				'REG_final_price'=>new EE_Money_Field('REG_final_price', __('Registration\'s share of the transaction total','event_espresso'), false, 0),
112
-				'REG_paid'=>new EE_Money_Field('REG_paid', __('Amount paid to date towards registration','event_espresso'), false, 0),
113
-				'REG_session'=>new EE_Plain_Text_Field('REG_session', __('Session ID of registration','event_espresso'), false, ''),
114
-				'REG_code'=>new EE_Plain_Text_Field('REG_code', __('Unique Code for this registration','event_espresso'), false, ''),
115
-				'REG_url_link'=>new EE_Plain_Text_Field('REG_url_link', __('String to be used in URL for identifying registration','event_espresso'), false, ''),
116
-				'REG_count'=>new EE_Integer_Field('REG_count', __('Count of this registration in the group registration ','event_espresso'), true, 1),
117
-				'REG_group_size'=>new EE_Integer_Field('REG_group_size', __('Number of registrations on this group','event_espresso'), false, 1),
118
-				'REG_att_is_going'=>new EE_Boolean_Field('REG_att_is_going', __('Flag indicating the registrant plans on attending','event_espresso'), false, false),
119
-				'REG_deleted' => new EE_Trashed_Flag_Field('REG_deleted', __('Flag indicating if registration has been archived or not.', 'event_espresso'), false, false )
104
+				'REG_ID'=>new EE_Primary_Key_Int_Field('REG_ID', __('Registration ID', 'event_espresso')),
105
+				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID', 'event_espresso'), false, 0, 'Event'),
106
+				'ATT_ID'=>new EE_Foreign_Key_Int_Field('ATT_ID', __('Attendee ID', 'event_espresso'), false, 0, 'Attendee'),
107
+				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso'), false, 0, 'Transaction'),
108
+				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('Ticket ID', 'event_espresso'), false, 0, 'Ticket'),
109
+				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Registration::status_id_incomplete, 'Status'),
110
+				'REG_date'=>new EE_Datetime_Field('REG_date', __('Time registration occurred', 'event_espresso'), false, time(), $timezone),
111
+				'REG_final_price'=>new EE_Money_Field('REG_final_price', __('Registration\'s share of the transaction total', 'event_espresso'), false, 0),
112
+				'REG_paid'=>new EE_Money_Field('REG_paid', __('Amount paid to date towards registration', 'event_espresso'), false, 0),
113
+				'REG_session'=>new EE_Plain_Text_Field('REG_session', __('Session ID of registration', 'event_espresso'), false, ''),
114
+				'REG_code'=>new EE_Plain_Text_Field('REG_code', __('Unique Code for this registration', 'event_espresso'), false, ''),
115
+				'REG_url_link'=>new EE_Plain_Text_Field('REG_url_link', __('String to be used in URL for identifying registration', 'event_espresso'), false, ''),
116
+				'REG_count'=>new EE_Integer_Field('REG_count', __('Count of this registration in the group registration ', 'event_espresso'), true, 1),
117
+				'REG_group_size'=>new EE_Integer_Field('REG_group_size', __('Number of registrations on this group', 'event_espresso'), false, 1),
118
+				'REG_att_is_going'=>new EE_Boolean_Field('REG_att_is_going', __('Flag indicating the registrant plans on attending', 'event_espresso'), false, false),
119
+				'REG_deleted' => new EE_Trashed_Flag_Field('REG_deleted', __('Flag indicating if registration has been archived or not.', 'event_espresso'), false, false)
120 120
 			)
121 121
 		);
122 122
 		$this->_model_relations = array(
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
 			'Answer'=>new EE_Has_Many_Relation(),
129 129
 			'Checkin'=>new EE_Has_Many_Relation(),
130 130
 			'Registration_Payment' => new EE_Has_Many_Relation(),
131
-			'Payment'=>new EE_HABTM_Relation( 'Registration_Payment' ),
132
-			'Message' => new EE_Has_Many_Any_Relation( false ) //allow deletes even if there are messages in the queue related
131
+			'Payment'=>new EE_HABTM_Relation('Registration_Payment'),
132
+			'Message' => new EE_Has_Many_Any_Relation(false) //allow deletes even if there are messages in the queue related
133 133
 		);
134 134
 		$this->_model_chain_to_wp_user = 'Event';
135 135
 
136
-		parent::__construct( $timezone );
136
+		parent::__construct($timezone);
137 137
 	}
138 138
 
139 139
 
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
 	 *		@param bool  $translated If true will return the values as singular localized strings
167 167
 	 *		@return array
168 168
 	 */
169
-	public static function reg_status_array( $exclude = array(), $translated = FALSE ) {
170
-		EEM_Registration::instance()->_get_registration_status_array( $exclude );
171
-		return $translated ? EEM_Status::instance()->localized_status( self::$_reg_status, FALSE, 'sentence') : self::$_reg_status;
169
+	public static function reg_status_array($exclude = array(), $translated = FALSE) {
170
+		EEM_Registration::instance()->_get_registration_status_array($exclude);
171
+		return $translated ? EEM_Status::instance()->localized_status(self::$_reg_status, FALSE, 'sentence') : self::$_reg_status;
172 172
 	}
173 173
 
174 174
 
@@ -179,19 +179,19 @@  discard block
 block discarded – undo
179 179
 	 * @param array $exclude
180 180
 	 * @return array
181 181
 	 */
182
-	private function _get_registration_status_array( $exclude = array() ) {
182
+	private function _get_registration_status_array($exclude = array()) {
183 183
 		//in the very rare circumstance that we are deleting a model's table's data
184 184
 		//and the table hasn't actually been created, this could have an error
185 185
 		/** @type WPDB $wpdb */
186 186
 		global $wpdb;
187
-		EE_Registry::instance()->load_helper( 'Activation' );
188
-		if( EEH_Activation::table_exists( $wpdb->prefix . 'esp_status' ) ){
189
-			$SQL = 'SELECT STS_ID, STS_code FROM '. $wpdb->prefix . 'esp_status WHERE STS_type = "registration"';
190
-			$results = $wpdb->get_results( $SQL );
187
+		EE_Registry::instance()->load_helper('Activation');
188
+		if (EEH_Activation::table_exists($wpdb->prefix.'esp_status')) {
189
+			$SQL = 'SELECT STS_ID, STS_code FROM '.$wpdb->prefix.'esp_status WHERE STS_type = "registration"';
190
+			$results = $wpdb->get_results($SQL);
191 191
 			self::$_reg_status = array();
192
-			foreach ( $results as $status ) {
193
-				if ( ! in_array( $status->STS_ID, $exclude )) {
194
-					self::$_reg_status[ $status->STS_ID ] = $status->STS_code;
192
+			foreach ($results as $status) {
193
+				if ( ! in_array($status->STS_ID, $exclude)) {
194
+					self::$_reg_status[$status->STS_ID] = $status->STS_code;
195 195
 				}
196 196
 			}
197 197
 		}
@@ -206,15 +206,15 @@  discard block
 block discarded – undo
206 206
 	 * @param  array  $where_params Array of query_params as described in the comments for EEM_Base::get_all()
207 207
 	 * @return wpdb results array
208 208
 	 */
209
-	public function get_reg_months_and_years( $where_params ) {
209
+	public function get_reg_months_and_years($where_params) {
210 210
 		$query_params[0] = $where_params;
211 211
 		$query_params['group_by'] = array('reg_year', 'reg_month');
212
-		$query_params['order_by'] = array( 'REG_date' => 'DESC' );
212
+		$query_params['order_by'] = array('REG_date' => 'DESC');
213 213
 		$columns_to_select = array(
214 214
 			'reg_year' => array('YEAR(REG_date)', '%s'),
215 215
 			'reg_month' => array('MONTHNAME(REG_date)', '%s')
216 216
 			);
217
-		return $this->_get_all_wpdb_results( $query_params, OBJECT, $columns_to_select );
217
+		return $this->_get_all_wpdb_results($query_params, OBJECT, $columns_to_select);
218 218
 	}
219 219
 
220 220
 
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
 	* 		@param		int		$ATT_ID
227 227
 	*		@return 	EE_Registration[]
228 228
 	*/
229
-	public function get_all_registrations_for_attendee( $ATT_ID = 0 ) {
230
-		if ( ! $ATT_ID ) {
229
+	public function get_all_registrations_for_attendee($ATT_ID = 0) {
230
+		if ( ! $ATT_ID) {
231 231
 			return FALSE;
232 232
 		}
233
-		return $this->get_all( array( array( 'ATT_ID' => $ATT_ID )));
233
+		return $this->get_all(array(array('ATT_ID' => $ATT_ID)));
234 234
 	}
235 235
 
236 236
 
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 	 * @param string $REG_url_link
242 242
 	 * @return EE_Registration
243 243
 	 */
244
-	public function get_registration_for_reg_url_link($REG_url_link){
245
-		if(!$REG_url_link){
244
+	public function get_registration_for_reg_url_link($REG_url_link) {
245
+		if ( ! $REG_url_link) {
246 246
 			return false;
247 247
 		}
248 248
 		return $this->get_one(array(array('REG_url_link'=>$REG_url_link)));
@@ -260,13 +260,13 @@  discard block
 block discarded – undo
260 260
 	* 		@param    int		$att_nmbr 	in case the ATT_ID is the same for multiple registrations (same details used) then the attendee number is required
261 261
 	*		@return 		mixed		array on success, FALSE on fail
262 262
 	*/
263
-	public function get_registration_for_transaction_attendee( $TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0 ) {
263
+	public function get_registration_for_transaction_attendee($TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0) {
264 264
 		return $this->get_one(array(
265 265
 			array(
266 266
 				'TXN_ID'=>$TXN_ID,
267 267
 				'ATT_ID'=>$ATT_ID
268 268
 			),
269
-			'limit'=>array( min( ( $att_nmbr-1 ), 0 ), 1 )
269
+			'limit'=>array(min(($att_nmbr - 1), 0), 1)
270 270
 		));
271 271
 	}
272 272
 
@@ -278,17 +278,17 @@  discard block
 block discarded – undo
278 278
 	 *		@param $period string which can be passed to php's strtotime function (eg "-1 month")
279 279
 	 *		@return stdClass[] with properties regDate and total
280 280
 	*/
281
-	public function get_registrations_per_day_report( $period = '-1 month' ) {
281
+	public function get_registrations_per_day_report($period = '-1 month') {
282 282
 
283
-		$sql_date = $this->convert_datetime_for_query( 'REG_date', date("Y-m-d H:i:s", strtotime($period) ), 'Y-m-d H:i:s', 'UTC' );
284
-		$where = array( 'REG_date' => array( '>=', $sql_date ), 'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete ) );
283
+		$sql_date = $this->convert_datetime_for_query('REG_date', date("Y-m-d H:i:s", strtotime($period)), 'Y-m-d H:i:s', 'UTC');
284
+		$where = array('REG_date' => array('>=', $sql_date), 'STS_ID' => array('!=', EEM_Registration::status_id_incomplete));
285 285
 
286
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_day_report' ) ) {
286
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_day_report')) {
287 287
 			$where['Event.EVT_wp_user'] = get_current_user_id();
288 288
 		}
289 289
 
290
-		EE_Registry::instance()->load_helper( 'DTT_Helper' );
291
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'REG_date' );
290
+		EE_Registry::instance()->load_helper('DTT_Helper');
291
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'REG_date');
292 292
 
293 293
 		$results = $this->_get_all_wpdb_results(
294 294
 				array(
@@ -298,8 +298,8 @@  discard block
 block discarded – undo
298 298
 				),
299 299
 				OBJECT,
300 300
 				array(
301
-					'regDate'=>array( 'DATE(' . $query_interval . ')','%s'),
302
-					'total'=>array('count(REG_ID)','%d')
301
+					'regDate'=>array('DATE('.$query_interval.')', '%s'),
302
+					'total'=>array('count(REG_ID)', '%d')
303 303
 				));
304 304
 		return $results;
305 305
 	}
@@ -314,23 +314,23 @@  discard block
 block discarded – undo
314 314
 	 * @return stdClass[] with properties Registration_REG_date and a column for each registration status as the STS_ID
315 315
 	 *                    (i.e. RAP)
316 316
 	 */
317
-	public function get_registrations_per_day_and_per_status_report( $period = '-1 month' ) {
317
+	public function get_registrations_per_day_and_per_status_report($period = '-1 month') {
318 318
 		global $wpdb;
319
-		$registration_table = $wpdb->prefix . 'esp_registration';
319
+		$registration_table = $wpdb->prefix.'esp_registration';
320 320
 		$event_table = $wpdb->posts;
321
-		$sql_date = date("Y-m-d H:i:s", strtotime($period) );
321
+		$sql_date = date("Y-m-d H:i:s", strtotime($period));
322 322
 
323 323
 		//prepare the query interval for displaying offset
324
-		EE_Registry::instance()->load_helper( 'DTT_Helper' );
325
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'dates.REG_date' );
324
+		EE_Registry::instance()->load_helper('DTT_Helper');
325
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'dates.REG_date');
326 326
 
327 327
 		//inner date query
328 328
 		$inner_date_query = "SELECT DISTINCT REG_date from $registration_table ";
329 329
 		$inner_where = " WHERE";
330 330
 		//exclude events not authored by user if permissions in effect
331
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
331
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
332 332
 			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
333
-			$inner_where .= " post_author = " . get_current_user_id() . " AND";
333
+			$inner_where .= " post_author = ".get_current_user_id()." AND";
334 334
 		}
335 335
 		$inner_where .= " REG_date >= '$sql_date'";
336 336
 		$inner_date_query .= $inner_where;
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 		$select_parts = array();
343 343
 
344 344
 		//loop through registration stati to do parts for each status.
345
-		foreach ( EEM_Registration::reg_status_array() as $STS_ID => $STS_code ) {
346
-			if ( $STS_ID === EEM_Registration::status_id_incomplete ) {
345
+		foreach (EEM_Registration::reg_status_array() as $STS_ID => $STS_code) {
346
+			if ($STS_ID === EEM_Registration::status_id_incomplete) {
347 347
 				continue;
348 348
 			}
349 349
 			$select_parts[] = "COUNT($STS_code.REG_ID) as $STS_ID";
@@ -351,14 +351,14 @@  discard block
 block discarded – undo
351 351
 		}
352 352
 
353 353
 		//setup the selects
354
-		$select .= implode(', ', $select_parts );
354
+		$select .= implode(', ', $select_parts);
355 355
 		$select .= " FROM ($inner_date_query) AS dates LEFT JOIN ";
356 356
 
357 357
 		//setup the joins
358
-		$join .= implode( " LEFT JOIN ", $join_parts );
358
+		$join .= implode(" LEFT JOIN ", $join_parts);
359 359
 
360 360
 		//now let's put it all together
361
-		$query = $select . $join . ' GROUP BY Registration_REG_date';
361
+		$query = $select.$join.' GROUP BY Registration_REG_date';
362 362
 
363 363
 		//and execute it
364 364
 		$results = $wpdb->get_results(
@@ -379,23 +379,23 @@  discard block
 block discarded – undo
379 379
 	 * @param $period string which can be passed to php's strtotime function (eg "-1 month")
380 380
 	 *		@return stdClass[] each with properties event_name, reg_limit, and total
381 381
 	*/
382
-	public function get_registrations_per_event_report( $period = '-1 month' ) {
382
+	public function get_registrations_per_event_report($period = '-1 month') {
383 383
 
384
-		$date_sql = $this->convert_datetime_for_query( 'REG_date', date( "Y-m-d H:i:s", strtotime( $period )), 'Y-m-d H:i:s', 'UTC' );
385
-		$where = array( 'REG_date' => array( '>=', $date_sql ), 'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete ) );
384
+		$date_sql = $this->convert_datetime_for_query('REG_date', date("Y-m-d H:i:s", strtotime($period)), 'Y-m-d H:i:s', 'UTC');
385
+		$where = array('REG_date' => array('>=', $date_sql), 'STS_ID' => array('!=', EEM_Registration::status_id_incomplete));
386 386
 
387
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
387
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
388 388
 			$where['Event.EVT_wp_user'] = get_current_user_id();
389 389
 		}
390 390
 		$results = $this->_get_all_wpdb_results(array(
391 391
 			$where,
392 392
 			'group_by'=>'Event.EVT_name',
393 393
 			'order_by'=>'Event.EVT_name',
394
-			'limit'=>array(0,24)),
394
+			'limit'=>array(0, 24)),
395 395
 			OBJECT,
396 396
 			array(
397
-				'event_name'=>array('Event_CPT.post_title','%s'),
398
-				'total'=>array('COUNT(REG_ID)','%s')
397
+				'event_name'=>array('Event_CPT.post_title', '%s'),
398
+				'total'=>array('COUNT(REG_ID)', '%s')
399 399
 			)
400 400
 		);
401 401
 
@@ -413,19 +413,19 @@  discard block
 block discarded – undo
413 413
 	 * @return stdClass[] with properties `Registration_Event` and a column for each registration status as the STS_ID
414 414
 	 *                    (i.e. RAP)
415 415
 	 */
416
-	public function get_registrations_per_event_and_per_status_report( $period = '-1 month' ) {
416
+	public function get_registrations_per_event_and_per_status_report($period = '-1 month') {
417 417
 		global $wpdb;
418
-		$registration_table = $wpdb->prefix . 'esp_registration';
418
+		$registration_table = $wpdb->prefix.'esp_registration';
419 419
 		$event_table = $wpdb->posts;
420
-		$sql_date = date("Y-m-d H:i:s", strtotime($period) );
420
+		$sql_date = date("Y-m-d H:i:s", strtotime($period));
421 421
 
422 422
 		//inner date query
423 423
 		$inner_date_query = "SELECT DISTINCT EVT_ID, REG_date from $registration_table ";
424 424
 		$inner_where = " WHERE";
425 425
 		//exclude events not authored by user if permissions in effect
426
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
426
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
427 427
 			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
428
-			$inner_where .= " post_author = " . get_current_user_id() . " AND";
428
+			$inner_where .= " post_author = ".get_current_user_id()." AND";
429 429
 		}
430 430
 		$inner_where .= " REG_date >= '$sql_date'";
431 431
 		$inner_date_query .= $inner_where;
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
 		$select_parts = array();
438 438
 
439 439
 		//loop through registration stati to do parts for each status.
440
-		foreach ( EEM_Registration::reg_status_array() as $STS_ID => $STS_code ) {
441
-			if ( $STS_ID === EEM_Registration::status_id_incomplete ) {
440
+		foreach (EEM_Registration::reg_status_array() as $STS_ID => $STS_code) {
441
+			if ($STS_ID === EEM_Registration::status_id_incomplete) {
442 442
 				continue;
443 443
 			}
444 444
 			$select_parts[] = "COUNT($STS_code.REG_ID) as $STS_ID";
@@ -446,14 +446,14 @@  discard block
 block discarded – undo
446 446
 		}
447 447
 
448 448
 		//setup the selects
449
-		$select .= implode( ', ', $select_parts );
449
+		$select .= implode(', ', $select_parts);
450 450
 		$select .= " FROM ($inner_date_query) AS dates LEFT JOIN $event_table as Event ON Event.ID = dates.EVT_ID LEFT JOIN ";
451 451
 
452 452
 		//setup remaining joins
453
-		$join .= implode( " LEFT JOIN ", $join_parts );
453
+		$join .= implode(" LEFT JOIN ", $join_parts);
454 454
 
455 455
 		//now put it all together
456
-		$query = $select . $join . ' GROUP BY Registration_Event';
456
+		$query = $select.$join.' GROUP BY Registration_Event';
457 457
 
458 458
 		//and execute
459 459
 		$results = $wpdb->get_results(
@@ -469,11 +469,11 @@  discard block
 block discarded – undo
469 469
 	 * @param int $TXN_ID
470 470
 	 * @return EE_Registration
471 471
 	 */
472
-	public function get_primary_registration_for_transaction_ID( $TXN_ID = 0){
473
-		if( ! $TXN_ID ){
472
+	public function get_primary_registration_for_transaction_ID($TXN_ID = 0) {
473
+		if ( ! $TXN_ID) {
474 474
 			return false;
475 475
 		}
476
-		return $this->get_one(array(array('TXN_ID'=>$TXN_ID,'REG_count'=>  EEM_Registration::PRIMARY_REGISTRANT_COUNT)));
476
+		return $this->get_one(array(array('TXN_ID'=>$TXN_ID, 'REG_count'=>  EEM_Registration::PRIMARY_REGISTRANT_COUNT)));
477 477
 	}
478 478
 
479 479
 
@@ -485,11 +485,11 @@  discard block
 block discarded – undo
485 485
 	 *		@param boolean $for_incomplete_payments
486 486
 	 *		@return int
487 487
 	 */
488
-	public function get_event_registration_count ( $EVT_ID, $for_incomplete_payments = FALSE ) {
488
+	public function get_event_registration_count($EVT_ID, $for_incomplete_payments = FALSE) {
489 489
 		// we only count approved registrations towards registration limits
490
-		$query_params = array( array( 'EVT_ID' => $EVT_ID, 'STS_ID' => self::status_id_approved ) );
491
-		if( $for_incomplete_payments ){
492
-			$query_params[0]['Transaction.STS_ID']=array('!=',  EEM_Transaction::complete_status_code);
490
+		$query_params = array(array('EVT_ID' => $EVT_ID, 'STS_ID' => self::status_id_approved));
491
+		if ($for_incomplete_payments) {
492
+			$query_params[0]['Transaction.STS_ID'] = array('!=', EEM_Transaction::complete_status_code);
493 493
 		}
494 494
 
495 495
 		return $this->count($query_params);
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 		/** @type WPDB $wpdb */
506 506
 		global $wpdb;
507 507
 		return $wpdb->query(
508
-				'DELETE r FROM ' . $this->table() . ' r LEFT JOIN ' . EEM_Transaction::instance()->table() . ' t ON r.TXN_ID = t.TXN_ID WHERE t.TXN_ID IS NULL' );
508
+				'DELETE r FROM '.$this->table().' r LEFT JOIN '.EEM_Transaction::instance()->table().' t ON r.TXN_ID = t.TXN_ID WHERE t.TXN_ID IS NULL' );
509 509
 	}
510 510
 
511 511
 	/**
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 	 * @param boolean $checked_in whether to count registrations checked IN or OUT
516 516
 	 * @return int
517 517
 	 */
518
-	public function count_registrations_checked_into_datetime( $DTT_ID, $checked_in = true) {
518
+	public function count_registrations_checked_into_datetime($DTT_ID, $checked_in = true) {
519 519
 		return $this->count(
520 520
 			array(
521 521
 				array(
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 * @param boolean $checked_in whether to count registrations checked IN or OUT
534 534
 	 * @return int
535 535
 	 */
536
-	public function count_registrations_checked_into_event( $EVT_ID, $checked_in = true ) {
536
+	public function count_registrations_checked_into_event($EVT_ID, $checked_in = true) {
537 537
 		return $this->count(
538 538
 			array(
539 539
 				array(
@@ -556,15 +556,15 @@  discard block
 block discarded – undo
556 556
 	 * @param array $attendee_ids
557 557
 	 * @return EE_Registration[]
558 558
 	 */
559
-	public function get_latest_registration_for_each_of_given_contacts( $attendee_ids = array() ) {
559
+	public function get_latest_registration_for_each_of_given_contacts($attendee_ids = array()) {
560 560
 		//first do a native wp_query to get the latest REG_ID's matching these attendees.
561 561
 		global $wpdb;
562
-		$registration_table = $wpdb->prefix . 'esp_registration';
562
+		$registration_table = $wpdb->prefix.'esp_registration';
563 563
 		$attendee_table = $wpdb->posts;
564
-		$attendee_ids = is_array( $attendee_ids )
565
-			? array_map( 'absint', $attendee_ids )
566
-			: array( (int) $attendee_ids );
567
-		$attendee_ids = implode( ',', $attendee_ids );
564
+		$attendee_ids = is_array($attendee_ids)
565
+			? array_map('absint', $attendee_ids)
566
+			: array((int) $attendee_ids);
567
+		$attendee_ids = implode(',', $attendee_ids);
568 568
 
569 569
 
570 570
 		//first we do a query to get the registration ids
@@ -589,24 +589,24 @@  discard block
 block discarded – undo
589 589
 			ARRAY_A
590 590
 		);
591 591
 
592
-		if ( empty( $registration_ids ) ) {
592
+		if (empty($registration_ids)) {
593 593
 			return array();
594 594
 		}
595 595
 
596 596
 		$ids_for_model_query = array();
597 597
 		//let's flatten the ids so they can be used in the model query.
598
-		foreach ( $registration_ids as $registration_id ) {
599
-			if ( isset( $registration_id['registration_id'] ) ) {
598
+		foreach ($registration_ids as $registration_id) {
599
+			if (isset($registration_id['registration_id'])) {
600 600
 				$ids_for_model_query[] = $registration_id['registration_id'];
601 601
 			}
602 602
 		}
603 603
 
604 604
 		//construct query
605 605
 		$_where = array(
606
-			'REG_ID' => array( 'IN', $ids_for_model_query )
606
+			'REG_ID' => array('IN', $ids_for_model_query)
607 607
 		);
608 608
 
609
-		return $this->get_all( array( $_where ) );
609
+		return $this->get_all(array($_where));
610 610
 	}
611 611
 
612 612
 
Please login to merge, or discard this patch.
core/db_models/EEM_Registration_Payment.model.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,21 +15,21 @@  discard block
 block discarded – undo
15 15
 	protected static $_instance = NULL;
16 16
 
17 17
 
18
-	protected function __construct( $timezone = NULL ) {
18
+	protected function __construct($timezone = NULL) {
19 19
 
20
-		$this->singular_item = __( 'Registration Payment', 'event_espresso' );
21
-		$this->plural_item 	= __( 'Registration Payments', 'event_espresso' );
20
+		$this->singular_item = __('Registration Payment', 'event_espresso');
21
+		$this->plural_item = __('Registration Payments', 'event_espresso');
22 22
 
23 23
 		$this->_tables = array(
24
-			'Registration_Payment' => new EE_Primary_Table( 'esp_registration_payment', 'RPY_ID' )
24
+			'Registration_Payment' => new EE_Primary_Table('esp_registration_payment', 'RPY_ID')
25 25
 		);
26 26
 
27 27
 		$this->_fields = array(
28 28
 			'Registration_Payment'=>array(
29
-				'RPY_ID' 				=> new EE_Primary_Key_Int_Field( 'RPY_ID', __( 'Registration Payment ID', 'event_espresso' )),
30
-				'REG_ID' 				=> new EE_Foreign_Key_Int_Field( 'REG_ID', __( 'Registration ID', 'event_espresso' ), false, 0, 'Registration' ),
31
-				'PAY_ID' 				=> new EE_Foreign_Key_Int_Field( 'PAY_ID', __( 'Payment ID', 'event_espresso' ), true, null, 'Payment' ),
32
-				'RPY_amount' 	=> new EE_Money_Field( 'RPY_amount', __( 'Amount attributed to the registration', 'event_espresso' ), false, 0 ),
29
+				'RPY_ID' 				=> new EE_Primary_Key_Int_Field('RPY_ID', __('Registration Payment ID', 'event_espresso')),
30
+				'REG_ID' 				=> new EE_Foreign_Key_Int_Field('REG_ID', __('Registration ID', 'event_espresso'), false, 0, 'Registration'),
31
+				'PAY_ID' 				=> new EE_Foreign_Key_Int_Field('PAY_ID', __('Payment ID', 'event_espresso'), true, null, 'Payment'),
32
+				'RPY_amount' 	=> new EE_Money_Field('RPY_amount', __('Amount attributed to the registration', 'event_espresso'), false, 0),
33 33
 			)
34 34
 		);
35 35
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			'Payment' 		=> new EE_Belongs_To_Relation(),
39 39
 		);
40 40
 
41
-		parent::__construct( $timezone );
41
+		parent::__construct($timezone);
42 42
 	}
43 43
 
44 44
 
Please login to merge, or discard this patch.
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   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * EEM_Registration_Payment
4
- *
5
- * model for join relationship between registrations, line items and payments
6
- * Client code will probably never need to use this, as you can easily query  the HABTM relationships from the related models
7
- *
8
- * @package			Event Espresso
9
- * @subpackage 	includes/models/
10
- * @author				Brent Christensen
11
- */
3
+	 * EEM_Registration_Payment
4
+	 *
5
+	 * model for join relationship between registrations, line items and payments
6
+	 * Client code will probably never need to use this, as you can easily query  the HABTM relationships from the related models
7
+	 *
8
+	 * @package			Event Espresso
9
+	 * @subpackage 	includes/models/
10
+	 * @author				Brent Christensen
11
+	 */
12 12
 class EEM_Registration_Payment extends EEM_Base {
13 13
 
14 14
   	// private instance
Please login to merge, or discard this patch.
core/db_models/EEM_Status.model.php 3 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  *
14 14
  * ------------------------------------------------------------------------
15 15
  */
16
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
16
+require_once (EE_MODELS.'EEM_Base.model.php');
17 17
 /**
18 18
  *
19 19
  * Class EEM_Status
@@ -32,27 +32,27 @@  discard block
 block discarded – undo
32 32
 	/**
33 33
 	 * @return EEM_Status
34 34
 	 */
35
-	protected function __construct( $timezone = NULL ) {
36
-		$this->singular_item = __('Status','event_espresso');
37
-		$this->plural_item = __('Stati','event_espresso');
35
+	protected function __construct($timezone = NULL) {
36
+		$this->singular_item = __('Status', 'event_espresso');
37
+		$this->plural_item = __('Stati', 'event_espresso');
38 38
 		$this->_tables = array(
39 39
 			'Status'=> new EE_Primary_Table('esp_status', 'STS_ID')
40 40
 		);
41 41
 		$this->_fields = array(
42 42
 			'Status'=>array(
43
-				'STS_ID'=> new EE_Primary_Key_String_Field('STS_ID', __('Status ID','event_espresso')),
44
-				'STS_code'=>new EE_Plain_Text_Field('STS_code',__('Status Code','event_espresso'),false, ''),
43
+				'STS_ID'=> new EE_Primary_Key_String_Field('STS_ID', __('Status ID', 'event_espresso')),
44
+				'STS_code'=>new EE_Plain_Text_Field('STS_code', __('Status Code', 'event_espresso'), false, ''),
45 45
 				'STS_type'=>new EE_Enum_Text_Field('STS_type', __("Type", "event_espresso"), false, 'event',
46 46
 						array(
47
-							'event'=> __("Event", "event_espresso"),//deprecated
47
+							'event'=> __("Event", "event_espresso"), //deprecated
48 48
 							'registration'=>  __("Registration", "event_espresso"),
49 49
 							'transaction'=>  __("Transaction", "event_espresso"),
50 50
 							'payment'=>  __("Payment", "event_espresso"),
51 51
 							'email'=>  __("Email", "event_espresso")
52 52
 						)),
53
-				'STS_can_edit'=>new EE_Boolean_Field('STS_can_edit', __('Editable?','event_espresso'), false),
53
+				'STS_can_edit'=>new EE_Boolean_Field('STS_can_edit', __('Editable?', 'event_espresso'), false),
54 54
 				'STS_desc'=>new EE_Simple_HTML_Field('STS_desc', __("Description", "event_espresso"), false, ''),
55
-				'STS_open'=>new EE_Boolean_Field('STS_open', __("Open?", "event_espresso"), false,false)
55
+				'STS_open'=>new EE_Boolean_Field('STS_open', __("Open?", "event_espresso"), false, false)
56 56
 			));
57 57
 		$this->_model_relations = array(
58 58
 			'Registration'=>new EE_Has_Many_Relation(),
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 			'Payment'=>new EE_Has_Many_Relation()
61 61
 		);
62 62
 		//this model is generally available for reading
63
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
63
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
64 64
 
65
-		parent::__construct( $timezone );
65
+		parent::__construct($timezone);
66 66
 	}
67 67
 
68 68
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @throws EE_Error
76 76
 	 * @return array             an array of translated strings for the incoming status id.
77 77
 	 */
78
-	public function localized_status(  $statuses, $plural = FALSE, $schema = 'upper' ) {
78
+	public function localized_status($statuses, $plural = FALSE, $schema = 'upper') {
79 79
 		//note these are all in lower case because ucwords() on upper case will NOT convert.
80 80
 		$translation_array = array(
81 81
 	     	EEM_Registration::status_id_pending_payment => array(
@@ -205,30 +205,30 @@  discard block
 block discarded – undo
205 205
 	  			)
206 206
 	    );
207 207
 
208
-		$translation_array = apply_filters( 'FHEE__EEM_Status__localized_status__translation_array', $translation_array );
208
+		$translation_array = apply_filters('FHEE__EEM_Status__localized_status__translation_array', $translation_array);
209 209
 
210
-		if ( !is_array($statuses) )
211
-			throw new EE_Error( __('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso') );
210
+		if ( ! is_array($statuses))
211
+			throw new EE_Error(__('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso'));
212 212
 
213 213
 	    $translation = array();
214 214
 
215
-	    foreach ( $statuses as $id => $code ) {
216
-	    	if ( isset( $translation_array[$id] ) ) {
215
+	    foreach ($statuses as $id => $code) {
216
+	    	if (isset($translation_array[$id])) {
217 217
 	    		$translation[$id] = $plural ? $translation_array[$id][1] : $translation_array[$id][0];
218 218
 	    	} else {
219 219
 	    		$translation[$id] = $code;
220 220
 	    	}
221 221
 
222 222
 	    	//schema
223
-	    	switch ( $schema ) {
223
+	    	switch ($schema) {
224 224
 	    		case 'lower' :
225
-	    			$translation[$id] = strtolower( $translation[$id] ); //even though these start in lower case, this will catch any statuses added via filter.
225
+	    			$translation[$id] = strtolower($translation[$id]); //even though these start in lower case, this will catch any statuses added via filter.
226 226
 	    			break;
227 227
 	    		case 'sentence' :
228
-	    			$translation[$id] = ucwords( $translation[$id] );
228
+	    			$translation[$id] = ucwords($translation[$id]);
229 229
 	    			break;
230 230
 	    		case 'upper' :
231
-	    			$translation[$id] = strtoupper( $translation[$id] );
231
+	    			$translation[$id] = strtoupper($translation[$id]);
232 232
 	    			break;
233 233
 	    	}
234 234
 	    }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 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
  *
@@ -207,8 +209,9 @@  discard block
 block discarded – undo
207 209
 
208 210
 		$translation_array = apply_filters( 'FHEE__EEM_Status__localized_status__translation_array', $translation_array );
209 211
 
210
-		if ( !is_array($statuses) )
211
-			throw new EE_Error( __('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso') );
212
+		if ( !is_array($statuses) ) {
213
+					throw new EE_Error( __('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso') );
214
+		}
212 215
 
213 216
 	    $translation = array();
214 217
 
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author				Seth Shoultes
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
- * @ link					http://www.eventespresso.com
12
- * @ version		 	4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author				Seth Shoultes
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
+	 * @ link					http://www.eventespresso.com
12
+	 * @ version		 	4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 */
16 16
 require_once ( EE_MODELS . 'EEM_Base.model.php' );
17 17
 /**
18
- *
19
- * Class EEM_Status
20
- *
21
- * @package 			Event Espresso
22
- * @subpackage		includes/models/
23
- * @author 				Michael Nelson
24
- * @since                EE4
25
- */
18
+	 *
19
+	 * Class EEM_Status
20
+	 *
21
+	 * @package 			Event Espresso
22
+	 * @subpackage		includes/models/
23
+	 * @author 				Michael Nelson
24
+	 * @since                EE4
25
+	 */
26 26
 class EEM_Status extends EEM_Base {
27 27
 
28 28
   	// private instance of the Attendee object
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	public function localized_status(  $statuses, $plural = FALSE, $schema = 'upper' ) {
84 84
 		//note these are all in lower case because ucwords() on upper case will NOT convert.
85 85
 		$translation_array = array(
86
-	     	EEM_Registration::status_id_pending_payment => array(
86
+		 	EEM_Registration::status_id_pending_payment => array(
87 87
 				__('pending payment', 'event_espresso'), //singular
88 88
 				__('pending payments', 'event_espresso') //plural
89 89
 			),
@@ -217,18 +217,18 @@  discard block
 block discarded – undo
217 217
 				__('queued for sending', 'event_espresso'),
218 218
 				__('queued for sending', 'event_espresso'),
219 219
 			),
220
-	        EEM_Message::status_failed => array(
221
-		        __('failed', 'event_espresso'),
222
-		        __('failed', 'event_espresso'),
223
-	        ),
224
-	        EEM_Message::status_resend => array(
225
-		        __('queued for resending', 'event_espresso'),
226
-		        __('queued for resending', 'event_espresso'),
227
-	        ),
228
-	        EEM_Message::status_incomplete => array(
229
-		        __('queued for generating', 'event_espresso'),
230
-		        __('queued for generating', 'event_espresso'),
231
-	        ),
220
+			EEM_Message::status_failed => array(
221
+				__('failed', 'event_espresso'),
222
+				__('failed', 'event_espresso'),
223
+			),
224
+			EEM_Message::status_resend => array(
225
+				__('queued for resending', 'event_espresso'),
226
+				__('queued for resending', 'event_espresso'),
227
+			),
228
+			EEM_Message::status_incomplete => array(
229
+				__('queued for generating', 'event_espresso'),
230
+				__('queued for generating', 'event_espresso'),
231
+			),
232 232
 			EEM_Message::status_retry => array(
233 233
 				__('failed sending, can be retried', 'event_espresso'),
234 234
 				__('failed sending, can be retried', 'event_espresso'),
@@ -257,37 +257,37 @@  discard block
 block discarded – undo
257 257
 	  			__('trashed', 'event_espresso'),
258 258
 	  			__('trashed', 'event_espresso')
259 259
   			),
260
-	    );
260
+		);
261 261
 
262 262
 		$translation_array = apply_filters( 'FHEE__EEM_Status__localized_status__translation_array', $translation_array );
263 263
 
264 264
 		if ( !is_array($statuses) )
265 265
 			throw new EE_Error( __('The incoming statuses argument must be an array with keys as the $status_id and values as the $status_code', 'event_espresso') );
266 266
 
267
-	    $translation = array();
267
+		$translation = array();
268 268
 
269
-	    foreach ( $statuses as $id => $code ) {
270
-	    	if ( isset( $translation_array[$id] ) ) {
271
-	    		$translation[$id] = $plural ? $translation_array[$id][1] : $translation_array[$id][0];
272
-	    	} else {
273
-	    		$translation[$id] = $code;
274
-	    	}
269
+		foreach ( $statuses as $id => $code ) {
270
+			if ( isset( $translation_array[$id] ) ) {
271
+				$translation[$id] = $plural ? $translation_array[$id][1] : $translation_array[$id][0];
272
+			} else {
273
+				$translation[$id] = $code;
274
+			}
275 275
 
276
-	    	//schema
277
-	    	switch ( $schema ) {
278
-	    		case 'lower' :
279
-	    			$translation[$id] = strtolower( $translation[$id] ); //even though these start in lower case, this will catch any statuses added via filter.
280
-	    			break;
281
-	    		case 'sentence' :
282
-	    			$translation[$id] = ucwords( $translation[$id] );
283
-	    			break;
284
-	    		case 'upper' :
285
-	    			$translation[$id] = strtoupper( $translation[$id] );
286
-	    			break;
287
-	    	}
288
-	    }
276
+			//schema
277
+			switch ( $schema ) {
278
+				case 'lower' :
279
+					$translation[$id] = strtolower( $translation[$id] ); //even though these start in lower case, this will catch any statuses added via filter.
280
+					break;
281
+				case 'sentence' :
282
+					$translation[$id] = ucwords( $translation[$id] );
283
+					break;
284
+				case 'upper' :
285
+					$translation[$id] = strtoupper( $translation[$id] );
286
+					break;
287
+			}
288
+		}
289 289
 
290
-	    return $translation;
290
+		return $translation;
291 291
 	}
292 292
 
293 293
 
Please login to merge, or discard this patch.
core/db_models/EEM_Term.model.php 2 patches
Spacing   +48 added lines, -48 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
  *
@@ -20,58 +20,58 @@  discard block
 block discarded – undo
20 20
 	/**
21 21
 	 *__construct
22 22
 	 */
23
-	protected function __construct( $timezone = NULL ) {
24
-		$this->singular_item = __('Term','event_espresso');
25
-		$this->plural_item = __('Terms','event_espresso');
23
+	protected function __construct($timezone = NULL) {
24
+		$this->singular_item = __('Term', 'event_espresso');
25
+		$this->plural_item = __('Terms', 'event_espresso');
26 26
 		$this->_tables = array(
27 27
 			'Term'=> new EE_Primary_Table('terms', 'term_id')
28 28
 		);
29 29
 		$this->_fields = array(
30 30
 			'Term'=>array(
31
-				'term_id'=> new EE_Primary_Key_Int_Field('term_id', __('Term ID','event_espresso')),
32
-				'name'=>new EE_Plain_Text_Field('name',__('Term Name','event_espresso'),false, ''),
33
-				'slug'=>new EE_Slug_Field('slug', __('Term Slug','event_espresso'), false),
31
+				'term_id'=> new EE_Primary_Key_Int_Field('term_id', __('Term ID', 'event_espresso')),
32
+				'name'=>new EE_Plain_Text_Field('name', __('Term Name', 'event_espresso'), false, ''),
33
+				'slug'=>new EE_Slug_Field('slug', __('Term Slug', 'event_espresso'), false),
34 34
 				'term_group'=>new EE_Integer_Field('term_group', __("Term Group", "event_espresso"), false, 0)
35 35
 			));
36 36
 		$this->_model_relations = array(
37 37
 			'Term_Taxonomy'=>new EE_Has_Many_Relation(),
38 38
 		);
39 39
 		$path_to_tax_model = 'Term_Taxonomy';
40
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
41
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Taxonomy_Protected( $path_to_tax_model );
42
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = false;
43
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = false;
40
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
41
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Taxonomy_Protected($path_to_tax_model);
42
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = false;
43
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = false;
44 44
 
45
-		$path_to_tax_model = $path_to_tax_model . '.';
45
+		$path_to_tax_model = $path_to_tax_model.'.';
46 46
 		//add cap restrictions for editing relating to the "ee_edit_*"
47
-		$this->_cap_restrictions[ EEM_Base::caps_edit ]['ee_edit_event_category'] = new EE_Default_Where_Conditions(
47
+		$this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_event_category'] = new EE_Default_Where_Conditions(
48 48
 				array(
49
-					$path_to_tax_model . 'taxonomy*ee_edit_event_category' => array( '!=', 'espresso_event_categories' )
49
+					$path_to_tax_model.'taxonomy*ee_edit_event_category' => array('!=', 'espresso_event_categories')
50 50
 				));
51
-		$this->_cap_restrictions[ EEM_Base::caps_edit ]['ee_edit_venue_category'] = new EE_Default_Where_Conditions(
51
+		$this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_venue_category'] = new EE_Default_Where_Conditions(
52 52
 				array(
53
-					$path_to_tax_model . 'taxonomy*ee_edit_venue_category' => array( '!=', 'espresso_venue_categories' )
53
+					$path_to_tax_model.'taxonomy*ee_edit_venue_category' => array('!=', 'espresso_venue_categories')
54 54
 				));
55
-		$this->_cap_restrictions[ EEM_Base::caps_edit ]['ee_edit_event_type'] = new EE_Default_Where_Conditions(
55
+		$this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_event_type'] = new EE_Default_Where_Conditions(
56 56
 				array(
57
-					$path_to_tax_model . 'taxonomy*ee_edit_event_type' => array( '!=', 'espresso_event_type' )
57
+					$path_to_tax_model.'taxonomy*ee_edit_event_type' => array('!=', 'espresso_event_type')
58 58
 				));
59 59
 
60 60
 		//add cap restrictions for deleting relating to the "ee_deleting_*"
61
-		$this->_cap_restrictions[ EEM_Base::caps_delete ]['ee_delete_event_category'] = new EE_Default_Where_Conditions(
61
+		$this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_event_category'] = new EE_Default_Where_Conditions(
62 62
 				array(
63
-					$path_to_tax_model . 'taxonomy*ee_delete_event_category' => array( '!=', 'espresso_event_categories' )
63
+					$path_to_tax_model.'taxonomy*ee_delete_event_category' => array('!=', 'espresso_event_categories')
64 64
 				));
65
-		$this->_cap_restrictions[ EEM_Base::caps_delete ]['ee_delete_venue_category'] = new EE_Default_Where_Conditions(
65
+		$this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_venue_category'] = new EE_Default_Where_Conditions(
66 66
 				array(
67
-					$path_to_tax_model . 'taxonomy*ee_delete_venue_category' => array( '!=', 'espresso_venue_categories' )
67
+					$path_to_tax_model.'taxonomy*ee_delete_venue_category' => array('!=', 'espresso_venue_categories')
68 68
 				));
69
-		$this->_cap_restrictions[ EEM_Base::caps_delete ]['ee_delete_event_type'] = new EE_Default_Where_Conditions(
69
+		$this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_event_type'] = new EE_Default_Where_Conditions(
70 70
 				array(
71
-					$path_to_tax_model . 'taxonomy*ee_delete_event_type' => array( '!=', 'espresso_event_type' )
71
+					$path_to_tax_model.'taxonomy*ee_delete_event_type' => array('!=', 'espresso_event_type')
72 72
 				));
73 73
 
74
-		parent::__construct( $timezone );
74
+		parent::__construct($timezone);
75 75
 	}
76 76
 
77 77
 
@@ -82,20 +82,20 @@  discard block
 block discarded – undo
82 82
 	 *
83 83
 	 * @access public
84 84
 	 */
85
-	public function get_all_ee_categories( $show_uncategorized = FALSE ) {
85
+	public function get_all_ee_categories($show_uncategorized = FALSE) {
86 86
 
87 87
 		$where_params = array(
88 88
 			'Term_Taxonomy.taxonomy' => 'espresso_event_categories',
89
-			'NOT' => array( 'name' => __( 'Uncategorized', 'event_espresso' ))
89
+			'NOT' => array('name' => __('Uncategorized', 'event_espresso'))
90 90
 		);
91 91
 
92
-		if ( $show_uncategorized ) {
93
-			unset( $where_params['NOT'] );
92
+		if ($show_uncategorized) {
93
+			unset($where_params['NOT']);
94 94
 		}
95 95
 
96
-	 	return EEM_Term::instance()->get_all( array(
96
+	 	return EEM_Term::instance()->get_all(array(
97 97
 			$where_params,
98
-			'order_by' => array( 'name' => 'ASC' )
98
+			'order_by' => array('name' => 'ASC')
99 99
 		));
100 100
 	}
101 101
 
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	 * @param string $post_type
109 109
 	 * @return array
110 110
 	 */
111
-	public function get_all_CPT_post_tags( $post_type = '' ) {
112
-		switch( $post_type ) {
111
+	public function get_all_CPT_post_tags($post_type = '') {
112
+		switch ($post_type) {
113 113
 			case 'espresso_events' :
114 114
 				return $this->get_all_event_post_tags();
115 115
 				break;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			default :
120 120
 				$event_tags = $this->get_all_event_post_tags();
121 121
 				$venue_tags = $this->get_all_venue_post_tags();
122
-				return array_merge( $event_tags, $venue_tags );
122
+				return array_merge($event_tags, $venue_tags);
123 123
 		}
124 124
 		return array();
125 125
 	}
@@ -132,19 +132,19 @@  discard block
 block discarded – undo
132 132
 	 * @return EE_Soft_Delete_Base_Class[]
133 133
 	 */
134 134
 	public function get_all_event_post_tags() {
135
-	 	$post_tags = EEM_Term::instance()->get_all( array(
135
+	 	$post_tags = EEM_Term::instance()->get_all(array(
136 136
 			array(
137 137
 				'Term_Taxonomy.taxonomy' => 'post_tag',
138 138
 				'Term_Taxonomy.Event.post_type' => 'espresso_events',
139 139
 			),
140
-			'order_by' => array( 'name' => 'ASC' ),
141
-			'force_join' => array( 'Term_Taxonomy.Event' )
140
+			'order_by' => array('name' => 'ASC'),
141
+			'force_join' => array('Term_Taxonomy.Event')
142 142
 		));
143
-		foreach ( $post_tags as $key => $post_tag ) {
144
-			if ( ! isset( $post_tags[ $key ]->post_type )) {
145
-				$post_tags[ $key ]->post_type = array();
143
+		foreach ($post_tags as $key => $post_tag) {
144
+			if ( ! isset($post_tags[$key]->post_type)) {
145
+				$post_tags[$key]->post_type = array();
146 146
 			}
147
-			$post_tags[ $key ]->post_type[] = 'espresso_events';
147
+			$post_tags[$key]->post_type[] = 'espresso_events';
148 148
 		}
149 149
 		return $post_tags;
150 150
 //		return array( 'espresso_events' => $post_tags );
@@ -158,19 +158,19 @@  discard block
 block discarded – undo
158 158
 	 * @return EE_Soft_Delete_Base_Class[]
159 159
 	 */
160 160
 	public function get_all_venue_post_tags() {
161
-		$post_tags = EEM_Term::instance()->get_all( array(
161
+		$post_tags = EEM_Term::instance()->get_all(array(
162 162
 			array(
163 163
 				'Term_Taxonomy.taxonomy' => 'post_tag',
164 164
 				'Term_Taxonomy.Venue.post_type' => 'espresso_venues',
165 165
 			),
166
-			'order_by' => array( 'name' => 'ASC' ),
167
-			'force_join' => array( 'Term_Taxonomy' )
166
+			'order_by' => array('name' => 'ASC'),
167
+			'force_join' => array('Term_Taxonomy')
168 168
 		));
169
-		foreach ( $post_tags as $key => $post_tag ) {
170
-			if ( ! isset( $post_tags[ $key ]->post_type )) {
171
-				$post_tags[ $key ]->post_type = array();
169
+		foreach ($post_tags as $key => $post_tag) {
170
+			if ( ! isset($post_tags[$key]->post_type)) {
171
+				$post_tags[$key]->post_type = array();
172 172
 			}
173
-			$post_tags[ $key ]->post_type[] = 'espresso_venues';
173
+			$post_tags[$key]->post_type[] = 'espresso_venues';
174 174
 		}
175 175
 		return $post_tags;
176 176
 //		return array( 'espresso_venues' => $post_tags );
Please login to merge, or discard this patch.
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.
core/db_models/EEM_Ticket_Price.model.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  * ------------------------------------------------------------------------
23 23
  */
24 24
 
25
-require_once ( EE_CLASSES . 'EE_Ticket_Price.class.php' );
26
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
25
+require_once (EE_CLASSES.'EE_Ticket_Price.class.php');
26
+require_once (EE_MODELS.'EEM_Base.model.php');
27 27
 
28 28
 class EEM_Ticket_Price extends EEM_Base {
29 29
 
@@ -37,12 +37,12 @@  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 = __('Ticket Price','event_espresso');
42
-		$this->plural_item = __('Ticket Prices','event_espresso');
40
+	protected function __construct($timezone) {
41
+		$this->singular_item = __('Ticket Price', 'event_espresso');
42
+		$this->plural_item = __('Ticket Prices', 'event_espresso');
43 43
 
44 44
 		$this->_tables = array(
45
-			'Ticket_Price'=>new EE_Primary_Table('esp_ticket_price','TKP_ID')
45
+			'Ticket_Price'=>new EE_Primary_Table('esp_ticket_price', 'TKP_ID')
46 46
 		);
47 47
 		$this->_fields = array(
48 48
 			'Ticket_Price'=> array(
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 			'Price'=>new EE_Belongs_To_Relation()
57 57
 		);
58 58
 		$this->_model_chain_to_wp_user = 'Ticket';
59
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event' );
59
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
60 60
 		//account for default tickets in the caps
61
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event');
62
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event');
63
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event');
61
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
62
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
63
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
64 64
 		//follow the caps of the ticket
65 65
 		$this->_caps_slug = 'tickets';
66
-		parent::__construct( $timezone );
66
+		parent::__construct($timezone);
67 67
 
68 68
 	}
69 69
 
Please login to merge, or discard this patch.
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.
core/db_models/EEM_Ticket_Template.model.php 2 patches
Spacing   +14 added lines, -14 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_Ticket_Template.class.php' );
24
+require_once (EE_MODELS.'EEM_Base.model.php');
25
+require_once (EE_CLASSES.'EE_Ticket_Template.class.php');
26 26
 
27 27
 class EEM_Ticket_Template extends EEM_Base {
28 28
 
@@ -38,29 +38,29 @@  discard block
 block discarded – undo
38 38
 	 *		@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)
39 39
 	 *		@return void
40 40
 	 */
41
-	protected function __construct( $timezone ) {
42
-		$this->singular_item = __('Ticket Template','event_espresso');
43
-		$this->plural_item = __('Ticket Templates','event_espresso');
41
+	protected function __construct($timezone) {
42
+		$this->singular_item = __('Ticket Template', 'event_espresso');
43
+		$this->plural_item = __('Ticket Templates', 'event_espresso');
44 44
 
45 45
 		$this->_tables = array(
46 46
 			'Ticket_Template'=> new EE_Primary_Table('esp_ticket_template', 'TTM_ID')
47 47
 		);
48 48
 		$this->_fields = array(
49 49
 			'Ticket_Template'=>array(
50
-				'TTM_ID'=>new EE_Primary_Key_Int_Field('TTM_ID', __('Ticket Template ID','event_espresso')),
51
-				'TTM_name'=>new EE_Plain_Text_Field('TTM_name', __('The name of the ticket template','event_espresso'), false, '' ),
52
-				'TTM_description'=>new EE_Plain_Text_Field('TTM_description', __('The description for the ticket template','event_espresso'), true, '' ),
53
-				'TTM_file'=>new EE_Plain_Text_Field('TTM_file', __('The file name for the actual template file saved on disk','event_espresso'), true, '' ),
50
+				'TTM_ID'=>new EE_Primary_Key_Int_Field('TTM_ID', __('Ticket Template ID', 'event_espresso')),
51
+				'TTM_name'=>new EE_Plain_Text_Field('TTM_name', __('The name of the ticket template', 'event_espresso'), false, ''),
52
+				'TTM_description'=>new EE_Plain_Text_Field('TTM_description', __('The description for the ticket template', 'event_espresso'), true, ''),
53
+				'TTM_file'=>new EE_Plain_Text_Field('TTM_file', __('The file name for the actual template file saved on disk', 'event_espresso'), true, ''),
54 54
 			));
55 55
 		$this->_model_relations = array(
56 56
 			'Ticket'=>new EE_Has_Many_Relation()
57 57
 		);
58 58
 		$this->_model_chain_to_wp_user = 'Ticket';
59
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event' );
59
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
60 60
 		//account for default tickets in the caps
61
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event');
62
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event');
63
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event');
64
-		parent::__construct( $timezone );
61
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
62
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
63
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event');
64
+		parent::__construct($timezone);
65 65
 	}
66 66
 } //end EEM_Ticket_Template class
67 67
\ No newline at end of file
Please login to merge, or discard this patch.
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.
core/db_models/EEM_Transaction.model.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 require_once ( EE_MODELS . 'EEM_Base.model.php' );
3 3
 /**
4
- *
5
- * Transaction Model
6
- *
7
- * @package			Event Espresso
8
- * @subpackage		includes/models/
9
- * @author				Brent Christensen
10
- *
11
- */
4
+	 *
5
+	 * Transaction Model
6
+	 *
7
+	 * @package			Event Espresso
8
+	 * @subpackage		includes/models/
9
+	 * @author				Brent Christensen
10
+	 *
11
+	 */
12 12
 class EEM_Transaction extends EEM_Base {
13 13
 
14 14
   	// private instance of the Transaction object
Please login to merge, or discard this patch.
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   +47 added lines, -47 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
  * Transaction Model
@@ -68,36 +68,36 @@  discard block
 block discarded – undo
68 68
 	 * 		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)
69 69
 	 *	@return EEM_Transaction
70 70
 	 */
71
-	protected function __construct( $timezone ) {
72
-		$this->singular_item = __('Transaction','event_espresso');
73
-		$this->plural_item = __('Transactions','event_espresso');
71
+	protected function __construct($timezone) {
72
+		$this->singular_item = __('Transaction', 'event_espresso');
73
+		$this->plural_item = __('Transactions', 'event_espresso');
74 74
 
75 75
 		$this->_tables = array(
76
-			'Transaction'=>new EE_Primary_Table('esp_transaction','TXN_ID')
76
+			'Transaction'=>new EE_Primary_Table('esp_transaction', 'TXN_ID')
77 77
 		);
78 78
 		$this->_fields = array(
79 79
 			'Transaction'=>array(
80
-				'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso')),
81
-				'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created','event_espresso'), false, time(), $timezone ),
82
-				'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction','event_espresso'), false, 0),
83
-				'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date','event_espresso'), false, 0),
84
-				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'),
85
-				'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data','event_espresso'), true, ''),
86
-				'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt','event_espresso'), true, ''),
80
+				'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso')),
81
+				'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created', 'event_espresso'), false, time(), $timezone),
82
+				'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction', 'event_espresso'), false, 0),
83
+				'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date', 'event_espresso'), false, 0),
84
+				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'),
85
+				'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data', 'event_espresso'), true, ''),
86
+				'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt', 'event_espresso'), true, ''),
87 87
 				'PMD_ID'=>new EE_Foreign_Key_Int_Field('PMD_ID', __("Last Used Payment Method", 'event_espresso'), true, NULL, 'Payment_Method'),
88
-				'TXN_reg_steps' => new EE_Serialized_Text_Field( 'TXN_reg_steps', __( 'Registration Steps', 'event_espresso' ), FALSE, array() ),
88
+				'TXN_reg_steps' => new EE_Serialized_Text_Field('TXN_reg_steps', __('Registration Steps', 'event_espresso'), FALSE, array()),
89 89
 			)
90 90
 		);
91 91
 		$this->_model_relations = array(
92 92
 			'Registration'=>new EE_Has_Many_Relation(),
93 93
 			'Payment'=>new EE_Has_Many_Relation(),
94 94
 			'Status'=>new EE_Belongs_To_Relation(),
95
-			'Line_Item'=>new EE_Has_Many_Relation(false),//you can delete a transaction without needing to delete its line items
95
+			'Line_Item'=>new EE_Has_Many_Relation(false), //you can delete a transaction without needing to delete its line items
96 96
 			'Payment_Method'=>new EE_Belongs_To_Relation(),
97 97
 			'Message' => new EE_Has_Many_Relation()
98 98
 		);
99 99
 		$this->_model_chain_to_wp_user = 'Registration.Event';
100
-		parent::__construct( $timezone );
100
+		parent::__construct($timezone);
101 101
 
102 102
 	}
103 103
 
@@ -108,23 +108,23 @@  discard block
 block discarded – undo
108 108
 	 * @param string $period
109 109
 	 * @return \stdClass[]
110 110
 	 */
111
-	public function get_revenue_per_day_report( $period = '-1 month' ) {
112
-		$sql_date = $this->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', strtotime( $period ) ), 'Y-m-d H:i:s', 'UTC' );
111
+	public function get_revenue_per_day_report($period = '-1 month') {
112
+		$sql_date = $this->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', strtotime($period)), 'Y-m-d H:i:s', 'UTC');
113 113
 
114
-		EE_Registry::instance()->load_helper( 'DTT_Helper' );
115
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'TXN_timestamp' );
114
+		EE_Registry::instance()->load_helper('DTT_Helper');
115
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'TXN_timestamp');
116 116
 
117 117
 		$results = $this->_get_all_wpdb_results(
118 118
 			array(
119 119
 				array(
120
-				'TXN_timestamp' => array( '>=', $sql_date ) ),
120
+				'TXN_timestamp' => array('>=', $sql_date) ),
121 121
 				'group_by' => 'txnDate',
122
-				'order_by' => array( 'TXN_timestamp' => 'ASC' )
122
+				'order_by' => array('TXN_timestamp' => 'ASC')
123 123
 			),
124 124
 			OBJECT,
125 125
 			array(
126
-				'txnDate' => array( 'DATE(' . $query_interval . ')', '%s' ),
127
-				'revenue' => array( 'SUM(Transaction.TXN_paid)', '%d' )
126
+				'txnDate' => array('DATE('.$query_interval.')', '%s'),
127
+				'revenue' => array('SUM(Transaction.TXN_paid)', '%d')
128 128
 			)
129 129
 		);
130 130
 		return $results;
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
 	 * @throws \EE_Error
141 141
 	 * @return mixed
142 142
 	 */
143
-	public function get_revenue_per_event_report( $period = '-1 month' ) {
143
+	public function get_revenue_per_event_report($period = '-1 month') {
144 144
 		global $wpdb;
145
-		$transaction_table = $wpdb->prefix . 'esp_transaction';
146
-		$registration_table = $wpdb->prefix . 'esp_registration';
145
+		$transaction_table = $wpdb->prefix.'esp_transaction';
146
+		$registration_table = $wpdb->prefix.'esp_registration';
147 147
 		$event_table = $wpdb->posts;
148
-		$payment_table = $wpdb->prefix . 'esp_payment';
149
-		$sql_date = date( 'Y-m-d H:i:s', strtotime( $period ) );
148
+		$payment_table = $wpdb->prefix.'esp_payment';
149
+		$sql_date = date('Y-m-d H:i:s', strtotime($period));
150 150
 		$extra_event_on_join = '';
151 151
 		//exclude events not authored by user if permissions in effect
152
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
153
-			$extra_event_on_join = ' AND Event.post_author = ' . get_current_user_id();
152
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
153
+			$extra_event_on_join = ' AND Event.post_author = '.get_current_user_id();
154 154
 		}
155 155
 
156 156
 		$approved_payment_status = EEM_Payment::status_id_approved;
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
 	 * @param string $reg_url_link
197 197
 	 * @return EE_Transaction
198 198
 	 */
199
-	public function get_transaction_from_reg_url_link( $reg_url_link = '' ){
200
-		return $this->get_one( array(
199
+	public function get_transaction_from_reg_url_link($reg_url_link = '') {
200
+		return $this->get_one(array(
201 201
 			array(
202
-				'Registration.REG_url_link' => ! empty( $reg_url_link ) ? $reg_url_link : EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' )
202
+				'Registration.REG_url_link' => ! empty($reg_url_link) ? $reg_url_link : EE_Registry::instance()->REQ->get('e_reg_url_link', '')
203 203
 			)
204 204
 		));
205 205
 	}
@@ -219,15 +219,15 @@  discard block
 block discarded – undo
219 219
 	 * @param boolean $save_txn whether or not to save the transaction during this function call
220 220
 	 * @return boolean
221 221
 	 */
222
-	public function update_based_on_payments( $transaction_obj_or_id, $save_txn = TRUE ){
222
+	public function update_based_on_payments($transaction_obj_or_id, $save_txn = TRUE) {
223 223
 		EE_Error::doing_it_wrong(
224
-			__CLASS__ . '::' . __FUNCTION__,
225
-			sprintf( __( 'This method is deprecated. Please use "%s" instead', 'event_espresso' ), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()' ),
224
+			__CLASS__.'::'.__FUNCTION__,
225
+			sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()'),
226 226
 			'4.6.0'
227 227
 		);
228 228
 		/** @type EE_Transaction_Processor $transaction_processor */
229
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
230
-		return  $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment( $this->ensure_is_obj( $transaction_obj_or_id ));
229
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
230
+		return  $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment($this->ensure_is_obj($transaction_obj_or_id));
231 231
 	}
232 232
 
233 233
 	/**
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			array(
259 259
 				0 => array(
260 260
 					'STS_ID' => EEM_Transaction::failed_status_code,
261
-					'TXN_timestamp' => array( '<', time() - $time_to_leave_alone )
261
+					'TXN_timestamp' => array('<', time() - $time_to_leave_alone)
262 262
 				)
263 263
 			),
264 264
 			$time_to_leave_alone
@@ -271,26 +271,26 @@  discard block
 block discarded – undo
271 271
 		 */
272 272
 		$txn_ids = apply_filters(
273 273
 			'FHEE__EEM_Transaction__delete_junk_transactions__transaction_ids_to_delete',
274
-			EEM_Transaction::instance()->get_col( $ids_query, 'TXN_ID' ),
274
+			EEM_Transaction::instance()->get_col($ids_query, 'TXN_ID'),
275 275
 			$time_to_leave_alone
276 276
 		);
277 277
 
278 278
 		//now that we have the ids to delete, let's get deletin'
279 279
 		//Why no wpdb->prepare?  Because the data is trusted.  We got the ids from the original query to get them FROM
280 280
 		//the db (which is sanitized) so no need to prepare them again.
281
-		if ( $txn_ids ) {
282
-			$query   = '
281
+		if ($txn_ids) {
282
+			$query = '
283 283
 				DELETE
284
-				FROM ' . $this->table() . '
284
+				FROM ' . $this->table().'
285 285
 				WHERE
286
-					TXN_ID IN ( ' . implode( ",", $txn_ids ) . ')';
287
-			$deleted = $wpdb->query( $query );
286
+					TXN_ID IN ( ' . implode(",", $txn_ids).')';
287
+			$deleted = $wpdb->query($query);
288 288
 		}
289
-		if ( $deleted ) {
289
+		if ($deleted) {
290 290
 			/**
291 291
 			 * Allows code to do something after the transactions have been deleted.
292 292
 			 */
293
-			do_action( 'AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids );
293
+			do_action('AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids);
294 294
 		}
295 295
 		return $deleted;
296 296
 	}
Please login to merge, or discard this patch.