Completed
Branch BUG-5580-mike-implementation (468206)
by
unknown
08:00 queued 1434:13
created
core/db_classes/EE_CPT_Base.class.php 2 patches
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 * @param int    $parent_term_taxonomy_id optional
48 48
 	 * @return EE_Term_Taxonomy
49 49
 	 */
50
-	function add_event_category( $category_name, $category_description = NULL, $parent_term_taxonomy_id = NULL ) {
51
-		return $this->get_model()->add_event_category( $this, $category_name, $category_description, $parent_term_taxonomy_id );
50
+	function add_event_category($category_name, $category_description = NULL, $parent_term_taxonomy_id = NULL) {
51
+		return $this->get_model()->add_event_category($this, $category_name, $category_description, $parent_term_taxonomy_id);
52 52
 	}
53 53
 
54 54
 
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 	 * @param string $category_name
59 59
 	 * @return bool
60 60
 	 */
61
-	function remove_event_category( $category_name ) {
62
-		return $this->get_model()->remove_event_category( $this, $category_name );
61
+	function remove_event_category($category_name) {
62
+		return $this->get_model()->remove_event_category($this, $category_name);
63 63
 	}
64 64
 
65 65
 
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 	 * @param EE_Term_Taxonomy $term_taxonomy
71 71
 	 * @return EE_Base_Class the relation was removed from
72 72
 	 */
73
-	function remove_relation_to_term_taxonomy( $term_taxonomy ) {
74
-		if ( !$term_taxonomy ) {
75
-			EE_Error::add_error( sprintf( __( "No Term_Taxonomy provided which to remove from model object of type %s and id %d", "event_espresso" ), get_class( $this ), $this->ID() ), __FILE__, __FUNCTION__, __LINE__ );
73
+	function remove_relation_to_term_taxonomy($term_taxonomy) {
74
+		if ( ! $term_taxonomy) {
75
+			EE_Error::add_error(sprintf(__("No Term_Taxonomy provided which to remove from model object of type %s and id %d", "event_espresso"), get_class($this), $this->ID()), __FILE__, __FUNCTION__, __LINE__);
76 76
 			return NULL;
77 77
 		}
78
-		$term_taxonomy->set_count( $term_taxonomy->count() - 1 );
78
+		$term_taxonomy->set_count($term_taxonomy->count() - 1);
79 79
 		$term_taxonomy->save();
80
-		return $this->_remove_relation_to( $term_taxonomy, 'Term_Taxonomy' );
80
+		return $this->_remove_relation_to($term_taxonomy, 'Term_Taxonomy');
81 81
 	}
82 82
 
83 83
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @return int
102 102
 	 */
103 103
 	public function parent() {
104
-		return $this->get( 'parent' );
104
+		return $this->get('parent');
105 105
 	}
106 106
 
107 107
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 * @return string
112 112
 	 */
113 113
 	public function status() {
114
-		return $this->get( 'status' );
114
+		return $this->get('status');
115 115
 	}
116 116
 
117 117
 
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 	/**
120 120
 	 * @param string $status
121 121
 	 */
122
-	public function set_status( $status ) {
123
-		$this->set( 'status', $status );
122
+	public function set_status($status) {
123
+		$this->set('status', $status);
124 124
 	}
125 125
 
126 126
 
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
 	 * @param string|array $attr Optional. Query string or array of attributes.
135 135
 	 * @return string HTML image element
136 136
 	 */
137
-	protected function _get_feature_image( $size, $attr ) {
137
+	protected function _get_feature_image($size, $attr) {
138 138
 		//first let's see if we already have the _feature_image property set AND if it has a cached element on it FOR the given size
139
-		$attr_key = is_array( $attr ) ? implode( '_', $attr ) : $attr;
140
-		$cache_key = is_array( $size ) ? implode( '_', $size ) . $attr_key : $size . $attr_key;
141
-		$this->_feature_image[ $cache_key ] = isset( $this->_feature_image[ $cache_key ] ) ? $this->_feature_image[ $cache_key ] : $this->get_model()->get_feature_image( $this->ID(), $size, $attr );
142
-		return $this->_feature_image[ $cache_key ];
139
+		$attr_key = is_array($attr) ? implode('_', $attr) : $attr;
140
+		$cache_key = is_array($size) ? implode('_', $size).$attr_key : $size.$attr_key;
141
+		$this->_feature_image[$cache_key] = isset($this->_feature_image[$cache_key]) ? $this->_feature_image[$cache_key] : $this->get_model()->get_feature_image($this->ID(), $size, $attr);
142
+		return $this->_feature_image[$cache_key];
143 143
 	}
144 144
 
145 145
 
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 	 * @param string|array $attr
151 151
 	 * @return string of html
152 152
 	 */
153
-	public function feature_image( $size = 'thumbnail', $attr = '' ) {
154
-		return $this->_get_feature_image( $size, $attr );
153
+	public function feature_image($size = 'thumbnail', $attr = '') {
154
+		return $this->_get_feature_image($size, $attr);
155 155
 	}
156 156
 
157 157
 
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
 	 * @param  string|array $size can either be a string: 'thumbnail', 'medium', 'large', 'full' OR 2-item array representing width and height in pixels eg. array(32,32).
162 162
 	 * @return string|boolean          the url of the image or false if not found
163 163
 	 */
164
-	public function feature_image_url( $size = 'thumbnail' ) {
165
-		$attachment = wp_get_attachment_image_src( get_post_thumbnail_id( $this->ID() ), $size );
166
-		return !empty( $attachment ) ? $attachment[ 0 ] : FALSE;
164
+	public function feature_image_url($size = 'thumbnail') {
165
+		$attachment = wp_get_attachment_image_src(get_post_thumbnail_id($this->ID()), $size);
166
+		return ! empty($attachment) ? $attachment[0] : FALSE;
167 167
 	}
168 168
 
169 169
 
@@ -176,37 +176,37 @@  discard block
 block discarded – undo
176 176
 	 * @internal param array|string $related_obj_names if included this will be used to restore for related obj if not included then we just do restore on the meta.  We will accept an array of related_obj_names for restoration here.
177 177
 	 * @return void
178 178
 	 */
179
-	public function restore_revision( $revision_id, $related_obj_names = array(), $where_query = array() ) {
179
+	public function restore_revision($revision_id, $related_obj_names = array(), $where_query = array()) {
180 180
 		//get revision object
181
-		$revision_obj = $this->get_model()->get_one_by_ID( $revision_id );
182
-		if ( $revision_obj instanceof EE_CPT_Base ) {
181
+		$revision_obj = $this->get_model()->get_one_by_ID($revision_id);
182
+		if ($revision_obj instanceof EE_CPT_Base) {
183 183
 			//no related_obj_name so we assume we're saving a revision on this object.
184
-			if ( empty( $related_obj_names ) ) {
184
+			if (empty($related_obj_names)) {
185 185
 				$fields = $this->get_model()->get_meta_table_fields();
186
-				foreach ( $fields as $field ) {
187
-					$this->set( $field, $revision_obj->get( $field ) );
186
+				foreach ($fields as $field) {
187
+					$this->set($field, $revision_obj->get($field));
188 188
 				}
189 189
 				$this->save();
190 190
 			}
191
-			$related_obj_names = (array)$related_obj_names;
192
-			foreach ( $related_obj_names as $related_name ) {
191
+			$related_obj_names = (array) $related_obj_names;
192
+			foreach ($related_obj_names as $related_name) {
193 193
 				//related_obj_name so we're saving a revision on an object related to this object
194 194
 				//do we have $where_query params for this related object?  If we do then we include that.
195
-				$cols_n_values = isset( $where_query[ $related_name ] ) ? $where_query[ $related_name ] : array();
196
-				$where_params = !empty( $cols_n_values ) ? array( $cols_n_values ) : array();
197
-				$related_objs = $this->get_many_related( $related_name, $where_params );
198
-				$revision_related_objs = $revision_obj->get_many_related( $related_name, $where_params );
195
+				$cols_n_values = isset($where_query[$related_name]) ? $where_query[$related_name] : array();
196
+				$where_params = ! empty($cols_n_values) ? array($cols_n_values) : array();
197
+				$related_objs = $this->get_many_related($related_name, $where_params);
198
+				$revision_related_objs = $revision_obj->get_many_related($related_name, $where_params);
199 199
 				//load helper
200
-				EE_Registry::instance()->load_helper( 'Array' );
200
+				EE_Registry::instance()->load_helper('Array');
201 201
 				//remove related objs from this object that are not in revision
202 202
 				//array_diff *should* work cause I think objects are indexed by ID?
203
-				$related_to_remove = EEH_Array::object_array_diff( $related_objs, $revision_related_objs );
204
-				foreach ( $related_to_remove as $rr ) {
205
-					$this->_remove_relation_to( $rr, $related_name, $cols_n_values );
203
+				$related_to_remove = EEH_Array::object_array_diff($related_objs, $revision_related_objs);
204
+				foreach ($related_to_remove as $rr) {
205
+					$this->_remove_relation_to($rr, $related_name, $cols_n_values);
206 206
 				}
207 207
 				//add all related objs attached to revision to this object
208
-				foreach ( $revision_related_objs as $r_obj ) {
209
-					$this->_add_relation_to( $r_obj, $related_name, $cols_n_values );
208
+				foreach ($revision_related_objs as $r_obj) {
209
+					$this->_add_relation_to($r_obj, $related_name, $cols_n_values);
210 210
 				}
211 211
 			}
212 212
 		}
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 	 * <li>If $single is set to false, or left blank, the function returns an array containing all values of the specified key.</li>
223 223
 	 * <li>If $single is set to true, the function returns the first value of the specified key (not in an array</li></ul>
224 224
 	 */
225
-	public function get_post_meta( $meta_key = NULL, $single = FALSE ) {
226
-		return get_post_meta( $this->ID(), $meta_key, $single );
225
+	public function get_post_meta($meta_key = NULL, $single = FALSE) {
226
+		return get_post_meta($this->ID(), $meta_key, $single);
227 227
 	}
228 228
 
229 229
 
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
 	 * @throws EE_Error
237 237
 	 * @return mixed Returns meta_id if the meta doesn't exist, otherwise returns true on success and false on failure. NOTE: If the meta_value passed to this function is the same as the value that is already in the database, this function returns false.
238 238
 	 */
239
-	public function update_post_meta( $meta_key, $meta_value, $prev_value = NULL ) {
240
-		if ( !$this->ID() ) {
241
-			throw new EE_Error( sprintf( __( "You must save this custom post type before adding or updating a post meta field", "event_espresso" ) ) );
239
+	public function update_post_meta($meta_key, $meta_value, $prev_value = NULL) {
240
+		if ( ! $this->ID()) {
241
+			throw new EE_Error(sprintf(__("You must save this custom post type before adding or updating a post meta field", "event_espresso")));
242 242
 		}
243
-		return update_post_meta( $this->ID(), $meta_key, $meta_value, $prev_value );
243
+		return update_post_meta($this->ID(), $meta_key, $meta_value, $prev_value);
244 244
 	}
245 245
 
246 246
 
@@ -253,11 +253,11 @@  discard block
 block discarded – undo
253 253
 	 * @throws EE_Error
254 254
 	 * @return boolean Boolean true, except if the $unique argument was set to true and a custom field with the given key already exists, in which case false is returned.
255 255
 	 */
256
-	public function add_post_meta( $meta_key, $meta_value, $unique = FALSE ) {
257
-		if ( !$this->ID() ) {
258
-			throw new EE_Error( sprintf( __( "You must save this custom post type before adding or updating a post meta field", "event_espresso" ) ) );
256
+	public function add_post_meta($meta_key, $meta_value, $unique = FALSE) {
257
+		if ( ! $this->ID()) {
258
+			throw new EE_Error(sprintf(__("You must save this custom post type before adding or updating a post meta field", "event_espresso")));
259 259
 		}
260
-		return add_post_meta( $this->ID(), $meta_key, $meta_value, $unique );
260
+		return add_post_meta($this->ID(), $meta_key, $meta_value, $unique);
261 261
 	}
262 262
 
263 263
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @return string
268 268
 	 */
269 269
 	public function get_permalink() {
270
-		return get_permalink( $this->ID() );
270
+		return get_permalink($this->ID());
271 271
 	}
272 272
 
273 273
 
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
 	 * @param array $query_params
278 278
 	 * @return EE_Term_Taxonomy
279 279
 	 */
280
-	public function term_taxonomies( $query_params = array() ) {
281
-		return $this->get_many_related( 'Term_Taxonomy', $query_params );
280
+	public function term_taxonomies($query_params = array()) {
281
+		return $this->get_many_related('Term_Taxonomy', $query_params);
282 282
 	}
283 283
 
284 284
 
Please login to merge, or discard this patch.
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * The main purpose of this method is to return the parent for the model object
99 99
 	 *
100 100
 	 * @access public
101
-	 * @return int
101
+	 * @return boolean
102 102
 	 */
103 103
 	public function parent() {
104 104
 		return $this->get( 'parent' );
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 	/**
110 110
 	 * return the _status property
111
-	 * @return string
111
+	 * @return boolean
112 112
 	 */
113 113
 	public function status() {
114 114
 		return $this->get( 'status' );
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 *
131 131
 	 * @link   http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail
132 132
 	 * @access protected
133
-	 * @param string|array $size (optional) Image size. Defaults to 'post-thumbnail' but can also be a 2-item array representing width and height in pixels (i.e. array(32,32) ).
133
+	 * @param string $size (optional) Image size. Defaults to 'post-thumbnail' but can also be a 2-item array representing width and height in pixels (i.e. array(32,32) ).
134 134
 	 * @param string|array $attr Optional. Query string or array of attributes.
135 135
 	 * @return string HTML image element
136 136
 	 */
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 	/**
160 160
 	 * This uses the wp "wp_get_attachment_image_src()" function to return the feature image for the current class using the given size params.
161
-	 * @param  string|array $size can either be a string: 'thumbnail', 'medium', 'large', 'full' OR 2-item array representing width and height in pixels eg. array(32,32).
161
+	 * @param  integer[] $size can either be a string: 'thumbnail', 'medium', 'large', 'full' OR 2-item array representing width and height in pixels eg. array(32,32).
162 162
 	 * @return string|boolean          the url of the image or false if not found
163 163
 	 */
164 164
 	public function feature_image_url( $size = 'thumbnail' ) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 * This is a method for restoring this_obj using details from the given $revision_id
173 173
 	 *
174 174
 	 * @param int $revision_id 		ID of the revision we're getting data from
175
-	 * @param array $related_obj_names if included this will be used to restore for related obj
175
+	 * @param string[] $related_obj_names if included this will be used to restore for related obj
176 176
 	 *                                 if not included then we just do restore on the meta.
177 177
 	 *                                 We will accept an array of related_obj_names for restoration here.
178 178
 	 * @param array $where_query       You can optionally include an array of key=>value pairs
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	 * Wrapper for get_post_meta, http://codex.wordpress.org/Function_Reference/get_post_meta
228 228
 	 * @param string  $meta_key
229 229
 	 * @param boolean $single
230
-	 * @return mixed <ul><li>If only $id is set it will return all meta values in an associative array.</li>
230
+	 * @return string|null <ul><li>If only $id is set it will return all meta values in an associative array.</li>
231 231
 	 * <li>If $single is set to false, or left blank, the function returns an array containing all values of the specified key.</li>
232 232
 	 * <li>If $single is set to true, the function returns the first value of the specified key (not in an array</li></ul>
233 233
 	 */
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	/**
285 285
 	 * Gets all the term-taxonomies for this CPT
286 286
 	 * @param array $query_params
287
-	 * @return EE_Term_Taxonomy
287
+	 * @return EE_Base_Class[]
288 288
 	 */
289 289
 	public function term_taxonomies( $query_params = array() ) {
290 290
 		return $this->get_many_related( 'Term_Taxonomy', $query_params );
Please login to merge, or discard this patch.
core/db_classes/EE_Event_Message_Template.class.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	 * @param null  $timezone
23 23
 	 * @return EE_Event_Message_Template|mixed
24 24
 	 */
25
-	public static function new_instance( $props_n_values = array(), $timezone = NULL ) {
26
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone );
27
-		return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone );
25
+	public static function new_instance($props_n_values = array(), $timezone = NULL) {
26
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone);
27
+		return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone);
28 28
 	}
29 29
 
30 30
 
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * @param null  $timezone
35 35
 	 * @return EE_Event_Message_Template
36 36
 	 */
37
-	public static function new_instance_from_db ( $props_n_values = array(), $timezone = NULL ) {
38
-		return new self( $props_n_values, TRUE, $timezone );
37
+	public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) {
38
+		return new self($props_n_values, TRUE, $timezone);
39 39
 	}
40 40
 
41 41
 }
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_classes/EE_Event_Question_Group.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Required  by EEM_Event_Question_Group in case someone queries for all its model objects
6 6
  */
7
-class EE_Event_Question_Group extends EE_Base_Class{
7
+class EE_Event_Question_Group extends EE_Base_Class {
8 8
 
9 9
 	/**
10 10
 	 * @param array $props_n_values
11 11
 	 * @return EE_Event_Question_Group|mixed
12 12
 	 */
13
-	public static function new_instance( $props_n_values = array() ) {
14
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
15
-		return $has_object ? $has_object : new self( $props_n_values);
13
+	public static function new_instance($props_n_values = array()) {
14
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
15
+		return $has_object ? $has_object : new self($props_n_values);
16 16
 	}
17 17
 
18 18
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 * @param array $props_n_values
22 22
 	 * @return EE_Event_Question_Group
23 23
 	 */
24
-	public static function new_instance_from_db ( $props_n_values = array() ) {
25
-		return new self( $props_n_values, TRUE );
24
+	public static function new_instance_from_db($props_n_values = array()) {
25
+		return new self($props_n_values, TRUE);
26 26
 	}
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_classes/EE_Event_Venue.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Required  by EEM_Event_Question_Group in case someone queries for all its model objects
4 4
  */
5
-class EE_Event_Venue extends EE_Base_Class{
5
+class EE_Event_Venue extends EE_Base_Class {
6 6
 
7 7
 	/**
8 8
 	 * @param array $props_n_values
9 9
 	 * @return EE_Event_Venue|mixed
10 10
 	 */
11
-	public static function new_instance( $props_n_values = array() ) {
12
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
13
-		return $has_object ? $has_object : new self( $props_n_values);
11
+	public static function new_instance($props_n_values = array()) {
12
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
13
+		return $has_object ? $has_object : new self($props_n_values);
14 14
 	}
15 15
 
16 16
 
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 	 * @param array $props_n_values
20 20
 	 * @return EE_Event_Venue
21 21
 	 */
22
-	public static function new_instance_from_db ( $props_n_values = array() ) {
23
-		return new self( $props_n_values, TRUE );
22
+	public static function new_instance_from_db($props_n_values = array()) {
23
+		return new self($props_n_values, TRUE);
24 24
 	}
25 25
 
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_classes/EE_Payment_Method.class.php 3 patches
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
-do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
+do_action('AHEE_log', __FILE__, __FUNCTION__, '');
3 3
 /**
4 4
  * Event Espresso
5 5
  *
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * ------------------------------------------------------------------------
25 25
  */
26
-class EE_Payment_Method extends EE_Base_Class{
26
+class EE_Payment_Method extends EE_Base_Class {
27 27
 
28 28
 	/**
29 29
 	 * Payment Method type object, which has all the info about this type of payment method,
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 	 * @param array $props_n_values
40 40
 	 * @return EE_Payment_Method
41 41
 	 */
42
-	public static function new_instance( $props_n_values = array()) {
43
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
44
-		return $has_object ? $has_object : new self( $props_n_values, FALSE );
42
+	public static function new_instance($props_n_values = array()) {
43
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
44
+		return $has_object ? $has_object : new self($props_n_values, FALSE);
45 45
 	}
46 46
 
47 47
 
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	 * @param array $props_n_values
52 52
 	 * @return EE_Payment_Method
53 53
 	 */
54
-	public static function new_instance_from_db ( $props_n_values = array()) {
55
-		return new self( $props_n_values, TRUE );
54
+	public static function new_instance_from_db($props_n_values = array()) {
55
+		return new self($props_n_values, TRUE);
56 56
 	}
57 57
 
58 58
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @return boolean
82 82
 	 */
83 83
 	function active() {
84
-		return array_intersect(array_keys(EEM_Payment_Method::instance()->scopes()),$this->scope());
84
+		return array_intersect(array_keys(EEM_Payment_Method::instance()->scopes()), $this->scope());
85 85
 	}
86 86
 
87 87
 
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	 * Sets this PM as active by making it usable within the CART scope. Offline gateways
91 91
 	 * are also usable from the admin-scope as well. DOES NOT SAVE it
92 92
 	 */
93
-	function set_active(){
93
+	function set_active() {
94 94
 		$default_scopes = array(EEM_Payment_Method::scope_cart);
95
-		if($this->type_obj() &&
96
-			$this->type_obj()->payment_occurs() == EE_PMT_Base::offline){
95
+		if ($this->type_obj() &&
96
+			$this->type_obj()->payment_occurs() == EE_PMT_Base::offline) {
97 97
 			$default_scopes[] = EEM_Payment_Method::scope_admin;
98 98
 		}
99 99
 		$this->set_scope($default_scopes);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	/**
105 105
 	 * Makes this payment method apply to NO scopes at all. DOES NOT SAVE it.
106 106
 	 */
107
-	function deactivate(){
107
+	function deactivate() {
108 108
 		$this->set_scope(array());
109 109
 	}
110 110
 
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
 	 * @param type $field_value
296 296
 	 * @param type $use_default
297 297
 	 */
298
-	function set( $field_name, $field_value, $use_default = FALSE ){
299
-		if( $field_name == 'PMD_type' ){
298
+	function set($field_name, $field_value, $use_default = FALSE) {
299
+		if ($field_name == 'PMD_type') {
300 300
 			//the type has probably changed, so forget about its old type object
301 301
 			$this->_type_obj = NULL;
302 302
 		}
@@ -370,26 +370,26 @@  discard block
 block discarded – undo
370 370
 	 * @return EE_PMT_Base
371 371
 	 * @throws EE_Error
372 372
 	 */
373
-	public function type_obj(){
374
-		if( ! $this->_type_obj ) {
375
-			EE_Registry::instance()->load_lib( 'Payment_Method_Manager' );
376
-			if ( EE_Payment_Method_Manager::instance()->payment_method_type_exists( $this->type() )) {
377
-				$class_name = EE_Payment_Method_Manager::instance()->payment_method_class_from_type( $this->type() );
378
-				if ( ! class_exists( $class_name )) {
373
+	public function type_obj() {
374
+		if ( ! $this->_type_obj) {
375
+			EE_Registry::instance()->load_lib('Payment_Method_Manager');
376
+			if (EE_Payment_Method_Manager::instance()->payment_method_type_exists($this->type())) {
377
+				$class_name = EE_Payment_Method_Manager::instance()->payment_method_class_from_type($this->type());
378
+				if ( ! class_exists($class_name)) {
379 379
 					throw new EE_Error(
380 380
 						sprintf(
381
-							__( 'An attempt to use the "%1$s" payment method failed, so it was deactivated.%2$sWas the "%1$s" Plugin recently deactivated? It can be reactivated on the %3$sPlugins Admin Page%4$s', 'event_espresso' ),
381
+							__('An attempt to use the "%1$s" payment method failed, so it was deactivated.%2$sWas the "%1$s" Plugin recently deactivated? It can be reactivated on the %3$sPlugins Admin Page%4$s', 'event_espresso'),
382 382
 							$class_name,
383 383
 							'<br />',
384
-							'<a href="' . admin_url('plugins.php') . '">',
384
+							'<a href="'.admin_url('plugins.php').'">',
385 385
 							'</a>'
386 386
 						)
387 387
 					);
388 388
 				}
389
-				$r = new ReflectionClass( $class_name );
390
-					$this->_type_obj = $r->newInstanceArgs( array( $this ));
389
+				$r = new ReflectionClass($class_name);
390
+					$this->_type_obj = $r->newInstanceArgs(array($this));
391 391
 			} else {
392
-				throw new EE_Error( sprintf( __( 'A payment method of type "%1$s" does not exist. Only ones existing are: %2$s', 'event_espresso' ), $this->type(), implode(',', EE_Payment_Method_Manager::instance()->payment_method_type_names() ) ) );
392
+				throw new EE_Error(sprintf(__('A payment method of type "%1$s" does not exist. Only ones existing are: %2$s', 'event_espresso'), $this->type(), implode(',', EE_Payment_Method_Manager::instance()->payment_method_type_names())));
393 393
 			}
394 394
 		}
395 395
 		return $this->_type_obj;
@@ -402,18 +402,18 @@  discard block
 block discarded – undo
402 402
 	 * and the extra meta. Mostly used for passing off ot gateways.	 *
403 403
 	 * @return array
404 404
 	 */
405
-	public function settings_array(){
405
+	public function settings_array() {
406 406
 		$fields = $this->model_field_array();
407 407
 		$extra_meta = $this->all_extra_meta_array();
408 408
 		//remove the model's prefix from the fields
409 409
 		$combined_settings_array = array();
410
-		foreach($fields as $key => $value){
411
-			if(strpos($key, 'PMD_')===0){
410
+		foreach ($fields as $key => $value) {
411
+			if (strpos($key, 'PMD_') === 0) {
412 412
 				$key_sans_model_prefix = str_replace('PMD_', '', $key);
413 413
 				$combined_settings_array [$key_sans_model_prefix] = $value;
414 414
 			}
415 415
 		}
416
-		$combined_settings_array = array_merge( $extra_meta,$combined_settings_array );
416
+		$combined_settings_array = array_merge($extra_meta, $combined_settings_array);
417 417
 		return $combined_settings_array;
418 418
 	}
419 419
 
@@ -425,12 +425,12 @@  discard block
 block discarded – undo
425 425
 	 * @param string $css_class
426 426
 	 * @return string of HTML for displaying the button
427 427
 	 */
428
-	public function button_html( $url = '', $css_class = '' ){
428
+	public function button_html($url = '', $css_class = '') {
429 429
 		$payment_occurs = $this->type_obj()->payment_occurs();
430 430
 		return '
431
-		 <div id="' . $this->slug() . '-payment-option-dv" class="'. $payment_occurs .'-payment-gateway reg-page-payment-option-dv' . $css_class . '">
432
-			<a id="payment-gateway-button-' . $this->slug() . '" class="reg-page-payment-option-lnk" rel="' . $this->slug() . '" href="' . $url . '" >
433
-				<img src="' . $this->button_url() . '" alt="' . sprintf( esc_attr__( 'Pay using %s', 'event_espresso' ), $this->get_pretty('PMD_name','form_input') ) . '" />
431
+		 <div id="' . $this->slug().'-payment-option-dv" class="'.$payment_occurs.'-payment-gateway reg-page-payment-option-dv'.$css_class.'">
432
+			<a id="payment-gateway-button-' . $this->slug().'" class="reg-page-payment-option-lnk" rel="'.$this->slug().'" href="'.$url.'" >
433
+				<img src="' . $this->button_url().'" alt="'.sprintf(esc_attr__('Pay using %s', 'event_espresso'), $this->get_pretty('PMD_name', 'form_input')).'" />
434 434
 			</a>
435 435
 		</div>
436 436
 ';
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	 * (as defined by the gateway and the currently active currencies)
444 444
 	 * @return EE_Currency[]
445 445
 	 */
446
-	public function get_all_usable_currencies(){
446
+	public function get_all_usable_currencies() {
447 447
 		return EEM_Currency::instance()->get_all_currencies_usable_by($this->type_obj());
448 448
 	}
449 449
 
@@ -452,9 +452,9 @@  discard block
 block discarded – undo
452 452
 	 * @param string $currency_code currency ID (code)
453 453
 	 * @return boolean
454 454
 	 */
455
-	public function usable_for_currency( $currency_code ) {
456
-		foreach( $this->get_all_usable_currencies() as $currency_obj ) {
457
-			if( $currency_obj->ID() == $currency_code ){
455
+	public function usable_for_currency($currency_code) {
456
+		foreach ($this->get_all_usable_currencies() as $currency_obj) {
457
+			if ($currency_obj->ID() == $currency_code) {
458 458
 				return TRUE;
459 459
 			}
460 460
 		}
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	 * Returns TRUE if this payment method's gateway is an instance of EE_Onsite_Gateway
468 468
 	 * @return bool
469 469
 	 */
470
-	public function is_on_site(){
470
+	public function is_on_site() {
471 471
 		return $this->type_obj()->payment_occurs() == EE_PMT_Base::onsite;
472 472
 	}
473 473
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 	 * Returns TRUE if this payment method's gateway is an instance of EE_Offsite_Gateway
478 478
 	 * @return bool
479 479
 	 */
480
-	public function is_off_site(){
480
+	public function is_off_site() {
481 481
 		return $this->type_obj()->payment_occurs() == EE_PMT_Base::offsite;
482 482
 	}
483 483
 
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 	 * Returns TRUE if this payment method does not utilize a gateway
488 488
 	 * @return bool
489 489
 	 */
490
-	public function is_off_line(){
490
+	public function is_off_line() {
491 491
 		return $this->type_obj()->payment_occurs() == EE_PMT_Base::offline;
492 492
 	}
493 493
 
@@ -497,10 +497,10 @@  discard block
 block discarded – undo
497 497
 	 * to load the required classes, and don't need them at the time of unserialization
498 498
 	 * @return array
499 499
 	 */
500
-	public function __sleep(){
501
-		$properties =  get_object_vars( $this );
502
-		unset( $properties[ '_type_obj' ] );
503
-		return array_keys( $properties );
500
+	public function __sleep() {
501
+		$properties = get_object_vars($this);
502
+		unset($properties['_type_obj']);
503
+		return array_keys($properties);
504 504
 	}
505 505
 
506 506
 
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
 do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
3 5
 /**
4 6
  * Event Espresso
Please login to merge, or discard this patch.
Doc Comments   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 	/**
114 114
 	 * Gets button_url
115
-	 * @return string
115
+	 * @return boolean
116 116
 	 */
117 117
 	function button_url() {
118 118
 		return $this->get('PMD_button_url');
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
 	/**
154 154
 	 * Gets description
155
-	 * @return string
155
+	 * @return boolean
156 156
 	 */
157 157
 	function description() {
158 158
 		return $this->get('PMD_desc');
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
 	/**
174 174
 	 * Gets name
175
-	 * @return string
175
+	 * @return boolean
176 176
 	 */
177 177
 	function name() {
178 178
 		return $this->get('PMD_name');
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 	/**
214 214
 	 * Gets order
215
-	 * @return int
215
+	 * @return boolean
216 216
 	 */
217 217
 	function order() {
218 218
 		return $this->get('PMD_order');
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
 	/**
234 234
 	 * Gets slug
235
-	 * @return string
235
+	 * @return boolean
236 236
 	 */
237 237
 	function slug() {
238 238
 		return $this->get('PMD_slug');
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
 	/**
254 254
 	 * Gets type
255
-	 * @return string
255
+	 * @return boolean
256 256
 	 */
257 257
 	function type() {
258 258
 		return $this->get('PMD_type');
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
 	/**
274 274
 	 * Gets wp_user
275
-	 * @return int
275
+	 * @return boolean
276 276
 	 */
277 277
 	function wp_user() {
278 278
 		return $this->get('PMD_wp_user');
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
 	/**
309 309
 	 * Gets admin_name
310
-	 * @return string
310
+	 * @return boolean
311 311
 	 */
312 312
 	function admin_name() {
313 313
 		return $this->get('PMD_admin_name');
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
 	/**
329 329
 	 * Gets admin_desc
330
-	 * @return string
330
+	 * @return boolean
331 331
 	 */
332 332
 	function admin_desc() {
333 333
 		return $this->get('PMD_admin_desc');
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
 	/**
349 349
 	 * Gets scope
350
-	 * @return array
350
+	 * @return boolean
351 351
 	 */
352 352
 	function scope() {
353 353
 		return $this->get('PMD_scope');
Please login to merge, or discard this patch.
core/db_classes/EE_Question_Group_Question.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Required  by EEM_Question_Group_Question in case someone queries for all its model objects
4 4
  */
5
-class EE_Question_Group_Question extends EE_Base_Class{
5
+class EE_Question_Group_Question extends EE_Base_Class {
6 6
 
7 7
 	/**
8 8
 	 * @param array $props_n_values
9 9
 	 * @return EE_Question_Group_Question|mixed
10 10
 	 */
11
-	public static function new_instance( $props_n_values = array() ) {
12
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
13
-		return $has_object ? $has_object : new self( $props_n_values );
11
+	public static function new_instance($props_n_values = array()) {
12
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
13
+		return $has_object ? $has_object : new self($props_n_values);
14 14
 	}
15 15
 
16 16
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	 * @param array $props_n_values
20 20
 	 * @return EE_Question_Group_Question
21 21
 	 */
22
-	public static function new_instance_from_db ( $props_n_values = array() ) {
23
-		return new self( $props_n_values, TRUE );
22
+	public static function new_instance_from_db($props_n_values = array()) {
23
+		return new self($props_n_values, TRUE);
24 24
 	}
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_classes/EE_Registration.class.php 4 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 			parent::set( 'STS_ID', $new_STS_ID, $use_default );
127 127
 			do_action( 'AHEE__EE_Registration__set_status__after_update', $this );
128 128
 			return TRUE;
129
-		}else{
129
+		} else{
130 130
 			//even though the old value matches the new value, it's still good to
131 131
 			//allow the parent set method to have a say
132 132
 			parent::set( 'STS_ID', $new_STS_ID, $use_default );
@@ -625,8 +625,9 @@  discard block
 block discarded – undo
625 625
 	 * @return EE_Registration
626 626
 	 */
627 627
 	public function get_primary_registration()  {
628
-		if ( $this->is_primary_registrant() )
629
-			return $this;
628
+		if ( $this->is_primary_registrant() ) {
629
+					return $this;
630
+		}
630 631
 
631 632
 		//k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1
632 633
 		$primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) );
Please login to merge, or discard this patch.
Spacing   +180 added lines, -180 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * EE_Registration class
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 	 *                             		    date_format and the second value is the time format
42 42
 	 * @return EE_Registration
43 43
 	 */
44
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
45
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
46
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
44
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
45
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
46
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
47 47
 	}
48 48
 
49 49
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	 *                          		the website will be used.
55 55
 	 * @return EE_Registration
56 56
 	 */
57
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
58
-		return new self( $props_n_values, TRUE, $timezone );
57
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
58
+		return new self($props_n_values, TRUE, $timezone);
59 59
 	}
60 60
 
61 61
 
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	 * @access        public
67 67
 	 * @param        int $EVT_ID Event ID
68 68
 	 */
69
-	public function set_event( $EVT_ID = 0 ) {
70
-		$this->set( 'EVT_ID', $EVT_ID );
69
+	public function set_event($EVT_ID = 0) {
70
+		$this->set('EVT_ID', $EVT_ID);
71 71
 	}
72 72
 
73 73
 
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
 	 * @param mixed  $field_value
79 79
 	 * @param bool   $use_default
80 80
 	 */
81
-	public function set( $field_name, $field_value, $use_default = FALSE ) {
82
-		switch( $field_name ) {
81
+	public function set($field_name, $field_value, $use_default = FALSE) {
82
+		switch ($field_name) {
83 83
 			case 'REG_code' :
84
-				if ( ! empty( $field_value ) && $this->reg_code() == '' ) {
85
-					$this->set_reg_code( $field_value, $use_default );
84
+				if ( ! empty($field_value) && $this->reg_code() == '') {
85
+					$this->set_reg_code($field_value, $use_default);
86 86
 				}
87 87
 				break;
88 88
 			case 'STS_ID' :
89
-				$this->set_status( $field_value, $use_default );
89
+				$this->set_status($field_value, $use_default);
90 90
 				break;
91 91
 			default :
92
-				parent::set( $field_name, $field_value, $use_default );
92
+				parent::set($field_name, $field_value, $use_default);
93 93
 		}
94 94
 	}
95 95
 
@@ -106,30 +106,30 @@  discard block
 block discarded – undo
106 106
 	 * @param boolean $use_default
107 107
 	 * @return bool
108 108
 	 */
109
-	public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) {
109
+	public function set_status($new_STS_ID = NULL, $use_default = FALSE) {
110 110
 		// get current REG_Status
111 111
 		$old_STS_ID = $this->status_ID();
112 112
 		// if status has changed
113
-		if ( $old_STS_ID != $new_STS_ID  ) {
113
+		if ($old_STS_ID != $new_STS_ID) {
114 114
 			// TO approved
115
-			if ( $new_STS_ID == EEM_Registration::status_id_approved ) {
115
+			if ($new_STS_ID == EEM_Registration::status_id_approved) {
116 116
 				// reserve a space by incrementing ticket and datetime sold values
117 117
 				$this->_reserve_registration_space();
118
-				do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID );
118
+				do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID);
119 119
 			// OR FROM  approved
120
-			} else if ( $old_STS_ID == EEM_Registration::status_id_approved ) {
120
+			} else if ($old_STS_ID == EEM_Registration::status_id_approved) {
121 121
 				// release a space by decrementing ticket and datetime sold values
122 122
 				$this->_release_registration_space();
123
-				do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID );
123
+				do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID);
124 124
 			}
125 125
 			// update status
126
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
127
-			do_action( 'AHEE__EE_Registration__set_status__after_update', $this );
126
+			parent::set('STS_ID', $new_STS_ID, $use_default);
127
+			do_action('AHEE__EE_Registration__set_status__after_update', $this);
128 128
 			return TRUE;
129
-		}else{
129
+		} else {
130 130
 			//even though the old value matches the new value, it's still good to
131 131
 			//allow the parent set method to have a say
132
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
132
+			parent::set('STS_ID', $new_STS_ID, $use_default);
133 133
 			return TRUE;
134 134
 		}
135 135
 	}
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @access        public
142 142
 	 */
143 143
 	public function status_ID() {
144
-		return $this->get( 'STS_ID' );
144
+		return $this->get('STS_ID');
145 145
 	}
146 146
 
147 147
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 * @param boolean $include_archived whether to include archived tickets or not.
167 167
 	 * @return EE_Ticket
168 168
 	 */
169
-	public function ticket( $include_archived = TRUE ) {
169
+	public function ticket($include_archived = TRUE) {
170 170
 		$query_params = array();
171
-		if ( $include_archived ) {
172
-			$query_params[ 'default_where_conditions' ] = 'none';
171
+		if ($include_archived) {
172
+			$query_params['default_where_conditions'] = 'none';
173 173
 		}
174
-		return $this->get_first_related( 'Ticket', $query_params );
174
+		return $this->get_first_related('Ticket', $query_params);
175 175
 	}
176 176
 
177 177
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 * @return EE_Event
182 182
 	 */
183 183
 	public function event() {
184
-		return $this->get_first_related( 'Event' );
184
+		return $this->get_first_related('Event');
185 185
 	}
186 186
 
187 187
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	public function wp_user() {
197 197
 		$event = $this->event();
198
-		if ( $event instanceof EE_Event ) {
198
+		if ($event instanceof EE_Event) {
199 199
 			return $event->wp_user();
200 200
 		}
201 201
 		return 0;
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	 * @access        public
222 222
 	 * @param        int $ATT_ID Attendee ID
223 223
 	 */
224
-	public function set_attendee_id( $ATT_ID = 0 ) {
225
-		$this->set( 'ATT_ID', $ATT_ID );
224
+	public function set_attendee_id($ATT_ID = 0) {
225
+		$this->set('ATT_ID', $ATT_ID);
226 226
 	}
227 227
 
228 228
 
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 	 * @access        public
234 234
 	 * @param        int $TXN_ID Transaction ID
235 235
 	 */
236
-	public function set_transaction_id( $TXN_ID = 0 ) {
237
-		$this->set( 'TXN_ID', $TXN_ID );
236
+	public function set_transaction_id($TXN_ID = 0) {
237
+		$this->set('TXN_ID', $TXN_ID);
238 238
 	}
239 239
 
240 240
 
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
 	 * @access    public
246 246
 	 * @param    string $REG_session PHP Session ID
247 247
 	 */
248
-	public function set_session( $REG_session = '' ) {
249
-		$this->set( 'REG_session', $REG_session );
248
+	public function set_session($REG_session = '') {
249
+		$this->set('REG_session', $REG_session);
250 250
 	}
251 251
 
252 252
 
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 	 * @access    public
258 258
 	 * @param    string $REG_url_link Registration URL Link
259 259
 	 */
260
-	public function set_reg_url_link( $REG_url_link = '' ) {
261
-		$this->set( 'REG_url_link', $REG_url_link );
260
+	public function set_reg_url_link($REG_url_link = '') {
261
+		$this->set('REG_url_link', $REG_url_link);
262 262
 	}
263 263
 
264 264
 
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 	 * @access        public
270 270
 	 * @param        int $REG_count Primary Attendee
271 271
 	 */
272
-	public function set_count( $REG_count = 1 ) {
273
-		$this->set( 'REG_count', $REG_count );
272
+	public function set_count($REG_count = 1) {
273
+		$this->set('REG_count', $REG_count);
274 274
 	}
275 275
 
276 276
 
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
 	 * @access        public
282 282
 	 * @param        boolean $REG_group_size Group Registration
283 283
 	 */
284
-	public function set_group_size( $REG_group_size = FALSE ) {
285
-		$this->set( 'REG_group_size', $REG_group_size );
284
+	public function set_group_size($REG_group_size = FALSE) {
285
+		$this->set('REG_group_size', $REG_group_size);
286 286
 	}
287 287
 
288 288
 
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 	 * @access        public
366 366
 	 * @param        mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date
367 367
 	 */
368
-	public function set_reg_date( $REG_date = FALSE ) {
369
-		$this->set( 'REG_date', $REG_date );
368
+	public function set_reg_date($REG_date = FALSE) {
369
+		$this->set('REG_date', $REG_date);
370 370
 	}
371 371
 
372 372
 
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 	 * @access    public
378 378
 	 * @param    float $REG_final_price
379 379
 	 */
380
-	public function set_final_price( $REG_final_price = 0.00 ) {
381
-		$this->set( 'REG_final_price', $REG_final_price );
380
+	public function set_final_price($REG_final_price = 0.00) {
381
+		$this->set('REG_final_price', $REG_final_price);
382 382
 	}
383 383
 
384 384
 
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
 	 * @access    public
390 390
 	 * @param    float $REG_paid
391 391
 	 */
392
-	public function set_paid( $REG_paid = 0.00 ) {
393
-		$this->set( 'REG_paid', $REG_paid );
392
+	public function set_paid($REG_paid = 0.00) {
393
+		$this->set('REG_paid', $REG_paid);
394 394
 	}
395 395
 
396 396
 
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 	 * @access        public
402 402
 	 * @param        boolean $REG_att_is_going Attendee Is Going
403 403
 	 */
404
-	public function set_att_is_going( $REG_att_is_going = FALSE ) {
405
-		$this->set( 'REG_att_is_going', $REG_att_is_going );
404
+	public function set_att_is_going($REG_att_is_going = FALSE) {
405
+		$this->set('REG_att_is_going', $REG_att_is_going);
406 406
 	}
407 407
 
408 408
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 * @return EE_Attendee
413 413
 	 */
414 414
 	public function attendee() {
415
-		return $this->get_first_related( 'Attendee' );
415
+		return $this->get_first_related('Attendee');
416 416
 	}
417 417
 
418 418
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	 * @access        public
423 423
 	 */
424 424
 	public function event_ID() {
425
-		return $this->get( 'EVT_ID' );
425
+		return $this->get('EVT_ID');
426 426
 	}
427 427
 
428 428
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 	 */
434 434
 	public function event_name() {
435 435
 		$event = $this->event_obj();
436
-		if ( $event ) {
436
+		if ($event) {
437 437
 			return $event->name();
438 438
 		} else {
439 439
 			return NULL;
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	 * @return EE_Event
448 448
 	 */
449 449
 	public function event_obj() {
450
-		return $this->get_first_related( 'Event' );
450
+		return $this->get_first_related('Event');
451 451
 	}
452 452
 
453 453
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 	 * @access        public
458 458
 	 */
459 459
 	public function attendee_ID() {
460
-		return $this->get( 'ATT_ID' );
460
+		return $this->get('ATT_ID');
461 461
 	}
462 462
 
463 463
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	 * @access        public
468 468
 	 */
469 469
 	public function session_ID() {
470
-		return $this->get( 'REG_session' );
470
+		return $this->get('REG_session');
471 471
 	}
472 472
 
473 473
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
478 478
 	 * @return string
479 479
 	 */
480
-	public function receipt_url( $messenger = 'html' ) {
480
+	public function receipt_url($messenger = 'html') {
481 481
 
482 482
 		/**
483 483
 		 * The below will be deprecated one version after this.  We check first if there is a custom receipt template already in use on old system.  If there is then we just return the standard url for it.
@@ -486,12 +486,12 @@  discard block
 block discarded – undo
486 486
 		 */
487 487
 		EE_Registry::instance()->load_helper('Template');
488 488
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php';
489
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
489
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
490 490
 
491
-		if ( $has_custom ) {
492
-			return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) );
491
+		if ($has_custom) {
492
+			return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch'));
493 493
 		}
494
-		return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' );
494
+		return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt');
495 495
 	}
496 496
 
497 497
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
503 503
 	 * @return string
504 504
 	 */
505
-	public function invoice_url( $messenger = 'html' ) {
505
+	public function invoice_url($messenger = 'html') {
506 506
 		/**
507 507
 		 * The below will be deprecated one version after this.  We check first if there is a custom invoice template already in use on old system.  If there is then we just return the standard url for it.
508 508
 		 *
@@ -510,21 +510,21 @@  discard block
 block discarded – undo
510 510
 		 */
511 511
 		EE_Registry::instance()->load_helper('Template');
512 512
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php';
513
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
513
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
514 514
 
515
-		if ( $has_custom ) {
516
-			if ( $messenger == 'html' ) {
517
-				return $this->invoice_url( 'launch' );
515
+		if ($has_custom) {
516
+			if ($messenger == 'html') {
517
+				return $this->invoice_url('launch');
518 518
 			}
519 519
 			$route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice';
520 520
 
521
-			$query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() );
522
-			if ( $messenger == 'html' ) {
521
+			$query_args = array('ee' => $route, 'id' => $this->reg_url_link());
522
+			if ($messenger == 'html') {
523 523
 				$query_args['html'] = TRUE;
524 524
 			}
525
-			return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) );
525
+			return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id));
526 526
 		}
527
-		return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' );
527
+		return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice');
528 528
 	}
529 529
 
530 530
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 * @access        public
535 535
 	 */
536 536
 	public function reg_url_link() {
537
-		return $this->get( 'REG_url_link' );
537
+		return $this->get('REG_url_link');
538 538
 	}
539 539
 
540 540
 
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
 	 * @param string $type 'download','launch', or 'html' (default is 'launch')
545 545
 	 * @return void
546 546
 	 */
547
-	public function e_invoice_url( $type = 'launch' ) {
548
-		echo $this->invoice_url( $type );
547
+	public function e_invoice_url($type = 'launch') {
548
+		echo $this->invoice_url($type);
549 549
 	}
550 550
 
551 551
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 	 * @return string
566 566
 	 */
567 567
 	public function payment_overview_url() {
568
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() );
568
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url());
569 569
 	}
570 570
 
571 571
 
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	 * @return string
577 577
 	 */
578 578
 	public function edit_attendee_information_url() {
579
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() );
579
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url());
580 580
 	}
581 581
 
582 582
 
@@ -586,8 +586,8 @@  discard block
 block discarded – undo
586 586
 	 * @return string
587 587
 	 */
588 588
 	public function get_admin_edit_url() {
589
-		EE_Registry::instance()->load_helper( 'URL' );
590
-		return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) );
589
+		EE_Registry::instance()->load_helper('URL');
590
+		return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php'));
591 591
 	}
592 592
 
593 593
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	 * @access        public
598 598
 	 */
599 599
 	public function is_primary_registrant() {
600
-		return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE;
600
+		return $this->get('REG_count') == 1 ? TRUE : FALSE;
601 601
 	}
602 602
 
603 603
 
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
 	 * This returns the primary registration object for this registration group (which may be this object).
607 607
 	 * @return EE_Registration
608 608
 	 */
609
-	public function get_primary_registration()  {
610
-		if ( $this->is_primary_registrant() )
609
+	public function get_primary_registration() {
610
+		if ($this->is_primary_registrant())
611 611
 			return $this;
612 612
 
613 613
 		//k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1
614
-		$primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) );
614
+		$primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1)));
615 615
 		return $primary_registrant;
616 616
 	}
617 617
 
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	* 		@access		public
623 623
 	*/
624 624
 	public function count() {
625
-		return $this->get( 'REG_count' );
625
+		return $this->get('REG_count');
626 626
 	}
627 627
 
628 628
 
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 	 * @access        public
633 633
 	 */
634 634
 	public function group_size() {
635
-		return $this->get( 'REG_group_size' );
635
+		return $this->get('REG_group_size');
636 636
 	}
637 637
 
638 638
 
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 	 * @access        public
643 643
 	 */
644 644
 	public function date() {
645
-		return $this->get( 'REG_date' );
645
+		return $this->get('REG_date');
646 646
 	}
647 647
 
648 648
 
@@ -653,8 +653,8 @@  discard block
 block discarded – undo
653 653
 	 * @param string $time_format
654 654
 	 * @return string
655 655
 	 */
656
-	public function pretty_date( $date_format = NULL, $time_format = NULL ) {
657
-		return $this->get_datetime( 'REG_date', $date_format, $time_format );
656
+	public function pretty_date($date_format = NULL, $time_format = NULL) {
657
+		return $this->get_datetime('REG_date', $date_format, $time_format);
658 658
 	}
659 659
 
660 660
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 	 * @return    float
668 668
 	 */
669 669
 	public function final_price() {
670
-		return $this->get( 'REG_final_price' );
670
+		return $this->get('REG_final_price');
671 671
 	}
672 672
 
673 673
 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 	 * @return string
679 679
 	 */
680 680
 	public function pretty_final_price() {
681
-		return $this->get_pretty( 'REG_final_price' );
681
+		return $this->get_pretty('REG_final_price');
682 682
 	}
683 683
 
684 684
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 	 * @return 	float
690 690
 	 */
691 691
 	public function paid() {
692
-		return $this->get( 'REG_paid' );
692
+		return $this->get('REG_paid');
693 693
 	}
694 694
 
695 695
 
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 	 * @return 	float
701 701
 	 */
702 702
 	public function pretty_paid() {
703
-		return $this->get_pretty( 'REG_paid' );
703
+		return $this->get_pretty('REG_paid');
704 704
 	}
705 705
 
706 706
 
@@ -712,11 +712,11 @@  discard block
 block discarded – undo
712 712
 	 * @param array $requires_payment
713 713
 	 * @return bool
714 714
 	 */
715
-	public function owes_monies_and_can_pay( $requires_payment = array()) {
715
+	public function owes_monies_and_can_pay($requires_payment = array()) {
716 716
 		// these reg statuses require payment (if event is not free)
717
-		$requires_payment = ! empty( $requires_payment ) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment();
717
+		$requires_payment = ! empty($requires_payment) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment();
718 718
 		if (
719
-			in_array( $this->status_ID(), $requires_payment ) &&
719
+			in_array($this->status_ID(), $requires_payment) &&
720 720
 			$this->final_price() != 0 &&
721 721
 			$this->final_price() != $this->paid()
722 722
 		) {
@@ -733,8 +733,8 @@  discard block
 block discarded – undo
733 733
 	 * @param bool $show_icons
734 734
 	 * @return void
735 735
 	 */
736
-	public function e_pretty_status( $show_icons = FALSE ) {
737
-		echo $this->pretty_status( $show_icons );
736
+	public function e_pretty_status($show_icons = FALSE) {
737
+		echo $this->pretty_status($show_icons);
738 738
 	}
739 739
 
740 740
 
@@ -745,10 +745,10 @@  discard block
 block discarded – undo
745 745
 	 * @param bool $show_icons
746 746
 	 * @return string
747 747
 	 */
748
-	public function pretty_status( $show_icons = FALSE ) {
749
-		$status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' );
748
+	public function pretty_status($show_icons = FALSE) {
749
+		$status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence');
750 750
 		$icon = '';
751
-		switch ( $this->status_ID() ) {
751
+		switch ($this->status_ID()) {
752 752
 			case EEM_Registration::status_id_approved:
753 753
 				$icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : '';
754 754
 				break;
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 				$icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : '';
769 769
 				break;
770 770
 		}
771
-		return $icon . $status[ $this->status_ID() ];
771
+		return $icon.$status[$this->status_ID()];
772 772
 	}
773 773
 
774 774
 
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 	 * @access        public
779 779
 	 */
780 780
 	public function att_is_going() {
781
-		return $this->get( 'REG_att_is_going' );
781
+		return $this->get('REG_att_is_going');
782 782
 	}
783 783
 
784 784
 
@@ -788,8 +788,8 @@  discard block
 block discarded – undo
788 788
 	 * @param array $query_params like EEM_Base::get_all
789 789
 	 * @return EE_Answer[]
790 790
 	 */
791
-	public function answers( $query_params = NULL ) {
792
-		return $this->get_many_related( 'Answer', $query_params );
791
+	public function answers($query_params = NULL) {
792
+		return $this->get_many_related('Answer', $query_params);
793 793
 	}
794 794
 
795 795
 
@@ -803,9 +803,9 @@  discard block
 block discarded – undo
803 803
 	 * (because the answer might be an array of answer values, so passing pretty_value=true
804 804
 	 * will convert it into some kind of string)
805 805
 	 */
806
-	public function answer_value_to_question( $question, $pretty_value=true ) {
806
+	public function answer_value_to_question($question, $pretty_value = true) {
807 807
 		$question_id = EEM_Question::instance()->ensure_is_ID($question);
808
-		return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value);
808
+		return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value);
809 809
 	}
810 810
 
811 811
 
@@ -818,13 +818,13 @@  discard block
 block discarded – undo
818 818
 	 */
819 819
 	public function question_groups() {
820 820
 		$question_groups = array();
821
-		if ( $this->event() instanceof EE_Event ) {
821
+		if ($this->event() instanceof EE_Event) {
822 822
 			$question_groups = $this->event()->question_groups(
823 823
 				array(
824 824
 					array(
825 825
 						'Event_Question_Group.EQG_primary' => $this->count() == 1 ? true : false
826 826
 					),
827
-					'order_by' => array( 'QSG_order' => 'ASC' )
827
+					'order_by' => array('QSG_order' => 'ASC')
828 828
 				)
829 829
 			);
830 830
 		}
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 	 */
842 842
 	public function count_question_groups() {
843 843
 		$qg_count = 0;
844
-		if ( $this->event() instanceof EE_Event ) {
844
+		if ($this->event() instanceof EE_Event) {
845 845
 			$qg_count = $this->event()->count_related(
846 846
 				'Question_Group',
847 847
 				array(
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 	 * @return string
863 863
 	 */
864 864
 	public function reg_date() {
865
-		return $this->get_datetime( 'REG_date' );
865
+		return $this->get_datetime('REG_date');
866 866
 	}
867 867
 
868 868
 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 	 * @return EE_Datetime_Ticket
875 875
 	 */
876 876
 	public function datetime_ticket() {
877
-		return $this->get_first_related( 'Datetime_Ticket' );
877
+		return $this->get_first_related('Datetime_Ticket');
878 878
 	}
879 879
 
880 880
 
@@ -884,15 +884,15 @@  discard block
 block discarded – undo
884 884
 	 * @param EE_Datetime_Ticket $datetime_ticket
885 885
 	 * @return EE_Datetime_Ticket
886 886
 	 */
887
-	public function set_datetime_ticket( $datetime_ticket ) {
888
-		return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' );
887
+	public function set_datetime_ticket($datetime_ticket) {
888
+		return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket');
889 889
 	}
890 890
 	/**
891 891
 	 * Gets deleted
892 892
 	 * @return boolean
893 893
 	 */
894 894
 	public function deleted() {
895
-		return $this->get( 'REG_deleted' );
895
+		return $this->get('REG_deleted');
896 896
 	}
897 897
 
898 898
 	/**
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 	 * @return boolean
902 902
 	 */
903 903
 	public function set_deleted($deleted) {
904
-		$this->set( 'REG_deleted', $deleted );
904
+		$this->set('REG_deleted', $deleted);
905 905
 	}
906 906
 
907 907
 
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 	 * @return EE_Status
912 912
 	 */
913 913
 	public function status_obj() {
914
-		return $this->get_first_related( 'Status' );
914
+		return $this->get_first_related('Status');
915 915
 	}
916 916
 
917 917
 
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
 	 * @return int
923 923
 	 */
924 924
 	public function count_checkins() {
925
-		return $this->get_model()->count_related( $this, 'Checkin' );
925
+		return $this->get_model()->count_related($this, 'Checkin');
926 926
 	}
927 927
 
928 928
 
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 	 * @return int
933 933
 	 */
934 934
 	public function count_checkins_not_checkedout() {
935
-		return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) );
935
+		return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1)));
936 936
 	}
937 937
 
938 938
 
@@ -945,20 +945,20 @@  discard block
 block discarded – undo
945 945
 	 *
946 946
 	 * @return bool
947 947
 	 */
948
-	public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) {
949
-		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID );
948
+	public function can_checkin($DTT_OR_ID, $check_approved = TRUE) {
949
+		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID);
950 950
 
951 951
 		//first check registration status
952
-		if (  ( $check_approved && ! $this->is_approved() ) || ! $DTT_ID ) {
952
+		if (($check_approved && ! $this->is_approved()) || ! $DTT_ID) {
953 953
 			return false;
954 954
 		}
955 955
 		//is there a datetime ticket that matches this dtt_ID?
956
-		if ( ! ( EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) ) ) ) {
956
+		if ( ! (EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID))))) {
957 957
 			return false;
958 958
 		}
959 959
 
960 960
 		//final check is against TKT_uses
961
-		return $this->verify_can_checkin_against_TKT_uses( $DTT_ID );
961
+		return $this->verify_can_checkin_against_TKT_uses($DTT_ID);
962 962
 	}
963 963
 
964 964
 
@@ -971,10 +971,10 @@  discard block
 block discarded – undo
971 971
 	 * @param int | EE_Datetime  $DTT_OR_ID  The datetime the registration is being checked against
972 972
 	 * @return bool   true means can checkin.  false means cannot checkin.
973 973
 	 */
974
-	public function verify_can_checkin_against_TKT_uses( $DTT_OR_ID ) {
975
-		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID );
974
+	public function verify_can_checkin_against_TKT_uses($DTT_OR_ID) {
975
+		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID);
976 976
 
977
-		if ( ! $DTT_ID ) {
977
+		if ( ! $DTT_ID) {
978 978
 			return false;
979 979
 		}
980 980
 
@@ -982,23 +982,23 @@  discard block
 block discarded – undo
982 982
 
983 983
 		// if max uses is not set or equals infinity then return true cause its not a factor for whether user can check-in
984 984
 		// or not.
985
-		if ( ! $max_uses || $max_uses === EE_INF ) {
985
+		if ( ! $max_uses || $max_uses === EE_INF) {
986 986
 			return true;
987 987
 		}
988 988
 
989 989
 		//does this datetime have a checkin record?  If so, then the dtt count has already been verified so we can just
990 990
 		//go ahead and toggle.
991
-		if ( EEM_Checkin::instance()->exists( array( array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID ) ) ) ) {
991
+		if (EEM_Checkin::instance()->exists(array(array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID)))) {
992 992
 			return true;
993 993
 		}
994 994
 
995 995
 		//made it here so the last check is whether the number of checkins per unique datetime on this registration
996 996
 		//disallows further check-ins.
997
-		$count_unique_dtt_checkins = EEM_Checkin::instance()->count( array( array( 'REG_ID' => $this->ID(), 'CHK_in' => true ) ), 'DTT_ID', true );
997
+		$count_unique_dtt_checkins = EEM_Checkin::instance()->count(array(array('REG_ID' => $this->ID(), 'CHK_in' => true)), 'DTT_ID', true);
998 998
 		// checkins have already reached their max number of uses
999 999
 		// so registrant can NOT checkin
1000
-		if ( $count_unique_dtt_checkins >= $max_uses ) {
1001
-			EE_Error::add_error( __( 'Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1000
+		if ($count_unique_dtt_checkins >= $max_uses) {
1001
+			EE_Error::add_error(__('Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1002 1002
 			return false;
1003 1003
 		}
1004 1004
 		return true;
@@ -1019,15 +1019,15 @@  discard block
 block discarded – undo
1019 1019
 	 * @param  bool $verify  If true then can_checkin() is used to verify whether the person can be checked in or not.  Otherwise this forces change in checkin status.
1020 1020
 	 * @return int|BOOL            the chk_in status toggled to OR false if nothing got changed.
1021 1021
 	 */
1022
-	public function toggle_checkin_status( $DTT_ID = null, $verify = false ) {
1023
-		if ( empty( $DTT_ID ) ) {
1022
+	public function toggle_checkin_status($DTT_ID = null, $verify = false) {
1023
+		if (empty($DTT_ID)) {
1024 1024
 			$datetime = $this->get_related_primary_datetime();
1025 1025
 			$DTT_ID = $datetime->ID();
1026 1026
 		// verify the registration can checkin for the given DTT_ID
1027
-		} elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) {
1027
+		} elseif ( ! $this->can_checkin($DTT_ID, $verify)) {
1028 1028
 			EE_Error::add_error(
1029 1029
 					sprintf(
1030
-						__( 'The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'),
1030
+						__('The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'),
1031 1031
 						$this->ID(),
1032 1032
 						$DTT_ID
1033 1033
 					),
@@ -1041,8 +1041,8 @@  discard block
 block discarded – undo
1041 1041
 			EE_Registration::checkin_status_out => EE_Registration::checkin_status_in
1042 1042
 		);
1043 1043
 		//start by getting the current status so we know what status we'll be changing to.
1044
-		$cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL );
1045
-		$status_to = $status_paths[ $cur_status ];
1044
+		$cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL);
1045
+		$status_to = $status_paths[$cur_status];
1046 1046
 		// database only records true for checked IN or false for checked OUT
1047 1047
 		// no record ( null ) means checked in NEVER, but we obviously don't save that
1048 1048
 		$new_status = $status_to == EE_Registration::checkin_status_in ? true : false;
@@ -1050,24 +1050,24 @@  discard block
 block discarded – undo
1050 1050
 		// because we are keeping track of Check-ins over time.
1051 1051
 		// Eventually we'll probably want to show a list table
1052 1052
 		// for the individual Check-ins so that they can be managed.
1053
-		$checkin = EE_Checkin::new_instance( array(
1053
+		$checkin = EE_Checkin::new_instance(array(
1054 1054
 				'REG_ID' => $this->ID(),
1055 1055
 				'DTT_ID' => $DTT_ID,
1056 1056
 				'CHK_in' => $new_status
1057
-		) );
1057
+		));
1058 1058
 		// if the record could not be saved then return false
1059
-		if ( $checkin->save() === 0 ) {
1060
-			if ( WP_DEBUG ) {
1059
+		if ($checkin->save() === 0) {
1060
+			if (WP_DEBUG) {
1061 1061
 				global $wpdb;
1062 1062
 				$error = sprintf(
1063
-					__( 'Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso' ),
1063
+					__('Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso'),
1064 1064
 					'<br />',
1065 1065
 					$wpdb->last_error
1066 1066
 				);
1067 1067
 			} else {
1068
-				$error = __( 'Registration check in update failed because of an unknown database error', 'event_espresso' );
1068
+				$error = __('Registration check in update failed because of an unknown database error', 'event_espresso');
1069 1069
 			}
1070
-			EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ );
1070
+			EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__);
1071 1071
 			return false;
1072 1072
 		}
1073 1073
 		return $status_to;
@@ -1091,19 +1091,19 @@  discard block
 block discarded – undo
1091 1091
 	 * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id.
1092 1092
 	 * @return int            Integer representing Check-in status.
1093 1093
 	 */
1094
-	public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) {
1095
-		if ( empty( $DTT_ID ) && ! $checkin instanceof EE_Checkin ) {
1094
+	public function check_in_status_for_datetime($DTT_ID = 0, $checkin = NULL) {
1095
+		if (empty($DTT_ID) && ! $checkin instanceof EE_Checkin) {
1096 1096
 			$datetime = $this->get_related_primary_datetime();
1097
-			if ( ! $datetime instanceof EE_Datetime ) {
1097
+			if ( ! $datetime instanceof EE_Datetime) {
1098 1098
 				return 0;
1099 1099
 			}
1100 1100
 			$DTT_ID = $datetime->ID();
1101 1101
 		//verify the registration can checkin for the given DTT_ID
1102 1102
 		}
1103 1103
 		//get checkin object (if exists)
1104
-		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ), 'order_by' => array( 'CHK_timestamp' => 'DESC' ) ) );
1105
-		if ( $checkin instanceof EE_Checkin ) {
1106
-			if ( $checkin->get( 'CHK_in' ) ) {
1104
+		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related('Checkin', array(array('DTT_ID' => $DTT_ID), 'order_by' => array('CHK_timestamp' => 'DESC')));
1105
+		if ($checkin instanceof EE_Checkin) {
1106
+			if ($checkin->get('CHK_in')) {
1107 1107
 				return EE_Registration::checkin_status_in; //checked in
1108 1108
 			} else {
1109 1109
 				return EE_Registration::checkin_status_out; //had checked in but is now checked out.
@@ -1121,28 +1121,28 @@  discard block
 block discarded – undo
1121 1121
 	 * @param bool $error  This just flags that you want an error message returned. This is put in so that the error message can be customized with the attendee name.
1122 1122
 	 * @return string         internationalized message
1123 1123
 	 */
1124
-	public function get_checkin_msg( $DTT_ID, $error = FALSE ) {
1124
+	public function get_checkin_msg($DTT_ID, $error = FALSE) {
1125 1125
 		//let's get the attendee first so we can include the name of the attendee
1126
-		$attendee = $this->get_first_related( 'Attendee' );
1127
-		if ( $attendee instanceof EE_Attendee ) {
1128
-			if ( $error ) {
1129
-				return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() );
1126
+		$attendee = $this->get_first_related('Attendee');
1127
+		if ($attendee instanceof EE_Attendee) {
1128
+			if ($error) {
1129
+				return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name());
1130 1130
 			}
1131
-			$cur_status = $this->check_in_status_for_datetime( $DTT_ID );
1131
+			$cur_status = $this->check_in_status_for_datetime($DTT_ID);
1132 1132
 			//what is the status message going to be?
1133
-			switch ( $cur_status ) {
1133
+			switch ($cur_status) {
1134 1134
 				case EE_Registration::checkin_status_never :
1135
-					return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() );
1135
+					return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name());
1136 1136
 					break;
1137 1137
 				case EE_Registration::checkin_status_in :
1138
-					return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() );
1138
+					return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name());
1139 1139
 					break;
1140 1140
 				case EE_Registration::checkin_status_out :
1141
-					return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() );
1141
+					return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name());
1142 1142
 					break;
1143 1143
 			}
1144 1144
 		}
1145
-		return __( "The check-in status could not be determined.", "event_espresso" );
1145
+		return __("The check-in status could not be determined.", "event_espresso");
1146 1146
 	}
1147 1147
 
1148 1148
 
@@ -1152,7 +1152,7 @@  discard block
 block discarded – undo
1152 1152
 	 * @return EE_Transaction
1153 1153
 	 */
1154 1154
 	public function transaction() {
1155
-		return $this->get_first_related( 'Transaction' );
1155
+		return $this->get_first_related('Transaction');
1156 1156
 	}
1157 1157
 
1158 1158
 
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 	 * @access        public
1164 1164
 	 */
1165 1165
 	public function reg_code() {
1166
-		return $this->get( 'REG_code' );
1166
+		return $this->get('REG_code');
1167 1167
 	}
1168 1168
 
1169 1169
 
@@ -1173,7 +1173,7 @@  discard block
 block discarded – undo
1173 1173
 	 * @access        public
1174 1174
 	 */
1175 1175
 	public function transaction_ID() {
1176
-		return $this->get( 'TXN_ID' );
1176
+		return $this->get('TXN_ID');
1177 1177
 	}
1178 1178
 
1179 1179
 
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 	 * @return int
1183 1183
 	 */
1184 1184
 	public function ticket_ID() {
1185
-		return $this->get( 'TKT_ID' );
1185
+		return $this->get('TKT_ID');
1186 1186
 	}
1187 1187
 
1188 1188
 
@@ -1194,17 +1194,17 @@  discard block
 block discarded – undo
1194 1194
 	 * @param    string $REG_code Registration Code
1195 1195
 	 * @param	boolean $use_default
1196 1196
 	 */
1197
-	public function set_reg_code( $REG_code, $use_default = FALSE ) {
1198
-		if ( empty( $REG_code )) {
1199
-			EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1197
+	public function set_reg_code($REG_code, $use_default = FALSE) {
1198
+		if (empty($REG_code)) {
1199
+			EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1200 1200
 			return;
1201 1201
 		}
1202
-		if ( ! $this->reg_code() ) {
1203
-			parent::set( 'REG_code', $REG_code, $use_default );
1202
+		if ( ! $this->reg_code()) {
1203
+			parent::set('REG_code', $REG_code, $use_default);
1204 1204
 		} else {
1205 1205
 			EE_Error::doing_it_wrong(
1206
-				__CLASS__ . '::' . __FUNCTION__,
1207
-				__( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ),
1206
+				__CLASS__.'::'.__FUNCTION__,
1207
+				__('Can not change a registration REG_code once it has been set.', 'event_espresso'),
1208 1208
 				'4.6.0'
1209 1209
 			);
1210 1210
 		}
@@ -1224,17 +1224,17 @@  discard block
 block discarded – undo
1224 1224
 	 * @return EE_Registration[]  or empty array if this isn't a group registration.
1225 1225
 	 */
1226 1226
 	public function get_all_other_registrations_in_group() {
1227
-		if ( $this->group_size() < 2 ) {
1227
+		if ($this->group_size() < 2) {
1228 1228
 			return array();
1229 1229
 		}
1230 1230
 
1231 1231
 		$query[0] = array(
1232 1232
 			'TXN_ID' => $this->transaction_ID(),
1233
-			'REG_ID' => array( '!=', $this->ID() ),
1233
+			'REG_ID' => array('!=', $this->ID()),
1234 1234
 			'TKT_ID' => $this->ticket_ID()
1235 1235
 			);
1236 1236
 
1237
-		$registrations = $this->get_model()->get_all( $query );
1237
+		$registrations = $this->get_model()->get_all($query);
1238 1238
 		return $registrations;
1239 1239
 	}
1240 1240
 
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 	 * @access 	public
1247 1247
 	 */
1248 1248
 	public function price_paid() {
1249
-		EE_Error::doing_it_wrong( 'EE_Registration::price_paid()', __( 'This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso' ), '4.7.0' );
1249
+		EE_Error::doing_it_wrong('EE_Registration::price_paid()', __('This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso'), '4.7.0');
1250 1250
 		return $this->final_price();
1251 1251
 	}
1252 1252
 
@@ -1258,9 +1258,9 @@  discard block
 block discarded – undo
1258 1258
 	 * @access    public
1259 1259
 	 * @param    float $REG_final_price
1260 1260
 	 */
1261
-	public function set_price_paid( $REG_final_price = 0.00 ) {
1262
-		EE_Error::doing_it_wrong( 'EE_Registration::set_price_paid()', __( 'This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso' ), '4.7.0' );
1263
-		$this->set_final_price( $REG_final_price );
1261
+	public function set_price_paid($REG_final_price = 0.00) {
1262
+		EE_Error::doing_it_wrong('EE_Registration::set_price_paid()', __('This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso'), '4.7.0');
1263
+		$this->set_final_price($REG_final_price);
1264 1264
 	}
1265 1265
 
1266 1266
 
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
 	 * @return string
1272 1272
 	 */
1273 1273
 	public function pretty_price_paid() {
1274
-		EE_Error::doing_it_wrong( 'EE_Registration::pretty_price_paid()', __( 'This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso' ), '4.7.0' );
1274
+		EE_Error::doing_it_wrong('EE_Registration::pretty_price_paid()', __('This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso'), '4.7.0');
1275 1275
 		return $this->pretty_final_price();
1276 1276
 	}
1277 1277
 
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -618,9 +618,9 @@
 block discarded – undo
618 618
 
619 619
 
620 620
 	/**
621
-	*		get  Attendee Number
622
-	* 		@access		public
623
-	*/
621
+	 *		get  Attendee Number
622
+	 * 		@access		public
623
+	 */
624 624
 	public function count() {
625 625
 		return $this->get( 'REG_count' );
626 626
 	}
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 	 * the registration's share of the transaction total, so that the
683 683
 	 * sum of all the transaction's REG_final_prices equal the transaction's total
684 684
 	 * @access        public
685
-	 * @return    float
685
+	 * @return    boolean
686 686
 	 */
687 687
 	public function final_price() {
688 688
 		return $this->get( 'REG_final_price' );
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 	/**
705 705
 	 * get paid (yeah)
706 706
 	 * @access        public
707
-	 * @return 	float
707
+	 * @return 	boolean
708 708
 	 */
709 709
 	public function paid() {
710 710
 		return $this->get( 'REG_paid' );
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 	/**
869 869
 	 * Sets deleted
870 870
 	 * @param boolean $deleted
871
-	 * @return boolean
871
+	 * @return boolean|null
872 872
 	 */
873 873
 	public function set_deleted($deleted) {
874 874
 		$this->set( 'REG_deleted', $deleted );
@@ -912,6 +912,7 @@  discard block
 block discarded – undo
912 912
 	 *
913 913
 	 * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against
914 914
 	 * @param bool   $check_approved   This is used to indicate whether the caller wants can_checkin to also consider registration status as well as datetime access.
915
+	 * @param integer $DTT_OR_ID
915 916
 	 *
916 917
 	 * @return bool
917 918
 	 */
@@ -1150,7 +1151,7 @@  discard block
 block discarded – undo
1150 1151
 
1151 1152
 
1152 1153
 	/**
1153
-	 * @return int
1154
+	 * @return boolean
1154 1155
 	 */
1155 1156
 	public function ticket_ID() {
1156 1157
 		return $this->get( 'TKT_ID' );
Please login to merge, or discard this patch.
core/db_classes/EE_Soft_Delete_Base_Class.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @return boolean success
34 34
 	 */
35 35
 	public function delete() {
36
-		return $this->delete_or_restore( TRUE );
36
+		return $this->delete_or_restore(TRUE);
37 37
 	}
38 38
 
39 39
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @return boolean success
44 44
 	 */
45 45
 	public function delete_permanently() {
46
-		return $this->get_model()->delete_permanently_by_ID( $this->ID() );
46
+		return $this->get_model()->delete_permanently_by_ID($this->ID());
47 47
 	}
48 48
 
49 49
 
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 * @param bool $delete true=>delete, false=>restore
54 54
 	 * @return bool
55 55
 	 */
56
-	public function delete_or_restore( $delete = TRUE ) {
56
+	public function delete_or_restore($delete = TRUE) {
57 57
 		$model = $this->get_model();
58
-		return $model->delete_or_restore_by_ID( $delete, $this->ID() );
58
+		return $model->delete_or_restore_by_ID($delete, $this->ID());
59 59
 	}
60 60
 
61 61
 
@@ -65,6 +65,6 @@  discard block
 block discarded – undo
65 65
 	 * @return boolean
66 66
 	 */
67 67
 	public function restore() {
68
-		return $this->delete_or_restore( FALSE );
68
+		return $this->delete_or_restore(FALSE);
69 69
 	}
70 70
 }
71 71
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_classes/EE_Taxes.class.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Taxes class
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
 	 * @param  EE_Ticket $ticket incoming EE_Ticket
33 33
 	 * @return float             total taxes to apply to ticket.
34 34
 	 */
35
-	public static function get_total_taxes_for_admin( EE_Ticket $ticket ) {
35
+	public static function get_total_taxes_for_admin(EE_Ticket $ticket) {
36 36
 		$tax = 0;
37 37
 		$total_tax = 0;
38 38
 		//This first checks to see if the given ticket is taxable.
39
-		if ( ! $ticket->get( 'TKT_taxable' ) )
39
+		if ( ! $ticket->get('TKT_taxable'))
40 40
 			return $tax;
41 41
 		//get subtotal (notice we're only retrieving a subtotal if there isn't one given)
42
-		$subtotal = self::get_subtotal_for_admin( $ticket );
42
+		$subtotal = self::get_subtotal_for_admin($ticket);
43 43
 		//get taxes
44 44
 		$taxes = self::get_taxes_for_admin();
45 45
 		//apply taxes to subtotal
46
-		foreach ( $taxes as $tax ) {
46
+		foreach ($taxes as $tax) {
47 47
 			//assuming taxes are not cumulative
48
-			$total_tax += $subtotal * $tax->get( 'PRC_amount' ) / 100;
48
+			$total_tax += $subtotal * $tax->get('PRC_amount') / 100;
49 49
 		}
50 50
 		return $total_tax;
51 51
 	}
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public static function get_total_taxes_percentage() {
59 59
 		$total_tax_percent = 0;
60
-		foreach( self::get_taxes_for_admin() as $tax_price ) {
61
-			$total_tax_percent += $tax_price->get( 'PRC_amount' );
60
+		foreach (self::get_taxes_for_admin() as $tax_price) {
61
+			$total_tax_percent += $tax_price->get('PRC_amount');
62 62
 		}
63 63
 		return $total_tax_percent;
64 64
 	}
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 * @param EE_Ticket $ticket
70 70
 	 * @return float
71 71
 	 */
72
-	public static function get_subtotal_for_admin( EE_Ticket $ticket ) {
72
+	public static function get_subtotal_for_admin(EE_Ticket $ticket) {
73 73
 		$TKT_ID = $ticket->ID();
74
-		return isset( self::$_subtotal[ $TKT_ID ] ) ? self::$_subtotal[ $TKT_ID ] : self::_get_subtotal_for_admin( $ticket );
74
+		return isset(self::$_subtotal[$TKT_ID]) ? self::$_subtotal[$TKT_ID] : self::_get_subtotal_for_admin($ticket);
75 75
 	}
76 76
 
77 77
 
@@ -81,26 +81,26 @@  discard block
 block discarded – undo
81 81
 	 * @param  EE_Ticket $ticket
82 82
 	 * @return float     subtotal calculated from all EE_Price[] on Ticket.
83 83
 	 */
84
-	private static function _get_subtotal_for_admin( EE_Ticket $ticket ) {
84
+	private static function _get_subtotal_for_admin(EE_Ticket $ticket) {
85 85
 		$subtotal = 0;
86 86
 		//get all prices
87
-		$prices = $ticket->get_many_related( 'Price', array( 'default_where_conditions' => 'none', 'order_by' => array( 'PRC_order' => 'ASC' ) ) );
87
+		$prices = $ticket->get_many_related('Price', array('default_where_conditions' => 'none', 'order_by' => array('PRC_order' => 'ASC')));
88 88
 		//let's loop through them (base price is always the first item)
89
-		foreach ( $prices as $price ) {
90
-			if ( $price instanceof EE_Price ) {
91
-				switch ( $price->type_obj()->base_type() ) {
89
+		foreach ($prices as $price) {
90
+			if ($price instanceof EE_Price) {
91
+				switch ($price->type_obj()->base_type()) {
92 92
 					case 1: // base price
93 93
 					case 3: // surcharges
94
-						$subtotal += $price->is_percent() ? $subtotal * $price->get( 'PRC_amount' ) / 100 : $price->get( 'PRC_amount' );
94
+						$subtotal += $price->is_percent() ? $subtotal * $price->get('PRC_amount') / 100 : $price->get('PRC_amount');
95 95
 						break;
96 96
 					case 2: // discounts
97
-						$subtotal -= $price->is_percent() ? $subtotal * $price->get( 'PRC_amount' ) / 100 : $price->get( 'PRC_amount' );
97
+						$subtotal -= $price->is_percent() ? $subtotal * $price->get('PRC_amount') / 100 : $price->get('PRC_amount');
98 98
 						break;
99 99
 				}
100 100
 			}
101 101
 		}
102 102
 		$TKT_ID = $ticket->ID();
103
-		self::$_subtotal = array( $TKT_ID => $subtotal );
103
+		self::$_subtotal = array($TKT_ID => $subtotal);
104 104
 		return $subtotal;
105 105
 	}
106 106
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 * @return EE_Price[] EE_Price objects that have PRT_ID == 4
112 112
 	 */
113 113
 	public static function get_taxes_for_admin() {
114
-		self::$_default_taxes = ! empty( self::$_default_taxes ) ? self::$_default_taxes : EE_Registry::instance()->load_model( 'Price' )->get_all( array( array( 'Price_Type.PBT_ID' => 4 ) ) );
114
+		self::$_default_taxes = ! empty(self::$_default_taxes) ? self::$_default_taxes : EE_Registry::instance()->load_model('Price')->get_all(array(array('Price_Type.PBT_ID' => 4)));
115 115
 		return self::$_default_taxes;
116 116
 	}
117 117
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@
 block discarded – undo
36 36
 		$tax = 0;
37 37
 		$total_tax = 0;
38 38
 		//This first checks to see if the given ticket is taxable.
39
-		if ( ! $ticket->get( 'TKT_taxable' ) )
40
-			return $tax;
39
+		if ( ! $ticket->get( 'TKT_taxable' ) ) {
40
+					return $tax;
41
+		}
41 42
 		//get subtotal (notice we're only retrieving a subtotal if there isn't one given)
42 43
 		$subtotal = self::get_subtotal_for_admin( $ticket );
43 44
 		//get taxes
Please login to merge, or discard this patch.