@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | /** |
| 19 | 19 | */ |
| 20 | -class EE_DMS_Unknown_1_0_0 extends EE_Data_Migration_Script_Base{ |
|
| 20 | +class EE_DMS_Unknown_1_0_0 extends EE_Data_Migration_Script_Base { |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Returns whether or not this data migration script can operate on the given version of the database. |
@@ -21,12 +21,12 @@ |
||
| 21 | 21 | protected $_old_table; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * Set in the constructor to add this sql to both the counting query in |
|
| 25 | - * EE_Data_Migration_Script_Stage_Table::_count_records_to_migrate() and |
|
| 26 | - * EE_Data_Migration_Script_Stage_Table::_get_rows(). |
|
| 27 | - * Eg "where column_name like '%some_value%'" |
|
| 28 | - * @var string |
|
| 29 | - */ |
|
| 24 | + * Set in the constructor to add this sql to both the counting query in |
|
| 25 | + * EE_Data_Migration_Script_Stage_Table::_count_records_to_migrate() and |
|
| 26 | + * EE_Data_Migration_Script_Stage_Table::_get_rows(). |
|
| 27 | + * Eg "where column_name like '%some_value%'" |
|
| 28 | + * @var string |
|
| 29 | + */ |
|
| 30 | 30 | protected $_extra_where_sql; |
| 31 | 31 | |
| 32 | 32 | |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | * @param int $num_items |
| 42 | 42 | * @return int number of items ACTUALLY migrated |
| 43 | 43 | */ |
| 44 | - function _migration_step($num_items=50){ |
|
| 45 | - $rows = $this->_get_rows( $num_items ); |
|
| 44 | + function _migration_step($num_items = 50) { |
|
| 45 | + $rows = $this->_get_rows($num_items); |
|
| 46 | 46 | $items_actually_migrated = 0; |
| 47 | - foreach($rows as $old_row){ |
|
| 47 | + foreach ($rows as $old_row) { |
|
| 48 | 48 | $this->_migrate_old_row($old_row); |
| 49 | 49 | $items_actually_migrated++; |
| 50 | 50 | } |
| 51 | - if($this->count_records_migrated() + $items_actually_migrated >= $this->count_records_to_migrate()){ |
|
| 51 | + if ($this->count_records_migrated() + $items_actually_migrated >= $this->count_records_to_migrate()) { |
|
| 52 | 52 | $this->set_completed(); |
| 53 | 53 | } |
| 54 | 54 | return $items_actually_migrated; |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | * @param int $limit |
| 61 | 61 | * @return array of arrays like $wpdb->get_results($sql, ARRAY_A) |
| 62 | 62 | */ |
| 63 | - protected function _get_rows( $limit ){ |
|
| 63 | + protected function _get_rows($limit) { |
|
| 64 | 64 | global $wpdb; |
| 65 | 65 | $start_at_record = $this->count_records_migrated(); |
| 66 | - $query = "SELECT * FROM {$this->_old_table} {$this->_extra_where_sql} " . $wpdb->prepare("LIMIT %d, %d",$start_at_record,$limit); |
|
| 67 | - return $wpdb->get_results($query,ARRAY_A); |
|
| 66 | + $query = "SELECT * FROM {$this->_old_table} {$this->_extra_where_sql} ".$wpdb->prepare("LIMIT %d, %d", $start_at_record, $limit); |
|
| 67 | + return $wpdb->get_results($query, ARRAY_A); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | function _count_records_to_migrate() { |
| 77 | 77 | global $wpdb; |
| 78 | - $query = "SELECT COUNT(*) FROM {$this->_old_table} {$this->_extra_where_sql}"; |
|
| 79 | - $count = $wpdb->get_var( $query ); |
|
| 78 | + $query = "SELECT COUNT(*) FROM {$this->_old_table} {$this->_extra_where_sql}"; |
|
| 79 | + $count = $wpdb->get_var($query); |
|
| 80 | 80 | return $count; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 2 | - exit( 'No direct script access allowed' ); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | 3 | } |
| 4 | 4 | /** |
| 5 | 5 | * Event Espresso |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * @param array $props_n_values |
| 32 | 32 | * @return EE_Answer |
| 33 | 33 | */ |
| 34 | - public static function new_instance( $props_n_values = array() ) { |
|
| 35 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
| 36 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
| 34 | + public static function new_instance($props_n_values = array()) { |
|
| 35 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 36 | + return $has_object ? $has_object : new self($props_n_values); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | * @param array $props_n_values |
| 44 | 44 | * @return EE_Answer |
| 45 | 45 | */ |
| 46 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
| 47 | - return new self( $props_n_values, TRUE ); |
|
| 46 | + public static function new_instance_from_db($props_n_values = array()) { |
|
| 47 | + return new self($props_n_values, TRUE); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | * @access public |
| 56 | 56 | * @param int $QST_ID |
| 57 | 57 | */ |
| 58 | - public function set_question( $QST_ID = 0 ) { |
|
| 59 | - $this->set( 'QST_ID', $QST_ID ); |
|
| 58 | + public function set_question($QST_ID = 0) { |
|
| 59 | + $this->set('QST_ID', $QST_ID); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | * @access public |
| 68 | 68 | * @param int $REG_ID |
| 69 | 69 | */ |
| 70 | - public function set_registration( $REG_ID = 0 ) { |
|
| 71 | - $this->set( 'REG_ID', $REG_ID ); |
|
| 70 | + public function set_registration($REG_ID = 0) { |
|
| 71 | + $this->set('REG_ID', $REG_ID); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | * @access public |
| 80 | 80 | * @param mixed $ANS_value |
| 81 | 81 | */ |
| 82 | - public function set_value( $ANS_value = '' ) { |
|
| 83 | - $this->set( 'ANS_value', $ANS_value ); |
|
| 82 | + public function set_value($ANS_value = '') { |
|
| 83 | + $this->set('ANS_value', $ANS_value); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @return int |
| 93 | 93 | */ |
| 94 | 94 | public function registration_ID() { |
| 95 | - return $this->get( 'REG_ID' ); |
|
| 95 | + return $this->get('REG_ID'); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @return int |
| 105 | 105 | */ |
| 106 | 106 | public function question_ID() { |
| 107 | - return $this->get( 'QST_ID' ); |
|
| 107 | + return $this->get('QST_ID'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @return string |
| 117 | 117 | */ |
| 118 | 118 | public function value() { |
| 119 | - return $this->get( 'ANS_value' ); |
|
| 119 | + return $this->get('ANS_value'); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | * @param null $schema |
| 127 | 127 | * @return string |
| 128 | 128 | */ |
| 129 | - public function pretty_value( $schema = NULL ) { |
|
| 130 | - return $this->get_pretty( 'ANS_value', $schema ); |
|
| 129 | + public function pretty_value($schema = NULL) { |
|
| 130 | + return $this->get_pretty('ANS_value', $schema); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | * Echoes out a pretty value (even for multi-choice options) |
| 137 | 137 | * @param string $schema |
| 138 | 138 | */ |
| 139 | - public function e_value( $schema = NULL ) { |
|
| 140 | - $this->e( 'ANS_value', $schema ); |
|
| 139 | + public function e_value($schema = NULL) { |
|
| 140 | + $this->e('ANS_value', $schema); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * @return EE_Question |
| 148 | 148 | */ |
| 149 | 149 | public function question() { |
| 150 | - return $this->get_first_related( 'Question' ); |
|
| 150 | + return $this->get_first_related('Question'); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @return EE_Registration |
| 158 | 158 | */ |
| 159 | 159 | public function registration() { |
| 160 | - return $this->get_first_related( 'Registration' ); |
|
| 160 | + return $this->get_first_related('Registration'); |
|
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | * Set Answer value |
| 78 | 78 | * |
| 79 | 79 | * @access public |
| 80 | - * @param mixed $ANS_value |
|
| 80 | + * @param string $ANS_value |
|
| 81 | 81 | */ |
| 82 | 82 | public function set_value( $ANS_value = '' ) { |
| 83 | 83 | $this->set( 'ANS_value', $ANS_value ); |
@@ -1,7 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | |
| 6 | 7 | /** |
| 7 | 8 | * Event Espresso |
@@ -152,7 +153,7 @@ discard block |
||
| 152 | 153 | $is_model_name = EE_Registry::instance()->is_model_name($model_name_of_related_obj); |
| 153 | 154 | if( ! $is_model_name ){ |
| 154 | 155 | return null; |
| 155 | - }else{ |
|
| 156 | + } else{ |
|
| 156 | 157 | return $this->get_first_related($model_name_of_related_obj); |
| 157 | 158 | } |
| 158 | 159 | } |
@@ -169,13 +170,13 @@ discard block |
||
| 169 | 170 | if($object instanceof EE_Base_Class){ |
| 170 | 171 | $this->set_OBJ_type($object->get_model()->get_this_model_name()); |
| 171 | 172 | $this->set_OBJ_ID($object->ID()); |
| 172 | - }else{ |
|
| 173 | + } else{ |
|
| 173 | 174 | $this->set_OBJ_type(NULL); |
| 174 | 175 | $this->set_OBJ_ID(NULL); |
| 175 | 176 | } |
| 176 | 177 | if($save){ |
| 177 | 178 | return $this->save(); |
| 178 | - }else{ |
|
| 179 | + } else{ |
|
| 179 | 180 | return NULL; |
| 180 | 181 | } |
| 181 | 182 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * ------------------------------------------------------------------------ |
| 27 | 27 | */ |
| 28 | -class EE_Change_Log extends EE_Base_Class{ |
|
| 28 | +class EE_Change_Log extends EE_Base_Class { |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * date_format and the second value is the time format |
| 37 | 37 | * @return EE_Attendee |
| 38 | 38 | */ |
| 39 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
| 40 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
| 41 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
| 39 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
| 40 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
| 41 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | * the website will be used. |
| 50 | 50 | * @return EE_Attendee |
| 51 | 51 | */ |
| 52 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
| 53 | - return new self( $props_n_values, TRUE, $timezone ); |
|
| 52 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
| 53 | + return new self($props_n_values, TRUE, $timezone); |
|
| 54 | 54 | } |
| 55 | 55 | /** |
| 56 | 56 | * Gets message |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | * Gets the model object attached to this log |
| 148 | 148 | * @return EE_Base_Class |
| 149 | 149 | */ |
| 150 | - function object(){ |
|
| 150 | + function object() { |
|
| 151 | 151 | $model_name_of_related_obj = $this->OBJ_type(); |
| 152 | 152 | $is_model_name = EE_Registry::instance()->is_model_name($model_name_of_related_obj); |
| 153 | - if( ! $is_model_name ){ |
|
| 153 | + if ( ! $is_model_name) { |
|
| 154 | 154 | return null; |
| 155 | - }else{ |
|
| 155 | + } else { |
|
| 156 | 156 | return $this->get_first_related($model_name_of_related_obj); |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -165,17 +165,17 @@ discard block |
||
| 165 | 165 | * @param boolean $save |
| 166 | 166 | * @return boolean if $save=true, NULL is $save=false |
| 167 | 167 | */ |
| 168 | - function set_object($object, $save = TRUE ) { |
|
| 169 | - if($object instanceof EE_Base_Class){ |
|
| 168 | + function set_object($object, $save = TRUE) { |
|
| 169 | + if ($object instanceof EE_Base_Class) { |
|
| 170 | 170 | $this->set_OBJ_type($object->get_model()->get_this_model_name()); |
| 171 | 171 | $this->set_OBJ_ID($object->ID()); |
| 172 | - }else{ |
|
| 172 | + } else { |
|
| 173 | 173 | $this->set_OBJ_type(NULL); |
| 174 | 174 | $this->set_OBJ_ID(NULL); |
| 175 | 175 | } |
| 176 | - if($save){ |
|
| 176 | + if ($save) { |
|
| 177 | 177 | return $this->save(); |
| 178 | - }else{ |
|
| 178 | + } else { |
|
| 179 | 179 | return NULL; |
| 180 | 180 | } |
| 181 | 181 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | * @param array $props_n_values incoming values from the database |
| 48 | 48 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
| 49 | 49 | * the website will be used. |
| 50 | - * @return EE_Attendee |
|
| 50 | + * @return EE_Change_Log |
|
| 51 | 51 | */ |
| 52 | 52 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
| 53 | 53 | return new self( $props_n_values, TRUE, $timezone ); |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 1 | +<?php if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
| 3 | 5 | /** |
| 4 | 6 | * Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 23 | 23 | * @subpackage includes/classes/EE_Checkin.class.php |
| 24 | 24 | * @author Darren Ethier |
| 25 | 25 | */ |
| 26 | -class EE_Checkin extends EE_Base_Class{ |
|
| 26 | +class EE_Checkin extends EE_Base_Class { |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | * date_format and the second value is the time format |
| 35 | 35 | * @return EE_Checkin |
| 36 | 36 | */ |
| 37 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
| 38 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
| 39 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
| 37 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
| 38 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
| 39 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | * the website will be used. |
| 48 | 48 | * @return EE_Checkin |
| 49 | 49 | */ |
| 50 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
| 51 | - return new self( $props_n_values, TRUE, $timezone ); |
|
| 50 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
| 51 | + return new self($props_n_values, TRUE, $timezone); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -708,12 +708,10 @@ |
||
| 708 | 708 | if ( date( 'm', $this->get_raw( 'DTT_EVT_start' ) ) != date( 'm', $this->get_raw( 'DTT_EVT_end' ) ) ) { |
| 709 | 709 | $display_date = $this->start_date( 'M j\, Y g:i a' ) . ' - ' . $this->end_date( 'M j\, Y g:i a' ); |
| 710 | 710 | //next condition is if its the same month but different day |
| 711 | - } |
|
| 712 | - else { |
|
| 711 | + } else { |
|
| 713 | 712 | if ( date( 'm', $this->get_raw( 'DTT_EVT_start' ) ) == date( 'm', $this->get_raw( 'DTT_EVT_end' ) ) && date( 'd', $this->get_raw( 'DTT_EVT_start' ) ) != date( 'd', $this->get_raw( 'DTT_EVT_end' ) ) ) { |
| 714 | 713 | $display_date = $this->start_date( 'M j\, g:i a' ) . ' - ' . $this->end_date( 'M j\, g:i a Y' ); |
| 715 | - } |
|
| 716 | - else { |
|
| 714 | + } else { |
|
| 717 | 715 | $display_date = $this->start_date( 'F j\, Y' ) . ' @ ' . $this->start_date( 'g:i a' ) . ' - ' . $this->end_date( 'g:i a' ); |
| 718 | 716 | } |
| 719 | 717 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 2 | - exit( 'No direct script access allowed' ); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | 3 | } |
| 4 | 4 | /** |
| 5 | 5 | * Event Espresso |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | * date_format and the second value is the time format |
| 75 | 75 | * @return EE_Datetime |
| 76 | 76 | */ |
| 77 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
| 78 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
| 79 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
| 77 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
| 78 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
| 79 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | * the website will be used. |
| 88 | 88 | * @return EE_Datetime |
| 89 | 89 | */ |
| 90 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
| 91 | - return new self( $props_n_values, TRUE, $timezone ); |
|
| 90 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
| 91 | + return new self($props_n_values, TRUE, $timezone); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | /** |
| 97 | 97 | * @param $name |
| 98 | 98 | */ |
| 99 | - public function set_name( $name ) { |
|
| 100 | - $this->set( 'DTT_name', $name ); |
|
| 99 | + public function set_name($name) { |
|
| 100 | + $this->set('DTT_name', $name); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | /** |
| 106 | 106 | * @param $description |
| 107 | 107 | */ |
| 108 | - public function set_description( $description ) { |
|
| 109 | - $this->set( 'DTT_description', $description ); |
|
| 108 | + public function set_description($description) { |
|
| 109 | + $this->set('DTT_description', $description); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | * @access public |
| 120 | 120 | * @param string $date a string representation of the event's date ex: Dec. 25, 2025 or 12-25-2025 |
| 121 | 121 | */ |
| 122 | - public function set_start_date( $date ) { |
|
| 123 | - $this->_set_date_for( $date, 'DTT_EVT_start' ); |
|
| 122 | + public function set_start_date($date) { |
|
| 123 | + $this->_set_date_for($date, 'DTT_EVT_start'); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | * @access public |
| 134 | 134 | * @param string $time a string representation of the event time ex: 9am or 7:30 PM |
| 135 | 135 | */ |
| 136 | - public function set_start_time( $time ) { |
|
| 137 | - $this->_set_time_for( $time, 'DTT_EVT_start' ); |
|
| 136 | + public function set_start_time($time) { |
|
| 137 | + $this->_set_time_for($time, 'DTT_EVT_start'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | * @access public |
| 148 | 148 | * @param string $date a string representation of the event's date ex: Dec. 25, 2025 or 12-25-2025 |
| 149 | 149 | */ |
| 150 | - public function set_end_date( $date ) { |
|
| 151 | - $this->_set_date_for( $date, 'DTT_EVT_end' ); |
|
| 150 | + public function set_end_date($date) { |
|
| 151 | + $this->_set_date_for($date, 'DTT_EVT_end'); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | * @access public |
| 162 | 162 | * @param string $time a string representation of the event time ex: 9am or 7:30 PM |
| 163 | 163 | */ |
| 164 | - public function set_end_time( $time ) { |
|
| 165 | - $this->_set_time_for( $time, 'DTT_EVT_end' ); |
|
| 164 | + public function set_end_time($time) { |
|
| 165 | + $this->_set_time_for($time, 'DTT_EVT_end'); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
@@ -175,8 +175,8 @@ discard block |
||
| 175 | 175 | * @access public |
| 176 | 176 | * @param int $reg_limit |
| 177 | 177 | */ |
| 178 | - public function set_reg_limit( $reg_limit ) { |
|
| 179 | - $this->set( 'DTT_reg_limit', $reg_limit ); |
|
| 178 | + public function set_reg_limit($reg_limit) { |
|
| 179 | + $this->set('DTT_reg_limit', $reg_limit); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | * @access public |
| 188 | 188 | * @param int $sold |
| 189 | 189 | */ |
| 190 | - public function set_sold( $sold ) { |
|
| 190 | + public function set_sold($sold) { |
|
| 191 | 191 | // sold can not go below zero |
| 192 | - $sold = max( 0, $sold ); |
|
| 193 | - $this->set( 'DTT_sold', $sold ); |
|
| 192 | + $sold = max(0, $sold); |
|
| 193 | + $this->set('DTT_sold', $sold); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
@@ -199,9 +199,9 @@ discard block |
||
| 199 | 199 | * increments sold by amount passed by $qty |
| 200 | 200 | * @param int $qty |
| 201 | 201 | */ |
| 202 | - function increase_sold( $qty = 1 ) { |
|
| 202 | + function increase_sold($qty = 1) { |
|
| 203 | 203 | $sold = $this->sold() + $qty; |
| 204 | - $this->set_sold( $sold ); |
|
| 204 | + $this->set_sold($sold); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | |
@@ -210,9 +210,9 @@ discard block |
||
| 210 | 210 | * decrements (subtracts) sold amount passed by $qty |
| 211 | 211 | * @param int $qty |
| 212 | 212 | */ |
| 213 | - function decrease_sold( $qty = 1 ) { |
|
| 213 | + function decrease_sold($qty = 1) { |
|
| 214 | 214 | $sold = $this->sold() - $qty; |
| 215 | - $this->set_sold( $sold ); |
|
| 215 | + $this->set_sold($sold); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * @return string |
| 223 | 223 | */ |
| 224 | 224 | public function name() { |
| 225 | - return $this->get( 'DTT_name' ); |
|
| 225 | + return $this->get('DTT_name'); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * @return string |
| 233 | 233 | */ |
| 234 | 234 | public function description() { |
| 235 | - return $this->get( 'DTT_description' ); |
|
| 235 | + return $this->get('DTT_description'); |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | * @return boolean TRUE if is primary, FALSE if not. |
| 243 | 243 | */ |
| 244 | 244 | public function is_primary() { |
| 245 | - return $this->get( 'DTT_is_primary' ); |
|
| 245 | + return $this->get('DTT_is_primary'); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | * @return int The order of the datetime for this event. |
| 253 | 253 | */ |
| 254 | 254 | public function order() { |
| 255 | - return $this->get( 'DTT_order' ); |
|
| 255 | + return $this->get('DTT_order'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @return int |
| 263 | 263 | */ |
| 264 | 264 | public function parent() { |
| 265 | - return $this->get( 'DTT_parent' ); |
|
| 265 | + return $this->get('DTT_parent'); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
@@ -278,10 +278,10 @@ discard block |
||
| 278 | 278 | * @param bool $echo - whether we echo or return (note echoing uses "pretty" formats, otherwise we use the standard formats) |
| 279 | 279 | * @return string|bool|void string on success, FALSE on fail |
| 280 | 280 | */ |
| 281 | - private function _show_datetime( $date_or_time = NULL, $start_or_end = 'start', $dt_frmt = '', $tm_frmt = '', $echo = FALSE ) { |
|
| 281 | + private function _show_datetime($date_or_time = NULL, $start_or_end = 'start', $dt_frmt = '', $tm_frmt = '', $echo = FALSE) { |
|
| 282 | 282 | $field_name = "DTT_EVT_{$start_or_end}"; |
| 283 | - $dtt = $this->_get_datetime( $field_name, $dt_frmt, $tm_frmt, $date_or_time, $echo ); |
|
| 284 | - if ( ! $echo ) { |
|
| 283 | + $dtt = $this->_get_datetime($field_name, $dt_frmt, $tm_frmt, $date_or_time, $echo); |
|
| 284 | + if ( ! $echo) { |
|
| 285 | 285 | return $dtt; |
| 286 | 286 | } |
| 287 | 287 | return ''; |
@@ -297,8 +297,8 @@ discard block |
||
| 297 | 297 | * @param null $dt_frmt - string representation of date format defaults to 'F j, Y' |
| 298 | 298 | * @return mixed string on success, FALSE on fail |
| 299 | 299 | */ |
| 300 | - public function start_date( $dt_frmt = NULL ) { |
|
| 301 | - return $this->_show_datetime( 'D', 'start', $dt_frmt ); |
|
| 300 | + public function start_date($dt_frmt = NULL) { |
|
| 301 | + return $this->_show_datetime('D', 'start', $dt_frmt); |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
@@ -307,8 +307,8 @@ discard block |
||
| 307 | 307 | * Echoes start_date() |
| 308 | 308 | * @param string $dt_frmt |
| 309 | 309 | */ |
| 310 | - public function e_start_date( $dt_frmt = NULL ) { |
|
| 311 | - $this->_show_datetime( 'D', 'start', $dt_frmt, NULL, TRUE ); |
|
| 310 | + public function e_start_date($dt_frmt = NULL) { |
|
| 311 | + $this->_show_datetime('D', 'start', $dt_frmt, NULL, TRUE); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | |
@@ -321,8 +321,8 @@ discard block |
||
| 321 | 321 | * @param null $dt_frmt - string representation of date format defaults to 'F j, Y' |
| 322 | 322 | * @return mixed string on success, FALSE on fail |
| 323 | 323 | */ |
| 324 | - public function end_date( $dt_frmt = NULL ) { |
|
| 325 | - return $this->_show_datetime( 'D', 'end', $dt_frmt ); |
|
| 324 | + public function end_date($dt_frmt = NULL) { |
|
| 325 | + return $this->_show_datetime('D', 'end', $dt_frmt); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | |
@@ -331,8 +331,8 @@ discard block |
||
| 331 | 331 | * Echoes the end date. See end_date() |
| 332 | 332 | * @param string $dt_frmt |
| 333 | 333 | */ |
| 334 | - public function e_end_date( $dt_frmt = NULL ) { |
|
| 335 | - $this->_show_datetime( 'D', 'end', $dt_frmt, NULL, TRUE ); |
|
| 334 | + public function e_end_date($dt_frmt = NULL) { |
|
| 335 | + $this->_show_datetime('D', 'end', $dt_frmt, NULL, TRUE); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | |
@@ -345,11 +345,11 @@ discard block |
||
| 345 | 345 | * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31 |
| 346 | 346 | * @return mixed string on success, FALSE on fail |
| 347 | 347 | */ |
| 348 | - public function date_range( $dt_frmt = NULL, $conjunction = ' - ' ) { |
|
| 349 | - $dt_frmt = ! empty( $dt_frmt ) ? $dt_frmt : $this->_dt_frmt; |
|
| 350 | - $start = str_replace( ' ', ' ', $this->get_i18n_datetime( 'DTT_EVT_start', $dt_frmt ) ); |
|
| 351 | - $end = str_replace( ' ', ' ', $this->get_i18n_datetime( 'DTT_EVT_end', $dt_frmt ) ); |
|
| 352 | - return $start != $end ? $start . $conjunction . $end : $start; |
|
| 348 | + public function date_range($dt_frmt = NULL, $conjunction = ' - ') { |
|
| 349 | + $dt_frmt = ! empty($dt_frmt) ? $dt_frmt : $this->_dt_frmt; |
|
| 350 | + $start = str_replace(' ', ' ', $this->get_i18n_datetime('DTT_EVT_start', $dt_frmt)); |
|
| 351 | + $end = str_replace(' ', ' ', $this->get_i18n_datetime('DTT_EVT_end', $dt_frmt)); |
|
| 352 | + return $start != $end ? $start.$conjunction.$end : $start; |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
@@ -358,8 +358,8 @@ discard block |
||
| 358 | 358 | * @param null $dt_frmt |
| 359 | 359 | * @param string $conjunction |
| 360 | 360 | */ |
| 361 | - public function e_date_range( $dt_frmt = NULL, $conjunction = ' - ' ) { |
|
| 362 | - echo $this->date_range( $dt_frmt, $conjunction ); |
|
| 361 | + public function e_date_range($dt_frmt = NULL, $conjunction = ' - ') { |
|
| 362 | + echo $this->date_range($dt_frmt, $conjunction); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | |
@@ -371,8 +371,8 @@ discard block |
||
| 371 | 371 | * @param string $tm_format - string representation of time format defaults to 'g:i a' |
| 372 | 372 | * @return mixed string on success, FALSE on fail |
| 373 | 373 | */ |
| 374 | - public function start_time( $tm_format = NULL ) { |
|
| 375 | - return $this->_show_datetime( 'T', 'start', NULL, $tm_format ); |
|
| 374 | + public function start_time($tm_format = NULL) { |
|
| 375 | + return $this->_show_datetime('T', 'start', NULL, $tm_format); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
@@ -380,8 +380,8 @@ discard block |
||
| 380 | 380 | /** |
| 381 | 381 | * @param null $tm_format |
| 382 | 382 | */ |
| 383 | - public function e_start_time( $tm_format = NULL ) { |
|
| 384 | - $this->_show_datetime( 'T', 'start', NULL, $tm_format, TRUE ); |
|
| 383 | + public function e_start_time($tm_format = NULL) { |
|
| 384 | + $this->_show_datetime('T', 'start', NULL, $tm_format, TRUE); |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
@@ -393,8 +393,8 @@ discard block |
||
| 393 | 393 | * @param string $tm_format - string representation of time format defaults to 'g:i a' |
| 394 | 394 | * @return mixed string on success, FALSE on fail |
| 395 | 395 | */ |
| 396 | - public function end_time( $tm_format = NULL ) { |
|
| 397 | - return $this->_show_datetime( 'T', 'end', NULL, $tm_format ); |
|
| 396 | + public function end_time($tm_format = NULL) { |
|
| 397 | + return $this->_show_datetime('T', 'end', NULL, $tm_format); |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | /** |
| 403 | 403 | * @param null $tm_format |
| 404 | 404 | */ |
| 405 | - public function e_end_time( $tm_format = NULL ) { |
|
| 406 | - $this->_show_datetime( 'T', 'end', NULL, $tm_format, TRUE ); |
|
| 405 | + public function e_end_time($tm_format = NULL) { |
|
| 406 | + $this->_show_datetime('T', 'end', NULL, $tm_format, TRUE); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | |
@@ -416,12 +416,12 @@ discard block |
||
| 416 | 416 | * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31 |
| 417 | 417 | * @return mixed string on success, FALSE on fail |
| 418 | 418 | */ |
| 419 | - public function time_range( $tm_format = NULL, $conjunction = ' - ' ) { |
|
| 420 | - $tm_format = !empty( $tm_format ) ? $tm_format : $this->_tm_frmt; |
|
| 419 | + public function time_range($tm_format = NULL, $conjunction = ' - ') { |
|
| 420 | + $tm_format = ! empty($tm_format) ? $tm_format : $this->_tm_frmt; |
|
| 421 | 421 | |
| 422 | - $start = str_replace( ' ', ' ', $this->get_i18n_datetime( 'DTT_EVT_start', $tm_format ) ); |
|
| 423 | - $end = str_replace( ' ', ' ', $this->get_i18n_datetime( 'DTT_EVT_end', $tm_format ) ); |
|
| 424 | - return $start != $end ? $start . $conjunction . $end : $start; |
|
| 422 | + $start = str_replace(' ', ' ', $this->get_i18n_datetime('DTT_EVT_start', $tm_format)); |
|
| 423 | + $end = str_replace(' ', ' ', $this->get_i18n_datetime('DTT_EVT_end', $tm_format)); |
|
| 424 | + return $start != $end ? $start.$conjunction.$end : $start; |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | |
@@ -430,8 +430,8 @@ discard block |
||
| 430 | 430 | * @param null $tm_format |
| 431 | 431 | * @param string $conjunction |
| 432 | 432 | */ |
| 433 | - public function e_time_range( $tm_format = NULL, $conjunction = ' - ' ) { |
|
| 434 | - echo $this->time_range( $tm_format, $conjunction ); |
|
| 433 | + public function e_time_range($tm_format = NULL, $conjunction = ' - ') { |
|
| 434 | + echo $this->time_range($tm_format, $conjunction); |
|
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | |
@@ -444,8 +444,8 @@ discard block |
||
| 444 | 444 | * @param string $tm_format - string representation of time format defaults to 'g:i a' |
| 445 | 445 | * @return mixed string on success, FALSE on fail |
| 446 | 446 | */ |
| 447 | - public function start_date_and_time( $dt_format = NULL, $tm_format = NULL ) { |
|
| 448 | - return $this->_show_datetime( '', 'start', $dt_format, $tm_format ); |
|
| 447 | + public function start_date_and_time($dt_format = NULL, $tm_format = NULL) { |
|
| 448 | + return $this->_show_datetime('', 'start', $dt_format, $tm_format); |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | * @param null $dt_frmt |
| 455 | 455 | * @param null $tm_format |
| 456 | 456 | */ |
| 457 | - public function e_start_date_and_time( $dt_frmt = NULL, $tm_format = NULL ) { |
|
| 458 | - $this->_show_datetime( '', 'start', $dt_frmt, $tm_format, TRUE ); |
|
| 457 | + public function e_start_date_and_time($dt_frmt = NULL, $tm_format = NULL) { |
|
| 458 | + $this->_show_datetime('', 'start', $dt_frmt, $tm_format, TRUE); |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | |
@@ -469,11 +469,11 @@ discard block |
||
| 469 | 469 | * @param bool $round_up |
| 470 | 470 | * @return float|int|mixed |
| 471 | 471 | */ |
| 472 | - public function length( $units = 'seconds', $round_up = FALSE ) { |
|
| 473 | - $start = $this->get_raw( 'DTT_EVT_start' ); |
|
| 474 | - $end = $this->get_raw( 'DTT_EVT_end' ); |
|
| 472 | + public function length($units = 'seconds', $round_up = FALSE) { |
|
| 473 | + $start = $this->get_raw('DTT_EVT_start'); |
|
| 474 | + $end = $this->get_raw('DTT_EVT_end'); |
|
| 475 | 475 | $length_in_units = $end - $start; |
| 476 | - switch ( $units ) { |
|
| 476 | + switch ($units) { |
|
| 477 | 477 | //NOTE: We purposefully don't use "break;" in order to chain the divisions |
| 478 | 478 | /** @noinspection PhpMissingBreakStatementInspection */ |
| 479 | 479 | case 'days': |
@@ -486,10 +486,10 @@ discard block |
||
| 486 | 486 | $length_in_units /= 60; |
| 487 | 487 | case 'seconds': |
| 488 | 488 | default: |
| 489 | - $length_in_units = ceil( $length_in_units ); |
|
| 489 | + $length_in_units = ceil($length_in_units); |
|
| 490 | 490 | } |
| 491 | - if ( $round_up ) { |
|
| 492 | - $length_in_units = max( $length_in_units, 1 ); |
|
| 491 | + if ($round_up) { |
|
| 492 | + $length_in_units = max($length_in_units, 1); |
|
| 493 | 493 | } |
| 494 | 494 | return $length_in_units; |
| 495 | 495 | } |
@@ -504,8 +504,8 @@ discard block |
||
| 504 | 504 | * @param bool | string $tm_format - string representation of time format defaults to 'g:i a' |
| 505 | 505 | * @return mixed string on success, FALSE on fail |
| 506 | 506 | */ |
| 507 | - public function end_date_and_time( $dt_frmt = FALSE, $tm_format = FALSE ) { |
|
| 508 | - return $this->_show_datetime( '', 'end', $dt_frmt, $tm_format ); |
|
| 507 | + public function end_date_and_time($dt_frmt = FALSE, $tm_format = FALSE) { |
|
| 508 | + return $this->_show_datetime('', 'end', $dt_frmt, $tm_format); |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | |
@@ -514,8 +514,8 @@ discard block |
||
| 514 | 514 | * @param bool $dt_frmt |
| 515 | 515 | * @param bool $tm_format |
| 516 | 516 | */ |
| 517 | - public function e_end_date_and_time( $dt_frmt = FALSE, $tm_format = FALSE ) { |
|
| 518 | - $this->_show_datetime( '', 'end', $dt_frmt, $tm_format, TRUE ); |
|
| 517 | + public function e_end_date_and_time($dt_frmt = FALSE, $tm_format = FALSE) { |
|
| 518 | + $this->_show_datetime('', 'end', $dt_frmt, $tm_format, TRUE); |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | * @return int |
| 528 | 528 | */ |
| 529 | 529 | public function start() { |
| 530 | - return $this->get_raw( 'DTT_EVT_start' ); |
|
| 530 | + return $this->get_raw('DTT_EVT_start'); |
|
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | * @return int |
| 540 | 540 | */ |
| 541 | 541 | public function end() { |
| 542 | - return $this->get_raw( 'DTT_EVT_end' ); |
|
| 542 | + return $this->get_raw('DTT_EVT_end'); |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | * @return mixed int on success, FALSE on fail |
| 552 | 552 | */ |
| 553 | 553 | public function reg_limit() { |
| 554 | - return $this->get_raw( 'DTT_reg_limit' ); |
|
| 554 | + return $this->get_raw('DTT_reg_limit'); |
|
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | * @return mixed int on success, FALSE on fail |
| 564 | 564 | */ |
| 565 | 565 | public function sold() { |
| 566 | - return $this->get_raw( 'DTT_sold' ); |
|
| 566 | + return $this->get_raw('DTT_sold'); |
|
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | |
@@ -592,15 +592,15 @@ discard block |
||
| 592 | 592 | * the spaces remaining for this particular datetime, hence the flag. |
| 593 | 593 | * @return int |
| 594 | 594 | */ |
| 595 | - public function spaces_remaining( $consider_tickets = FALSE ) { |
|
| 595 | + public function spaces_remaining($consider_tickets = FALSE) { |
|
| 596 | 596 | // tickets remaining available for purchase |
| 597 | 597 | //no need for special checks for infinite, because if DTT_reg_limit == EE_INF, then EE_INF - x = EE_INF |
| 598 | 598 | $dtt_remaining = $this->reg_limit() - $this->sold(); |
| 599 | - if ( ! $consider_tickets ) { |
|
| 599 | + if ( ! $consider_tickets) { |
|
| 600 | 600 | return $dtt_remaining; |
| 601 | 601 | } |
| 602 | 602 | $tickets_remaining = $this->tickets_remaining(); |
| 603 | - return min( $dtt_remaining, $tickets_remaining ); |
|
| 603 | + return min($dtt_remaining, $tickets_remaining); |
|
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | |
@@ -611,19 +611,19 @@ discard block |
||
| 611 | 611 | * @param array $query_params like EEM_Base::get_all's |
| 612 | 612 | * @return int |
| 613 | 613 | */ |
| 614 | - public function tickets_remaining( $query_params = array() ) { |
|
| 614 | + public function tickets_remaining($query_params = array()) { |
|
| 615 | 615 | $sum = 0; |
| 616 | - $tickets = $this->tickets( $query_params ); |
|
| 617 | - if ( ! empty( $tickets ) ) { |
|
| 618 | - foreach ( $tickets as $ticket ) { |
|
| 619 | - if ( $ticket instanceof EE_Ticket ) { |
|
| 616 | + $tickets = $this->tickets($query_params); |
|
| 617 | + if ( ! empty($tickets)) { |
|
| 618 | + foreach ($tickets as $ticket) { |
|
| 619 | + if ($ticket instanceof EE_Ticket) { |
|
| 620 | 620 | // get the actual amount of tickets that can be sold |
| 621 | - $qty = $ticket->qty( 'saleable' ); |
|
| 622 | - if ( $qty === EE_INF ) { |
|
| 621 | + $qty = $ticket->qty('saleable'); |
|
| 622 | + if ($qty === EE_INF) { |
|
| 623 | 623 | return EE_INF; |
| 624 | 624 | } |
| 625 | 625 | // no negative ticket quantities plz |
| 626 | - if ( $qty > 0 ) { |
|
| 626 | + if ($qty > 0) { |
|
| 627 | 627 | $sum += $qty; |
| 628 | 628 | } |
| 629 | 629 | } |
@@ -640,8 +640,8 @@ discard block |
||
| 640 | 640 | * @param array $query_params like EEM_Base::get_all's |
| 641 | 641 | * @return int |
| 642 | 642 | */ |
| 643 | - public function sum_tickets_initially_available( $query_params = array() ) { |
|
| 644 | - return $this->sum_related( 'Ticket', $query_params, 'TKT_qty' ); |
|
| 643 | + public function sum_tickets_initially_available($query_params = array()) { |
|
| 644 | + return $this->sum_related('Ticket', $query_params, 'TKT_qty'); |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | * @return int |
| 654 | 654 | */ |
| 655 | 655 | public function total_tickets_available_at_this_datetime() { |
| 656 | - return $this->spaces_remaining( true ); |
|
| 656 | + return $this->spaces_remaining(true); |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | * @return boolean |
| 665 | 665 | */ |
| 666 | 666 | public function is_upcoming() { |
| 667 | - return ( $this->get_raw( 'DTT_EVT_start' ) > time() ); |
|
| 667 | + return ($this->get_raw('DTT_EVT_start') > time()); |
|
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | * @return boolean |
| 675 | 675 | */ |
| 676 | 676 | public function is_active() { |
| 677 | - return ( $this->get_raw( 'DTT_EVT_start' ) < time() && $this->get_raw( 'DTT_EVT_end' ) > time() ); |
|
| 677 | + return ($this->get_raw('DTT_EVT_start') < time() && $this->get_raw('DTT_EVT_end') > time()); |
|
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | * @return boolean |
| 685 | 685 | */ |
| 686 | 686 | public function is_expired() { |
| 687 | - return ( $this->get_raw( 'DTT_EVT_end' ) < time() ); |
|
| 687 | + return ($this->get_raw('DTT_EVT_end') < time()); |
|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | |
@@ -695,16 +695,16 @@ discard block |
||
| 695 | 695 | */ |
| 696 | 696 | public function get_active_status() { |
| 697 | 697 | $total_tickets_for_this_dtt = $this->total_tickets_available_at_this_datetime(); |
| 698 | - if ( $total_tickets_for_this_dtt !== FALSE && $total_tickets_for_this_dtt < 1 ) { |
|
| 698 | + if ($total_tickets_for_this_dtt !== FALSE && $total_tickets_for_this_dtt < 1) { |
|
| 699 | 699 | return EE_Datetime::sold_out; |
| 700 | 700 | } |
| 701 | - if ( $this->is_expired() ) { |
|
| 701 | + if ($this->is_expired()) { |
|
| 702 | 702 | return EE_Datetime::expired; |
| 703 | 703 | } |
| 704 | - if ( $this->is_upcoming() ) { |
|
| 704 | + if ($this->is_upcoming()) { |
|
| 705 | 705 | return EE_Datetime::upcoming; |
| 706 | 706 | } |
| 707 | - if ( $this->is_active() ) { |
|
| 707 | + if ($this->is_active()) { |
|
| 708 | 708 | return EE_Datetime::active; |
| 709 | 709 | } |
| 710 | 710 | return NULL; |
@@ -718,24 +718,24 @@ discard block |
||
| 718 | 718 | * @param boolean $use_dtt_name if TRUE then we'll use DTT->name() if its not empty. |
| 719 | 719 | * @return string |
| 720 | 720 | */ |
| 721 | - public function get_dtt_display_name( $use_dtt_name = FALSE ) { |
|
| 722 | - if ( $use_dtt_name ) { |
|
| 721 | + public function get_dtt_display_name($use_dtt_name = FALSE) { |
|
| 722 | + if ($use_dtt_name) { |
|
| 723 | 723 | $dtt_name = $this->name(); |
| 724 | - if ( !empty( $dtt_name ) ) { |
|
| 724 | + if ( ! empty($dtt_name)) { |
|
| 725 | 725 | return $dtt_name; |
| 726 | 726 | } |
| 727 | 727 | } |
| 728 | 728 | //first condition is to see if the months are different |
| 729 | - if ( date( 'm', $this->get_raw( 'DTT_EVT_start' ) ) != date( 'm', $this->get_raw( 'DTT_EVT_end' ) ) ) { |
|
| 730 | - $display_date = $this->start_date( 'M j\, Y g:i a' ) . ' - ' . $this->end_date( 'M j\, Y g:i a' ); |
|
| 729 | + if (date('m', $this->get_raw('DTT_EVT_start')) != date('m', $this->get_raw('DTT_EVT_end'))) { |
|
| 730 | + $display_date = $this->start_date('M j\, Y g:i a').' - '.$this->end_date('M j\, Y g:i a'); |
|
| 731 | 731 | //next condition is if its the same month but different day |
| 732 | 732 | } |
| 733 | 733 | else { |
| 734 | - if ( date( 'm', $this->get_raw( 'DTT_EVT_start' ) ) == date( 'm', $this->get_raw( 'DTT_EVT_end' ) ) && date( 'd', $this->get_raw( 'DTT_EVT_start' ) ) != date( 'd', $this->get_raw( 'DTT_EVT_end' ) ) ) { |
|
| 735 | - $display_date = $this->start_date( 'M j\, g:i a' ) . ' - ' . $this->end_date( 'M j\, g:i a Y' ); |
|
| 734 | + if (date('m', $this->get_raw('DTT_EVT_start')) == date('m', $this->get_raw('DTT_EVT_end')) && date('d', $this->get_raw('DTT_EVT_start')) != date('d', $this->get_raw('DTT_EVT_end'))) { |
|
| 735 | + $display_date = $this->start_date('M j\, g:i a').' - '.$this->end_date('M j\, g:i a Y'); |
|
| 736 | 736 | } |
| 737 | 737 | else { |
| 738 | - $display_date = $this->start_date( 'F j\, Y' ) . ' @ ' . $this->start_date( 'g:i a' ) . ' - ' . $this->end_date( 'g:i a' ); |
|
| 738 | + $display_date = $this->start_date('F j\, Y').' @ '.$this->start_date('g:i a').' - '.$this->end_date('g:i a'); |
|
| 739 | 739 | } |
| 740 | 740 | } |
| 741 | 741 | return $display_date; |
@@ -749,8 +749,8 @@ discard block |
||
| 749 | 749 | *@param array $query_params see EEM_Base::get_all() |
| 750 | 750 | * @return EE_Ticket[] |
| 751 | 751 | */ |
| 752 | - public function tickets( $query_params = array() ) { |
|
| 753 | - return $this->get_many_related( 'Ticket', $query_params ); |
|
| 752 | + public function tickets($query_params = array()) { |
|
| 753 | + return $this->get_many_related('Ticket', $query_params); |
|
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | |
@@ -760,21 +760,21 @@ discard block |
||
| 760 | 760 | * @param array $query_params like EEM_Base::get_all's |
| 761 | 761 | * @return EE_Ticket[] |
| 762 | 762 | */ |
| 763 | - public function ticket_types_available_for_purchase( $query_params = array() ) { |
|
| 763 | + public function ticket_types_available_for_purchase($query_params = array()) { |
|
| 764 | 764 | // first check if datetime is valid |
| 765 | - if ( ! ( $this->is_upcoming() || $this->is_active() ) || $this->sold_out() ) { |
|
| 765 | + if ( ! ($this->is_upcoming() || $this->is_active()) || $this->sold_out()) { |
|
| 766 | 766 | return array(); |
| 767 | 767 | } |
| 768 | - if ( empty( $query_params ) ) { |
|
| 768 | + if (empty($query_params)) { |
|
| 769 | 769 | $query_params = array( |
| 770 | 770 | array( |
| 771 | - 'TKT_start_date' => array( '<=', EEM_Ticket::instance()->current_time_for_query( 'TKT_start_date' ) ), |
|
| 772 | - 'TKT_end_date' => array( '>=', EEM_Ticket::instance()->current_time_for_query( 'TKT_end_date' ) ), |
|
| 771 | + 'TKT_start_date' => array('<=', EEM_Ticket::instance()->current_time_for_query('TKT_start_date')), |
|
| 772 | + 'TKT_end_date' => array('>=', EEM_Ticket::instance()->current_time_for_query('TKT_end_date')), |
|
| 773 | 773 | 'TKT_deleted' => false |
| 774 | 774 | ) |
| 775 | 775 | ); |
| 776 | 776 | } |
| 777 | - return $this->tickets( $query_params ); |
|
| 777 | + return $this->tickets($query_params); |
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | * @return EE_Event |
| 785 | 785 | */ |
| 786 | 786 | public function event() { |
| 787 | - return $this->get_first_related( 'Event' ); |
|
| 787 | + return $this->get_first_related('Event'); |
|
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | |
@@ -796,13 +796,13 @@ discard block |
||
| 796 | 796 | */ |
| 797 | 797 | public function update_sold() { |
| 798 | 798 | $count_regs_for_this_datetime = EEM_Registration::instance()->count( |
| 799 | - array( array( |
|
| 799 | + array(array( |
|
| 800 | 800 | 'STS_ID' => EEM_Registration::status_id_approved, |
| 801 | 801 | 'REG_deleted' => 0, |
| 802 | 802 | 'Ticket.Datetime.DTT_ID' => $this->ID(), |
| 803 | - ) ) |
|
| 803 | + )) |
|
| 804 | 804 | ); |
| 805 | - $this->set( 'DTT_sold', $count_regs_for_this_datetime ); |
|
| 805 | + $this->set('DTT_sold', $count_regs_for_this_datetime); |
|
| 806 | 806 | $this->save(); |
| 807 | 807 | return $count_regs_for_this_datetime; |
| 808 | 808 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | * @param string $dt_frmt |
| 277 | 277 | * @param string $tm_frmt |
| 278 | 278 | * @param bool $echo - whether we echo or return (note echoing uses "pretty" formats, otherwise we use the standard formats) |
| 279 | - * @return string|bool|void string on success, FALSE on fail |
|
| 279 | + * @return null|string string on success, FALSE on fail |
|
| 280 | 280 | */ |
| 281 | 281 | private function _show_datetime( $date_or_time = NULL, $start_or_end = 'start', $dt_frmt = '', $tm_frmt = '', $echo = FALSE ) { |
| 282 | 282 | $field_name = "DTT_EVT_{$start_or_end}"; |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | * last-used format, or '' to use the default date format |
| 295 | 295 | * |
| 296 | 296 | * @access public |
| 297 | - * @param null $dt_frmt - string representation of date format defaults to 'F j, Y' |
|
| 298 | - * @return mixed string on success, FALSE on fail |
|
| 297 | + * @param string $dt_frmt - string representation of date format defaults to 'F j, Y' |
|
| 298 | + * @return null|string string on success, FALSE on fail |
|
| 299 | 299 | */ |
| 300 | 300 | public function start_date( $dt_frmt = NULL ) { |
| 301 | 301 | return $this->_show_datetime( 'D', 'start', $dt_frmt ); |
@@ -318,8 +318,8 @@ discard block |
||
| 318 | 318 | * last-used format, or '' to use the default date format |
| 319 | 319 | * |
| 320 | 320 | * @access public |
| 321 | - * @param null $dt_frmt - string representation of date format defaults to 'F j, Y' |
|
| 322 | - * @return mixed string on success, FALSE on fail |
|
| 321 | + * @param string $dt_frmt - string representation of date format defaults to 'F j, Y' |
|
| 322 | + * @return null|string string on success, FALSE on fail |
|
| 323 | 323 | */ |
| 324 | 324 | public function end_date( $dt_frmt = NULL ) { |
| 325 | 325 | return $this->_show_datetime( 'D', 'end', $dt_frmt ); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | * @access public |
| 344 | 344 | * @param null $dt_frmt - string representation of date format defaults to WP settings |
| 345 | 345 | * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31 |
| 346 | - * @return mixed string on success, FALSE on fail |
|
| 346 | + * @return string string on success, FALSE on fail |
|
| 347 | 347 | */ |
| 348 | 348 | public function date_range( $dt_frmt = NULL, $conjunction = ' - ' ) { |
| 349 | 349 | $dt_frmt = ! empty( $dt_frmt ) ? $dt_frmt : $this->_dt_frmt; |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | * |
| 370 | 370 | * @access public |
| 371 | 371 | * @param string $tm_format - string representation of time format defaults to 'g:i a' |
| 372 | - * @return mixed string on success, FALSE on fail |
|
| 372 | + * @return null|string string on success, FALSE on fail |
|
| 373 | 373 | */ |
| 374 | 374 | public function start_time( $tm_format = NULL ) { |
| 375 | 375 | return $this->_show_datetime( 'T', 'start', NULL, $tm_format ); |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | * |
| 392 | 392 | * @access public |
| 393 | 393 | * @param string $tm_format - string representation of time format defaults to 'g:i a' |
| 394 | - * @return mixed string on success, FALSE on fail |
|
| 394 | + * @return null|string string on success, FALSE on fail |
|
| 395 | 395 | */ |
| 396 | 396 | public function end_time( $tm_format = NULL ) { |
| 397 | 397 | return $this->_show_datetime( 'T', 'end', NULL, $tm_format ); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | * @access public |
| 415 | 415 | * @param string $tm_format - string representation of time format defaults to 'g:i a' |
| 416 | 416 | * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31 |
| 417 | - * @return mixed string on success, FALSE on fail |
|
| 417 | + * @return string string on success, FALSE on fail |
|
| 418 | 418 | */ |
| 419 | 419 | public function time_range( $tm_format = NULL, $conjunction = ' - ' ) { |
| 420 | 420 | $tm_format = !empty( $tm_format ) ? $tm_format : $this->_tm_frmt; |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | * @access public |
| 443 | 443 | * @param string $dt_format - string representation of date format defaults to 'F j, Y' |
| 444 | 444 | * @param string $tm_format - string representation of time format defaults to 'g:i a' |
| 445 | - * @return mixed string on success, FALSE on fail |
|
| 445 | + * @return null|string string on success, FALSE on fail |
|
| 446 | 446 | */ |
| 447 | 447 | public function start_date_and_time( $dt_format = NULL, $tm_format = NULL ) { |
| 448 | 448 | return $this->_show_datetime( '', 'start', $dt_format, $tm_format ); |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | * @access public |
| 503 | 503 | * @param bool | string $dt_frmt- string representation of date format defaults to 'F j, Y' |
| 504 | 504 | * @param bool | string $tm_format - string representation of time format defaults to 'g:i a' |
| 505 | - * @return mixed string on success, FALSE on fail |
|
| 505 | + * @return null|string string on success, FALSE on fail |
|
| 506 | 506 | */ |
| 507 | 507 | public function end_date_and_time( $dt_frmt = FALSE, $tm_format = FALSE ) { |
| 508 | 508 | return $this->_show_datetime( '', 'end', $dt_frmt, $tm_format ); |
@@ -22,9 +22,9 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * Contains definition for EE_Event_Message_Template model object |
| 4 | 6 | * @package Event Espresso |
@@ -1,18 +1,18 @@ discard block |
||
| 1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 2 | - exit( 'No direct script access allowed' ); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | 3 | } |
| 4 | 4 | /** |
| 5 | 5 | * 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 |
||
| 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 |
@@ -2,15 +2,15 @@ discard block |
||
| 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 |
||
| 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 |