Completed
Branch FET-6593-txn-surcharge (85432b)
by
unknown
609:11 queued 595:56
created
core/db_models/EEM_Event_Venue.model.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -5,22 +5,22 @@  discard block
 block discarded – undo
5 5
  * You'll need to use each's EE_Has_Many_Relation relation to this model. Eg, when querying for question groups which apply to primary attendees,
6 6
  * you'd do a query like EEM_Question_Group::instance()->get_all(array(array('Event_Question_Group.EQG_primary'=>1)));
7 7
  */
8
-class EEM_Event_Venue extends EEM_Base{
8
+class EEM_Event_Venue extends EEM_Base {
9 9
 	// private instance of the Attendee object
10 10
 	protected static $_instance = NULL;
11 11
 
12
-	protected function __construct( $timezone = NULL ) {
13
-		$this->singular_item = __('Event to Question Group Link','event_espresso');
14
-		$this->plural_item = __('Event to Question Group Links','event_espresso');
12
+	protected function __construct($timezone = NULL) {
13
+		$this->singular_item = __('Event to Question Group Link', 'event_espresso');
14
+		$this->plural_item = __('Event to Question Group Links', 'event_espresso');
15 15
 		$this->_tables = array(
16
-			'Event_Venue'=>new EE_Primary_Table('esp_event_venue','EVV_ID')
16
+			'Event_Venue'=>new EE_Primary_Table('esp_event_venue', 'EVV_ID')
17 17
 		);
18 18
 		$this->_fields = array(
19 19
 			'Event_Venue'=>array(
20
-				'EVV_ID'=>new EE_Primary_Key_Int_Field('EVV_ID', __('Event to Venue Link ID','event_espresso')),
21
-				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID','event_espresso'), false, 0, 'Event'),
22
-				'VNU_ID'=>new EE_Foreign_Key_Int_Field('VNU_ID', __('Venue ID','event_espresso'), false, 0, 'Venue'),
23
-				'EVV_primary'=>new EE_Boolean_Field('EVV_primary', __("Flag indicating venue is primary one for event", "event_espresso"), false,true)
20
+				'EVV_ID'=>new EE_Primary_Key_Int_Field('EVV_ID', __('Event to Venue Link ID', 'event_espresso')),
21
+				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID', 'event_espresso'), false, 0, 'Event'),
22
+				'VNU_ID'=>new EE_Foreign_Key_Int_Field('VNU_ID', __('Venue ID', 'event_espresso'), false, 0, 'Venue'),
23
+				'EVV_primary'=>new EE_Boolean_Field('EVV_primary', __("Flag indicating venue is primary one for event", "event_espresso"), false, true)
24 24
 
25 25
 			)
26 26
 		);
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 			'Venue'=>new EE_Belongs_To_Relation()
30 30
 		);
31 31
 		//this model is generally available for reading
32
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public( 'Event' );
33
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected( 'Event' );
34
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected( 'Event' );
35
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected( 'Event', EEM_Base::caps_edit );
36
-		parent::__construct( $timezone );
32
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Event_Related_Public('Event');
33
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Event_Related_Protected('Event');
34
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Event_Related_Protected('Event');
35
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Event_Related_Protected('Event', EEM_Base::caps_edit);
36
+		parent::__construct($timezone);
37 37
 	}
38 38
 
39 39
 
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * model for handling has-and-belongs-to-many relatinobetween events and venues
4
- * If you want to query based on a non-primary of foreign key on this model, you can't use the EE_HABTM_Relation on Event nor or Question Group.
5
- * You'll need to use each's EE_Has_Many_Relation relation to this model. Eg, when querying for question groups which apply to primary attendees,
6
- * you'd do a query like EEM_Question_Group::instance()->get_all(array(array('Event_Question_Group.EQG_primary'=>1)));
7
- */
3
+	 * model for handling has-and-belongs-to-many relatinobetween events and venues
4
+	 * If you want to query based on a non-primary of foreign key on this model, you can't use the EE_HABTM_Relation on Event nor or Question Group.
5
+	 * You'll need to use each's EE_Has_Many_Relation relation to this model. Eg, when querying for question groups which apply to primary attendees,
6
+	 * you'd do a query like EEM_Question_Group::instance()->get_all(array(array('Event_Question_Group.EQG_primary'=>1)));
7
+	 */
8 8
 class EEM_Event_Venue extends EEM_Base{
9 9
 	// private instance of the Attendee object
10 10
 	protected static $_instance = NULL;
Please login to merge, or discard this patch.
core/db_models/EEM_Extra_Meta.model.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * ------------------------------------------------------------------------
28 28
  */
29
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
29
+require_once (EE_MODELS.'EEM_Base.model.php');
30 30
 
31 31
 class EEM_Extra_Meta extends EEM_Base {
32 32
 
33 33
   	// private instance of the Attendee object
34 34
 	protected static $_instance = NULL;
35 35
 
36
-	protected function __construct( $timezone = NULL ) {
37
-		$this->singular_item = __('Extra Meta','event_espresso');
38
-		$this->plural_item = __('Extra Metas','event_espresso');
36
+	protected function __construct($timezone = NULL) {
37
+		$this->singular_item = __('Extra Meta', 'event_espresso');
38
+		$this->plural_item = __('Extra Metas', 'event_espresso');
39 39
 		$this->_tables = array(
40 40
 			'Extra_Meta'=> new EE_Primary_Table('esp_extra_meta', 'EXM_ID')
41 41
 		);
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 
51 51
 			));
52 52
 		$this->_model_relations = array();
53
-		foreach($models_this_can_attach_to as $model){
53
+		foreach ($models_this_can_attach_to as $model) {
54 54
 			$this->_model_relations[$model] = new EE_Belongs_To_Any_Relation();
55 55
 		}
56
-		parent::__construct( $timezone );
56
+		parent::__construct($timezone);
57 57
 	}
58 58
 
59 59
 
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_Message_Template.model.php 3 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@
 block discarded – undo
1 1
 <?php if (!defined('EVENT_ESPRESSO_VERSION') )
2 2
 	exit('NO direct script access allowed');
3 3
 /**
4
- * Event Espresso
5
- *
6
- * Event Registration and Management Plugin for Wordpress
7
- *
8
- * @package		Event Espresso
9
- * @author		Seth Shoultes
10
- * @copyright	(c)2009-2012 Event Espresso All Rights Reserved.
11
- * @license		@link http://eventespresso.com/support/terms-conditions/  ** see Plugin Licensing * *
12
- * @link		http://www.eventespresso.com
13
- * @version		4.1
14
- *
15
- * ------------------------------------------------------------------------
16
- *
17
- * EEM_Message_Template
18
- *
19
- *
20
- *
21
- * @package		Event Espresso
22
- * @subpackage	includes/models/EEM_Message_Template.model.php
23
- * @author		Darren Ethier
24
- *
25
- *
26
- * ------------------------------------------------------------------------
27
- */
4
+	 * Event Espresso
5
+	 *
6
+	 * Event Registration and Management Plugin for Wordpress
7
+	 *
8
+	 * @package		Event Espresso
9
+	 * @author		Seth Shoultes
10
+	 * @copyright	(c)2009-2012 Event Espresso All Rights Reserved.
11
+	 * @license		@link http://eventespresso.com/support/terms-conditions/  ** see Plugin Licensing * *
12
+	 * @link		http://www.eventespresso.com
13
+	 * @version		4.1
14
+	 *
15
+	 * ------------------------------------------------------------------------
16
+	 *
17
+	 * EEM_Message_Template
18
+	 *
19
+	 *
20
+	 *
21
+	 * @package		Event Espresso
22
+	 * @subpackage	includes/models/EEM_Message_Template.model.php
23
+	 * @author		Darren Ethier
24
+	 *
25
+	 *
26
+	 * ------------------------------------------------------------------------
27
+	 */
28 28
 class EEM_Message_Template extends EEM_Base {
29 29
 	//private instance of the EEM_Message_Template object
30 30
 	protected static $_instance = NULL;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION') )
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION'))
2 2
 	exit('NO direct script access allowed');
3 3
 /**
4 4
  * Event Espresso
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
 	 * 		@access protected
37 37
 	 * 		@return void
38 38
 	 */
39
-	protected function __construct( $timezone = NULL ) {
40
-		$this->singular_item = __('Message Template','event_espresso');
41
-		$this->plural_item = __('Message Templates','event_espresso');
39
+	protected function __construct($timezone = NULL) {
40
+		$this->singular_item = __('Message Template', 'event_espresso');
41
+		$this->plural_item = __('Message Templates', 'event_espresso');
42 42
 
43 43
 		$this->_tables = array(
44
-			'Message_Template' => new EE_Primary_Table('esp_message_template', 'MTP_ID' )
44
+			'Message_Template' => new EE_Primary_Table('esp_message_template', 'MTP_ID')
45 45
 		);
46 46
 		$this->_fields = array(
47 47
 			'Message_Template'=> array(
48 48
 				'MTP_ID'=> new EE_Primary_Key_Int_Field('MTP_ID', __('Message Template ID', 'event_espresso')),
49
-				'GRP_ID' => new EE_Foreign_Key_Int_Field('GRP_ID', __('Message Template Group ID', 'event_espresso'), FALSE, 0, 'Message_Template_Group' ),
50
-				'MTP_template_field'=>new EE_Plain_Text_Field('MTP_template_field', __('Field Name for this Template', 'event_espresso'), false, 'default' ),
51
-				'MTP_context'=>new EE_Plain_Text_Field('MTP_context', __('Message Type Context for this field', 'event_espresso'),false,'admin' ),
49
+				'GRP_ID' => new EE_Foreign_Key_Int_Field('GRP_ID', __('Message Template Group ID', 'event_espresso'), FALSE, 0, 'Message_Template_Group'),
50
+				'MTP_template_field'=>new EE_Plain_Text_Field('MTP_template_field', __('Field Name for this Template', 'event_espresso'), false, 'default'),
51
+				'MTP_context'=>new EE_Plain_Text_Field('MTP_context', __('Message Type Context for this field', 'event_espresso'), false, 'admin'),
52 52
 				'MTP_content'=>new EE_Serialized_Text_Field('MTP_content', __('The field content for the template', 'event_espresso'), false, ''),
53 53
 				)
54 54
 		);
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 			'Message_Template_Group' => new EE_Belongs_To_Relation()
58 58
 			);
59 59
 		$this->_model_chain_to_wp_user = 'Message_Template_Group';
60
-		foreach( $this->_cap_contexts_to_cap_action_map as $context => $action ){
61
-			$this->_cap_restriction_generators[ $context ] = new EE_Restriction_Generator_Global( 'Message_Template_Group.MTP_is_global');
60
+		foreach ($this->_cap_contexts_to_cap_action_map as $context => $action) {
61
+			$this->_cap_restriction_generators[$context] = new EE_Restriction_Generator_Global('Message_Template_Group.MTP_is_global');
62 62
 		}
63 63
 		$this->_caps_slug = 'messages';
64
-		parent::__construct( $timezone );
64
+		parent::__construct($timezone);
65 65
 	}
66 66
 
67 67
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,6 @@
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION') )
1
+<?php if (!defined('EVENT_ESPRESSO_VERSION') ) {
2 2
 	exit('NO direct script access allowed');
3
+}
3 4
 /**
4 5
  * Event Espresso
5 6
  *
Please login to merge, or discard this patch.
core/db_models/EEM_Question.model.php 2 patches
Spacing   +42 added lines, -42 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
 
@@ -69,21 +69,21 @@  discard block
 block discarded – undo
69 69
 	// private instance of the Attendee object
70 70
 	protected static $_instance = NULL;
71 71
 
72
-	protected function __construct( $timezone = NULL ) {
73
-		$this->singular_item = __('Question','event_espresso');
74
-		$this->plural_item = __('Questions','event_espresso');
75
-		$this->_allowed_question_types=apply_filters(
72
+	protected function __construct($timezone = NULL) {
73
+		$this->singular_item = __('Question', 'event_espresso');
74
+		$this->plural_item = __('Questions', 'event_espresso');
75
+		$this->_allowed_question_types = apply_filters(
76 76
 			'FHEE__EEM_Question__construct__allowed_question_types',
77 77
 			array(
78
-				EEM_Question::QST_type_text =>__('Text','event_espresso'),
79
-				EEM_Question::QST_type_textarea =>__('Textarea','event_espresso'),
80
-				EEM_Question::QST_type_checkbox =>__('Checkboxes','event_espresso'),
81
-				EEM_Question::QST_type_radio =>__('Radio Buttons','event_espresso'),
82
-				EEM_Question::QST_type_dropdown =>__('Dropdown','event_espresso'),
83
-				EEM_Question::QST_type_state =>__('State/Province Dropdown','event_espresso'),
84
-				EEM_Question::QST_type_country =>__('Country Dropdown','event_espresso'),
85
-				EEM_Question::QST_type_date =>__('Date Picker','event_espresso'),
86
-				EEM_Question::QST_type_html_textarea => __( 'HTML Textarea', 'event_espresso' ),
78
+				EEM_Question::QST_type_text =>__('Text', 'event_espresso'),
79
+				EEM_Question::QST_type_textarea =>__('Textarea', 'event_espresso'),
80
+				EEM_Question::QST_type_checkbox =>__('Checkboxes', 'event_espresso'),
81
+				EEM_Question::QST_type_radio =>__('Radio Buttons', 'event_espresso'),
82
+				EEM_Question::QST_type_dropdown =>__('Dropdown', 'event_espresso'),
83
+				EEM_Question::QST_type_state =>__('State/Province Dropdown', 'event_espresso'),
84
+				EEM_Question::QST_type_country =>__('Country Dropdown', 'event_espresso'),
85
+				EEM_Question::QST_type_date =>__('Date Picker', 'event_espresso'),
86
+				EEM_Question::QST_type_html_textarea => __('HTML Textarea', 'event_espresso'),
87 87
 			)
88 88
 		);
89 89
 		$this->_question_type_categories = apply_filters(
@@ -102,21 +102,21 @@  discard block
 block discarded – undo
102 102
 		);
103 103
 
104 104
 		$this->_tables = array(
105
-			'Question'=>new EE_Primary_Table('esp_question','QST_ID')
105
+			'Question'=>new EE_Primary_Table('esp_question', 'QST_ID')
106 106
 		);
107 107
 		$this->_fields = array(
108 108
 			'Question'=>array(
109
-				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID','event_espresso')),
110
-				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text','event_espresso'), true, ''),
111
-				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)','event_espresso'), true, ''),
112
-				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question','event_espresso'), TRUE, NULL ),
113
-				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type','event_espresso'),false, 'TEXT',$this->_allowed_question_types),
114
-				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?','event_espresso'), false, false),
115
-				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided','event_espresso'), true, ''),
116
-				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order','event_espresso'), false, 0),
117
-				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?','event_espresso'), false, false),
118
-				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID','event_espresso'), false ),
119
-				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted','event_espresso'), false, false)
109
+				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso')),
110
+				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text', 'event_espresso'), true, ''),
111
+				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)', 'event_espresso'), true, ''),
112
+				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question', 'event_espresso'), TRUE, NULL),
113
+				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type', 'event_espresso'), false, 'TEXT', $this->_allowed_question_types),
114
+				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?', 'event_espresso'), false, false),
115
+				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided', 'event_espresso'), true, ''),
116
+				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order', 'event_espresso'), false, 0),
117
+				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?', 'event_espresso'), false, false),
118
+				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID', 'event_espresso'), false),
119
+				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted', 'event_espresso'), false, false)
120 120
 			)
121 121
 		);
122 122
 		$this->_model_relations = array(
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 			'Question_Group_Question'=>new EE_Has_Many_Relation()
129 129
 		);
130 130
 		//this model is generally available for reading
131
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
132
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('QST_system');
133
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('QST_system');
134
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('QST_system');
135
-		parent::__construct( $timezone );
131
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
132
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('QST_system');
133
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('QST_system');
134
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('QST_system');
135
+		parent::__construct($timezone);
136 136
 	}
137 137
 
138 138
 	/**
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * but they can be extended
141 141
 	 * @return string[]
142 142
 	 */
143
-	public function allowed_question_types(){
143
+	public function allowed_question_types() {
144 144
 		return $this->_allowed_question_types;
145 145
 	}
146 146
 	/**
@@ -148,16 +148,16 @@  discard block
 block discarded – undo
148 148
 	 * @param string $question_type one of EEM_Question::allowed_question_types(
149 149
 	 * @return string[] like EEM_Question::allowed_question_types()
150 150
 	 */
151
-	public function question_types_in_same_category( $question_type ) {
152
-		$question_types = array( $question_type );
153
-		foreach( $this->_question_type_categories as $category => $question_types_in_category ) {
154
-			if( in_array( $question_type, $question_types_in_category ) ) {
151
+	public function question_types_in_same_category($question_type) {
152
+		$question_types = array($question_type);
153
+		foreach ($this->_question_type_categories as $category => $question_types_in_category) {
154
+			if (in_array($question_type, $question_types_in_category)) {
155 155
 				$question_types = $question_types_in_category;
156 156
 				break;
157 157
 			}
158 158
 		}
159 159
 
160
-		return array_intersect_key( $this->allowed_question_types(), array_flip( $question_types ) );
160
+		return array_intersect_key($this->allowed_question_types(), array_flip($question_types));
161 161
 	}
162 162
 
163 163
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * which system question QST_ID corresponds to the QST_system 'city', use EEM_Question::instance()->get_Question_ID_from_system_string('city');
168 168
 	 * @return int of QST_ID for the question that corresponds to that QST_system
169 169
 	 */
170
-	public function get_Question_ID_from_system_string($QST_system){
170
+	public function get_Question_ID_from_system_string($QST_system) {
171 171
 		 $conversion_array = array(
172 172
 			'fname'=> EEM_Attendee::fname_question_id,
173 173
 			'lname'=> EEM_Attendee::lname_question_id,
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 			'phone'=> EEM_Attendee::phone_question_id
182 182
 		);
183 183
 
184
-		return isset( $conversion_array[ $QST_system ] ) ? $conversion_array[ $QST_system ] : NULL;
184
+		return isset($conversion_array[$QST_system]) ? $conversion_array[$QST_system] : NULL;
185 185
 
186 186
 	}
187 187
 
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 	 */
194 194
 	public function get_latest_question_order() {
195 195
 		$columns_to_select = array(
196
-			'max_order' => array("MAX(QST_order)","%d")
196
+			'max_order' => array("MAX(QST_order)", "%d")
197 197
 			);
198
-		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select );
198
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
199 199
 		return $max[0]['max_order'];
200 200
 	}
201 201
 
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.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_Question_Option.model.php 2 patches
Spacing   +17 added lines, -17 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_Option.class.php');
24
+require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php');
25
+require_once(EE_CLASSES.'EE_Question_Option.class.php');
26 26
 
27 27
 
28 28
 class EEM_Question_Option extends EEM_Soft_Delete_Base {
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
   	// private instance of the Attendee object
31 31
 	protected static $_instance = NULL;
32 32
 
33
-	protected function __construct( $timezone = NULL ) {
34
-		$this->singular_item = __('Question Option','event_espresso');
35
-		$this->plural_item = __('Question Options','event_espresso');
33
+	protected function __construct($timezone = NULL) {
34
+		$this->singular_item = __('Question Option', 'event_espresso');
35
+		$this->plural_item = __('Question Options', 'event_espresso');
36 36
 
37 37
 		$this->_tables = array(
38
-			'Question_Option'=>new EE_Primary_Table('esp_question_option','QSO_ID')
38
+			'Question_Option'=>new EE_Primary_Table('esp_question_option', 'QSO_ID')
39 39
 		);
40 40
 		$this->_fields = array(
41 41
 			'Question_Option'=>array(
42
-					'QSO_ID'=>new EE_Primary_Key_Int_Field('QSO_ID', __('Question Option ID','event_espresso')),
43
-					'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID','event_espresso'), false, 0, 'Question'),
44
-					'QSO_value'=>new EE_Plain_Text_Field('QSO_value',  __("Question Option Value", "event_espresso"),false,''),
45
-					'QSO_desc'=>new EE_Full_HTML_Field('QSO_desc', __('Question Option Description','event_espresso'), false, ''),
46
-					'QSO_order' => new EE_Integer_Field('QSO_order', __('Question Option Order', 'event_espresso' ), false, 0 ),
47
-					'QSO_deleted'=>new EE_Trashed_Flag_Field('QSO_deleted', __('Flag indicating Option was trashed','event_espresso'), false, false)
42
+					'QSO_ID'=>new EE_Primary_Key_Int_Field('QSO_ID', __('Question Option ID', 'event_espresso')),
43
+					'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso'), false, 0, 'Question'),
44
+					'QSO_value'=>new EE_Plain_Text_Field('QSO_value', __("Question Option Value", "event_espresso"), false, ''),
45
+					'QSO_desc'=>new EE_Full_HTML_Field('QSO_desc', __('Question Option Description', 'event_espresso'), false, ''),
46
+					'QSO_order' => new EE_Integer_Field('QSO_order', __('Question Option Order', 'event_espresso'), false, 0),
47
+					'QSO_deleted'=>new EE_Trashed_Flag_Field('QSO_deleted', __('Flag indicating Option was trashed', 'event_espresso'), false, false)
48 48
 				)
49 49
 		);
50 50
 		$this->_model_relations = array(
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 
54 54
 		$this->_model_chain_to_wp_user = 'Question';
55 55
 		//this model is generally available for reading
56
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
57
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('Question_Option');
58
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('Question_Option');
59
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('Question_Option');
56
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
57
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('Question_Option');
58
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('Question_Option');
59
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('Question_Option');
60 60
 		$this->_caps_slug = 'questions';
61
-		parent::__construct( $timezone );
61
+		parent::__construct($timezone);
62 62
 	}
63 63
 
64 64
 
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_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_Soft_Delete_Base.model.php 3 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
  * EEM_Soft_Delete_Base
5 5
  *
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
  * @subpackage		includes/models/
26 26
  * @author				Michael Nelson
27 27
  */
28
-abstract class EEM_Soft_Delete_Base extends EEM_Base{
28
+abstract class EEM_Soft_Delete_Base extends EEM_Base {
29 29
 
30 30
 	/**
31 31
 	 * @param null $timezone
32 32
 	 */
33 33
 	protected function __construct($timezone = NULL) {
34
-		require_once( EE_MODELS . 'strategies/EE_Soft_Delete_Where_Conditions.strategy.php');
35
-		if( ! $this->_default_where_conditions_strategy){
34
+		require_once(EE_MODELS.'strategies/EE_Soft_Delete_Where_Conditions.strategy.php');
35
+		if ( ! $this->_default_where_conditions_strategy) {
36 36
 			$this->_default_where_conditions_strategy = new EE_Soft_Delete_Where_Conditions();
37 37
 		}
38 38
 		parent::__construct($timezone);
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 	 * @return string
44 44
 	 * @throws EE_Error
45 45
 	 */
46
-	public function deleted_field_name(){
46
+	public function deleted_field_name() {
47 47
 		$field = $this->get_a_field_of_type('EE_Trashed_Flag_Field');
48
-		if($field){
48
+		if ($field) {
49 49
 			return $field->get_name();
50
-		}else{
51
-			throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?','event_espresso'),get_class($this),get_class($this)));
50
+		} else {
51
+			throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?', 'event_espresso'), get_class($this), get_class($this)));
52 52
 		}
53 53
 	}
54 54
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * @param array $query_params like EEM_Base::get_all
60 60
 	 * @return EE_Soft_Delete_Base_Class[]
61 61
 	 */
62
-	public function get_all($query_params = array()){
62
+	public function get_all($query_params = array()) {
63 63
 		return parent::get_all($query_params);
64 64
 	}
65 65
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @param array $query_params like EEM_Base::get_all's $query_params
70 70
 	 * @return EE_Soft_Delete_Base_Class
71 71
 	 */
72
-	public function get_one($query_params = array()){
72
+	public function get_one($query_params = array()) {
73 73
 		return parent::get_one($query_params);
74 74
 	}
75 75
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @param array $query_params like EEM_Base::get_all's $query_params
78 78
 	 * @return EE_Soft_Delete_Base_Class
79 79
 	 */
80
-	public function get_one_deleted($query_params = array()){
80
+	public function get_one_deleted($query_params = array()) {
81 81
 		$query_params = $this->_alter_query_params_so_only_trashed_items_included($query_params);
82 82
 		return parent::get_one($query_params);
83 83
 	}
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * @param array $query_params like EEM_base::get_all's $query_params
88 88
 	 * @return EE_Soft_Delete_Base_Class
89 89
 	 */
90
-	public function get_one_deleted_or_undeleted($query_params = array()){
90
+	public function get_one_deleted_or_undeleted($query_params = array()) {
91 91
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
92 92
 		return parent::get_one($query_params);
93 93
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @param int|string $id
109 109
 	 * @return EE_Soft_Delete_Base_Class
110 110
 	 */
111
-	public function get_one_by_ID_but_ignore_deleted($id){
111
+	public function get_one_by_ID_but_ignore_deleted($id) {
112 112
 		return parent::get_one_by_ID($id);
113 113
 	}
114 114
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * @param boolean $distinct
120 120
 	 * @return int count
121 121
 	 */
122
-	public function count($query_params = array(), $field_to_count = null, $distinct = false){
122
+	public function count($query_params = array(), $field_to_count = null, $distinct = false) {
123 123
 		//just calls parent, but changes PHP docs for this function
124 124
 		return parent::count($query_params, $field_to_count, $distinct);
125 125
 	}
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 * @param bool 	 $distinct if we want to only count the distinct values for the column then you can trigger that by the setting $distinct to TRUE;
132 132
 	 * @return int
133 133
 	 */
134
-	public function count_deleted($query_params = null, $field_to_count = null, $distinct = FALSE){
134
+	public function count_deleted($query_params = null, $field_to_count = null, $distinct = FALSE) {
135 135
 		$query_params = $this->_alter_query_params_so_only_trashed_items_included($query_params);
136 136
 		return parent::count($query_params, $field_to_count, $distinct);
137 137
 	}
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 	 * @param array $query_params like EEM_Base::get_all's $query_params
142 142
 	 * @return array like EEM_Base::get_all's $query_params
143 143
 	 */
144
-	protected function _alter_query_params_so_only_trashed_items_included($query_params){
145
-		$deletedFlagFieldName=$this->deleted_field_name();
146
-		$query_params[0][$deletedFlagFieldName]=true;
144
+	protected function _alter_query_params_so_only_trashed_items_included($query_params) {
145
+		$deletedFlagFieldName = $this->deleted_field_name();
146
+		$query_params[0][$deletedFlagFieldName] = true;
147 147
 		return $query_params;
148 148
 	}
149 149
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 * @param array $query_params
153 153
 	 * @return array
154 154
 	 */
155
-	public function alter_query_params_so_deleted_and_undeleted_items_included( $query_params = array() ){
155
+	public function alter_query_params_so_deleted_and_undeleted_items_included($query_params = array()) {
156 156
 		return $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
157 157
 	}
158 158
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 * @param array $query_params
162 162
 	 * @return array
163 163
 	 */
164
-	protected function _alter_query_params_so_deleted_and_undeleted_items_included($query_params){
164
+	protected function _alter_query_params_so_deleted_and_undeleted_items_included($query_params) {
165 165
 		$query_params['default_where_conditions'] = 'other_models_only';
166 166
 		return $query_params;
167 167
 	}
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 	 * @param bool 	 $distinct if we want to only count the distinct values for the column then you can trigger that by the setting $distinct to TRUE;
174 174
 	 * @return int
175 175
 	 */
176
-	public function count_deleted_and_undeleted($query_params = null, $field_to_count = null, $distinct = FALSE){
176
+	public function count_deleted_and_undeleted($query_params = null, $field_to_count = null, $distinct = FALSE) {
177 177
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
178
-		return parent::count($query_params,$field_to_count, $distinct);
178
+		return parent::count($query_params, $field_to_count, $distinct);
179 179
 	}
180 180
 
181 181
 	/**
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 	 * @param string $field_to_sum name of field
185 185
 	 * @return int count
186 186
 	 */
187
-	public function sum($query_params =null,$field_to_sum= null){
187
+	public function sum($query_params = null, $field_to_sum = null) {
188 188
 		//just calls parent, but changes PHP doc
189
-		return parent::sum($query_params,$field_to_sum);
189
+		return parent::sum($query_params, $field_to_sum);
190 190
 	}
191 191
 
192 192
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 * @param string $field_to_sum
197 197
 	 * @return int
198 198
 	 */
199
-	public function sum_deleted($query_params = null, $field_to_sum = null){
199
+	public function sum_deleted($query_params = null, $field_to_sum = null) {
200 200
 		$query_params = $this->_alter_query_params_so_only_trashed_items_included($query_params);
201 201
 		return parent::sum($query_params, $field_to_sum);
202 202
 	}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 * @param string $field_to_sum
208 208
 	 * @reutrn int
209 209
 	 */
210
-	public function sum_deleted_and_undeleted($query_params = null, $field_to_sum = null){
210
+	public function sum_deleted_and_undeleted($query_params = null, $field_to_sum = null) {
211 211
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
212 212
 		parent::sum($query_params, $field_to_sum);
213 213
 	}
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 * @param array $query_params like EEM_Base::get_all
218 218
 	 * @return EE_Soft_Delete_Base_Class[]
219 219
 	 */
220
-	public function get_all_deleted_and_undeleted($query_params = array()){
220
+	public function get_all_deleted_and_undeleted($query_params = array()) {
221 221
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
222 222
 		return parent::get_all($query_params);
223 223
 	}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	 * @param array $query_params like EEM_Base::get_all
228 228
 	 * @return EE_Soft_Delete_Base_Class[]
229 229
 	 */
230
-	public function get_all_deleted($query_params = array()){
230
+	public function get_all_deleted($query_params = array()) {
231 231
 		$query_params = $this->_alter_query_params_so_only_trashed_items_included($query_params);
232 232
 		return parent::get_all($query_params);
233 233
 	}
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 * which may depend on it. Its generally advisable to always leave this as TRUE, otherwise you could easily corrupt your DB
246 246
 	 * @return boolean success
247 247
 	 */
248
-	public function delete_permanently($query_params = array(), $allow_blocking = true){
248
+	public function delete_permanently($query_params = array(), $allow_blocking = true) {
249 249
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
250 250
 		return parent::delete($query_params, $allow_blocking);
251 251
 	}
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	 * which may depend on it. Its generally advisable to always leave this as TRUE, otherwise you could easily corrupt your DB
261 261
 	 * @return boolean success
262 262
 	 */
263
-	public function delete_permanently_by_ID($ID=FALSE, $allow_blocking = true){
263
+	public function delete_permanently_by_ID($ID = FALSE, $allow_blocking = true) {
264 264
 		$query_params = array();
265 265
 		$query_params[0] = array($this->get_primary_key_field()->get_name() => $ID);
266 266
 		$query_params['limit'] = 1;
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 	 * @param mixed $ID value of the primary_key or primary_text_key
275 275
 	 * @return boolean success
276 276
 	 */
277
-	public function delete_by_ID($ID){
278
-		return $this->delete_or_restore_by_ID(true,$ID);
277
+	public function delete_by_ID($ID) {
278
+		return $this->delete_or_restore_by_ID(true, $ID);
279 279
 	}
280 280
 	/**
281 281
 	 * Restores a particular item by its ID (primary key). Ignores the fact whether the item
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
 	 * @param mixed $ID int if primary key is an int, string otherwise
284 284
 	 * @return boolean success
285 285
 	 */
286
-	public function restore_by_ID($ID=FALSE){
287
-		return $this->delete_or_restore_by_ID(false,$ID);
286
+	public function restore_by_ID($ID = FALSE) {
287
+		return $this->delete_or_restore_by_ID(false, $ID);
288 288
 	}
289 289
 	/**
290 290
 	 * For deleting or restoring a particular item. Note that this model is a SOFT-DELETABLE model! However,
@@ -293,15 +293,15 @@  discard block
 block discarded – undo
293 293
 	 * @param mixed $ID int if primary key is an int, string otherwise
294 294
 	 * @return boolean
295 295
 	 */
296
-	public function delete_or_restore_by_ID($delete=true,$ID=FALSE){
297
-		if ( ! $ID ) {
296
+	public function delete_or_restore_by_ID($delete = true, $ID = FALSE) {
297
+		if ( ! $ID) {
298 298
 			return FALSE;
299 299
 		}
300
-		$primaryKeyName=$this->primary_key_name();
300
+		$primaryKeyName = $this->primary_key_name();
301 301
 		// retrieve a particular transaction
302 302
 		$query_params = array();
303
-		$query_params[0] = array( $primaryKeyName => $ID );
304
-		if ( $this->delete_or_restore ($delete, $query_params )) {
303
+		$query_params[0] = array($primaryKeyName => $ID);
304
+		if ($this->delete_or_restore($delete, $query_params)) {
305 305
 			return TRUE;
306 306
 		} else {
307 307
 			return FALSE;
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @param bool  $block_deletes
320 320
 	 * @return boolean
321 321
 	 */
322
-	public function delete($query_params = array(), $block_deletes = false){
322
+	public function delete($query_params = array(), $block_deletes = false) {
323 323
 		//no matter what, we WON'T block soft deletes.
324 324
 		return $this->delete_or_restore(true, $query_params);
325 325
 	}
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * @param array $query_params like EEM_Base::get_all
331 331
 	 * @return boolean
332 332
 	 */
333
-	public function restore($query_params = array()){
333
+	public function restore($query_params = array()) {
334 334
 		return $this->delete_or_restore(false, $query_params);
335 335
 	}
336 336
 	/**
@@ -339,10 +339,10 @@  discard block
 block discarded – undo
339 339
 	 * @param array $query_params like EEM_Base::get_all
340 340
 	 * @return boolean
341 341
 	 */
342
-	function delete_or_restore($delete=true,$query_params = array()){
343
-		$deletedFlagFieldName=$this->deleted_field_name();
342
+	function delete_or_restore($delete = true, $query_params = array()) {
343
+		$deletedFlagFieldName = $this->deleted_field_name();
344 344
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
345
-		if ( $this->update (array($deletedFlagFieldName=>$delete), $query_params )) {
345
+		if ($this->update(array($deletedFlagFieldName=>$delete), $query_params)) {
346 346
 			return TRUE;
347 347
 		} else {
348 348
 			return FALSE;
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
 	 * be aware that model objects being used could get out-of-sync with the database
361 361
 	 * @return int number of items updated
362 362
 	 */
363
-	public function update_deleted_and_undeleted($fields_n_values, $query_params, $keep_model_objs_in_sync = TRUE ){
363
+	public function update_deleted_and_undeleted($fields_n_values, $query_params, $keep_model_objs_in_sync = TRUE) {
364 364
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
365
-		return $this->update($fields_n_values, $query_params, $keep_model_objs_in_sync );
365
+		return $this->update($fields_n_values, $query_params, $keep_model_objs_in_sync);
366 366
 	}
367 367
 
368 368
 	/**
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 	 * be aware that model objects being used could get out-of-sync with the database
378 378
 	 * @return int how many items were updated
379 379
 	 */
380
-	public function update($fields_n_values, $query_params, $keep_model_objs_in_sync = TRUE ){
381
-		return parent::update($fields_n_values,$query_params, $keep_model_objs_in_sync );
380
+	public function update($fields_n_values, $query_params, $keep_model_objs_in_sync = TRUE) {
381
+		return parent::update($fields_n_values, $query_params, $keep_model_objs_in_sync);
382 382
 	}
383 383
 
384 384
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 * @param boolean $allow_blocking if TRUE, matched objects will only be deleted if there is no related model info
244 244
 	 * that blocks it (ie, there' sno other data that depends on this data); if false, deletes regardless of other objects
245 245
 	 * which may depend on it. Its generally advisable to always leave this as TRUE, otherwise you could easily corrupt your DB
246
-	 * @return boolean success
246
+	 * @return integer success
247 247
 	 */
248 248
 	public function delete_permanently($query_params = array(), $allow_blocking = true){
249 249
 		$query_params = $this->_alter_query_params_so_deleted_and_undeleted_items_included($query_params);
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 * @param boolean $allow_blocking if TRUE, matched objects will only be deleted if there is no related model info
259 259
 	 * that blocks it (ie, there' sno other data that depends on this data); if false, deletes regardless of other objects
260 260
 	 * which may depend on it. Its generally advisable to always leave this as TRUE, otherwise you could easily corrupt your DB
261
-	 * @return boolean success
261
+	 * @return integer success
262 262
 	 */
263 263
 	public function delete_permanently_by_ID($ID=FALSE, $allow_blocking = true){
264 264
 		$query_params = array();
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	/**
353 353
 	 * Updates all the items of this model which match the $query params, regardless of whether
354 354
 	 * they've been soft-deleted or not
355
-	 * @param array $field_n_values like EEM_Base::update's $fields_n_value
355
+	 * @param array $fields_n_values like EEM_Base::update's $fields_n_value
356 356
 	 * @param array $query_params like EEM_base::get_all's $query_params
357 357
 	 * @param boolean $keep_model_objs_in_sync if TRUE, makes sure we ALSO update model objects
358 358
 	 * in this model's entity map according to $fields_n_values that match $query_params. This
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 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
  * EEH_URL helper
4 6
  * Helper class for URL-related PHP functions
@@ -62,7 +64,7 @@  discard block
 block discarded – undo
62 64
 				isset($results['response']['code']) &&
63 65
 				$results['response']['code'] == '200'){
64 66
 			return true;
65
-		}else{
67
+		} else{
66 68
 			return false;
67 69
 		}
68 70
 	}
Please login to merge, or discard this patch.