@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * |
| 51 | 51 | * @param type $props_n_values |
| 52 | - * @return EE_Answer |
|
| 52 | + * @return EE_Currency |
|
| 53 | 53 | */ |
| 54 | 54 | public static function new_instance_from_db ( $props_n_values = array() ) { |
| 55 | 55 | $classname = __CLASS__; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | /** |
| 62 | 62 | * Gets code |
| 63 | - * @return string |
|
| 63 | + * @return boolean |
|
| 64 | 64 | */ |
| 65 | 65 | function code() { |
| 66 | 66 | return $this->get('CUR_code'); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | /** |
| 70 | 70 | * Sets code |
| 71 | 71 | * @param string $code |
| 72 | - * @return boolean |
|
| 72 | + * @return boolean|null |
|
| 73 | 73 | */ |
| 74 | 74 | function set_code($code) { |
| 75 | 75 | return $this->set('CUR_code', $code); |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * Sets active |
| 87 | 87 | * @param boolean $active |
| 88 | - * @return boolean |
|
| 88 | + * @return boolean|null |
|
| 89 | 89 | */ |
| 90 | 90 | function set_active($active) { |
| 91 | 91 | return $this->set('CUR_active', $active); |
| 92 | 92 | } |
| 93 | 93 | /** |
| 94 | 94 | * Gets dec_plc |
| 95 | - * @return int |
|
| 95 | + * @return boolean |
|
| 96 | 96 | */ |
| 97 | 97 | function dec_plc() { |
| 98 | 98 | return $this->get('CUR_dec_plc'); |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * Sets dec_plc |
| 103 | 103 | * @param int $dec_plc |
| 104 | - * @return boolean |
|
| 104 | + * @return boolean|null |
|
| 105 | 105 | */ |
| 106 | 106 | function set_dec_plc($dec_plc) { |
| 107 | 107 | return $this->set('CUR_dec_plc', $dec_plc); |
| 108 | 108 | } |
| 109 | 109 | /** |
| 110 | 110 | * Gets plural |
| 111 | - * @return string |
|
| 111 | + * @return boolean |
|
| 112 | 112 | */ |
| 113 | 113 | function plural_name() { |
| 114 | 114 | return $this->get('CUR_plural'); |
@@ -117,14 +117,14 @@ discard block |
||
| 117 | 117 | /** |
| 118 | 118 | * Sets plural |
| 119 | 119 | * @param string $plural |
| 120 | - * @return boolean |
|
| 120 | + * @return boolean|null |
|
| 121 | 121 | */ |
| 122 | 122 | function set_plural_name($plural) { |
| 123 | 123 | return $this->set('CUR_plural', $plural); |
| 124 | 124 | } |
| 125 | 125 | /** |
| 126 | 126 | * Gets sign |
| 127 | - * @return string |
|
| 127 | + * @return boolean |
|
| 128 | 128 | */ |
| 129 | 129 | function sign() { |
| 130 | 130 | return $this->get('CUR_sign'); |
@@ -133,14 +133,14 @@ discard block |
||
| 133 | 133 | /** |
| 134 | 134 | * Sets sign |
| 135 | 135 | * @param string $sign |
| 136 | - * @return boolean |
|
| 136 | + * @return boolean|null |
|
| 137 | 137 | */ |
| 138 | 138 | function set_sign($sign) { |
| 139 | 139 | return $this->set('CUR_sign', $sign); |
| 140 | 140 | } |
| 141 | 141 | /** |
| 142 | 142 | * Gets single |
| 143 | - * @return string |
|
| 143 | + * @return boolean |
|
| 144 | 144 | */ |
| 145 | 145 | function singular_name() { |
| 146 | 146 | return $this->get('CUR_single'); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | /** |
| 150 | 150 | * Sets single |
| 151 | 151 | * @param string $single |
| 152 | - * @return boolean |
|
| 152 | + * @return boolean|null |
|
| 153 | 153 | */ |
| 154 | 154 | function set_singular_name($single) { |
| 155 | 155 | return $this->set('CUR_single', $single); |
@@ -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_Currency extends EE_Base_Class{ |
|
| 28 | +class EE_Currency extends EE_Base_Class { |
|
| 29 | 29 | |
| 30 | 30 | /** Currency COde @var CUR_code*/ protected $_CUR_code = NULL; |
| 31 | 31 | /** Currency Name Singular @var CUR_single*/ protected $_CUR_single = NULL; |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | * @param type $props_n_values |
| 40 | 40 | * @return EE_Answer |
| 41 | 41 | */ |
| 42 | - public static function new_instance( $props_n_values = array() ) { |
|
| 42 | + public static function new_instance($props_n_values = array()) { |
|
| 43 | 43 | $classname = __CLASS__; |
| 44 | - $has_object = parent::_check_for_object( $props_n_values, $classname ); |
|
| 44 | + $has_object = parent::_check_for_object($props_n_values, $classname); |
|
| 45 | 45 | // d( $has_object ); |
| 46 | - return $has_object ? $has_object : new self( $props_n_values); |
|
| 46 | + return $has_object ? $has_object : new self($props_n_values); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | * @param type $props_n_values |
| 52 | 52 | * @return EE_Answer |
| 53 | 53 | */ |
| 54 | - public static function new_instance_from_db ( $props_n_values = array() ) { |
|
| 54 | + public static function new_instance_from_db($props_n_values = array()) { |
|
| 55 | 55 | $classname = __CLASS__; |
| 56 | 56 | // $mapped_object = parent::_get_object_from_entity_mapper($props_n_values, $classname); |
| 57 | 57 | // d( $mapped_object ); |
| 58 | 58 | // return $mapped_object ? $mapped_object : new self( $props_n_values, TRUE ); |
| 59 | - return new self( $props_n_values, TRUE ); |
|
| 59 | + return new self($props_n_values, TRUE); |
|
| 60 | 60 | } |
| 61 | 61 | /** |
| 62 | 62 | * Gets code |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | * Gets a prettier name |
| 159 | 159 | * @return string |
| 160 | 160 | */ |
| 161 | - function name(){ |
|
| 162 | - return sprintf(__("%s (%s)", "event_espresso"),$this->code(),$this->plural_name()); |
|
| 161 | + function name() { |
|
| 162 | + return sprintf(__("%s (%s)", "event_espresso"), $this->code(), $this->plural_name()); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | } |
@@ -1,7 +1,8 @@ |
||
| 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 |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | /** |
| 114 | 114 | * get Price type |
| 115 | 115 | * @access public |
| 116 | - * @return int |
|
| 116 | + * @return boolean |
|
| 117 | 117 | */ |
| 118 | 118 | public function type() { |
| 119 | 119 | return $this->get( 'PRT_ID' ); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | /** |
| 125 | 125 | * get Price Amount |
| 126 | 126 | * @access public |
| 127 | - * @return float |
|
| 127 | + * @return boolean |
|
| 128 | 128 | */ |
| 129 | 129 | public function amount() { |
| 130 | 130 | return $this->get( 'PRC_amount' ); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | /** |
| 136 | 136 | * get Price Name |
| 137 | 137 | * @access public |
| 138 | - * @return string |
|
| 138 | + * @return boolean |
|
| 139 | 139 | */ |
| 140 | 140 | public function name() { |
| 141 | 141 | return $this->get( 'PRC_name' ); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | /** |
| 147 | 147 | * get Price description |
| 148 | 148 | * @access public |
| 149 | - * @return string |
|
| 149 | + * @return boolean |
|
| 150 | 150 | */ |
| 151 | 151 | public function desc() { |
| 152 | 152 | return $this->get( 'PRC_desc' ); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | /** |
| 158 | 158 | * get overrides |
| 159 | 159 | * @access public |
| 160 | - * @return int |
|
| 160 | + * @return boolean |
|
| 161 | 161 | */ |
| 162 | 162 | public function overrides() { |
| 163 | 163 | return $this->get( 'PRC_overrides' ); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | /** |
| 169 | 169 | * get order |
| 170 | 170 | * @access public |
| 171 | - * @return int |
|
| 171 | + * @return boolean |
|
| 172 | 172 | */ |
| 173 | 173 | public function order() { |
| 174 | 174 | return $this->get( 'PRC_order' ); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * |
| 182 | 182 | * @since 4.5.0 |
| 183 | 183 | * |
| 184 | - * @return int |
|
| 184 | + * @return boolean |
|
| 185 | 185 | */ |
| 186 | 186 | public function wp_user() { |
| 187 | 187 | return $this->get('PRC_wp_user'); |
@@ -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 |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | * @param string $timezone |
| 33 | 33 | * @return EE_Price |
| 34 | 34 | */ |
| 35 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
| 36 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
| 37 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
| 35 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
| 36 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 37 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | * @param string $timezone |
| 45 | 45 | * @return EE_Price |
| 46 | 46 | */ |
| 47 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
| 48 | - return new self( $props_n_values, TRUE, $timezone ); |
|
| 47 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
| 48 | + return new self($props_n_values, TRUE, $timezone); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | * @access public |
| 57 | 57 | * @param int $PRT_ID |
| 58 | 58 | */ |
| 59 | - public function set_type( $PRT_ID = 0 ) { |
|
| 60 | - $this->set( 'PRT_ID', $PRT_ID ); |
|
| 59 | + public function set_type($PRT_ID = 0) { |
|
| 60 | + $this->set('PRT_ID', $PRT_ID); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | * @access public |
| 69 | 69 | * @param float $PRC_amount |
| 70 | 70 | */ |
| 71 | - public function set_amount( $PRC_amount = 0.00 ) { |
|
| 72 | - $this->set( 'PRC_amount', $PRC_amount ); |
|
| 71 | + public function set_amount($PRC_amount = 0.00) { |
|
| 72 | + $this->set('PRC_amount', $PRC_amount); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | * @access public |
| 81 | 81 | * @param string $PRC_name |
| 82 | 82 | */ |
| 83 | - public function set_name( $PRC_name = '' ) { |
|
| 84 | - $this->set( 'PRC_name', $PRC_name ); |
|
| 83 | + public function set_name($PRC_name = '') { |
|
| 84 | + $this->set('PRC_name', $PRC_name); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | * @access public |
| 93 | 93 | * @param string $PRC_desc |
| 94 | 94 | */ |
| 95 | - public function set_description( $PRC_desc = '' ) { |
|
| 96 | - $this->Set( 'PRC_desc', $PRC_desc ); |
|
| 95 | + public function set_description($PRC_desc = '') { |
|
| 96 | + $this->Set('PRC_desc', $PRC_desc); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | * @access public |
| 105 | 105 | * @param bool $PRC_deleted |
| 106 | 106 | */ |
| 107 | - public function set_deleted( $PRC_deleted = NULL ) { |
|
| 108 | - $this->set( 'PRC_deleted', $PRC_deleted ); |
|
| 107 | + public function set_deleted($PRC_deleted = NULL) { |
|
| 108 | + $this->set('PRC_deleted', $PRC_deleted); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @return int |
| 117 | 117 | */ |
| 118 | 118 | public function type() { |
| 119 | - return $this->get( 'PRT_ID' ); |
|
| 119 | + return $this->get('PRT_ID'); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @return float |
| 128 | 128 | */ |
| 129 | 129 | public function amount() { |
| 130 | - return $this->get( 'PRC_amount' ); |
|
| 130 | + return $this->get('PRC_amount'); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * @return string |
| 139 | 139 | */ |
| 140 | 140 | public function name() { |
| 141 | - return $this->get( 'PRC_name' ); |
|
| 141 | + return $this->get('PRC_name'); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @return string |
| 150 | 150 | */ |
| 151 | 151 | public function desc() { |
| 152 | - return $this->get( 'PRC_desc' ); |
|
| 152 | + return $this->get('PRC_desc'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @return int |
| 161 | 161 | */ |
| 162 | 162 | public function overrides() { |
| 163 | - return $this->get( 'PRC_overrides' ); |
|
| 163 | + return $this->get('PRC_overrides'); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @return int |
| 172 | 172 | */ |
| 173 | 173 | public function order() { |
| 174 | - return $this->get( 'PRC_order' ); |
|
| 174 | + return $this->get('PRC_order'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @return bool |
| 196 | 196 | */ |
| 197 | 197 | public function deleted() { |
| 198 | - return $this->get( 'PRC_deleted' ); |
|
| 198 | + return $this->get('PRC_deleted'); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * @return bool |
| 205 | 205 | */ |
| 206 | 206 | public function parent() { |
| 207 | - return $this->get( 'PRC_parent' ); |
|
| 207 | + return $this->get('PRC_parent'); |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * @return EE_Price_Type |
| 227 | 227 | */ |
| 228 | 228 | public function type_obj() { |
| 229 | - return $this->get_first_related( 'Price_Type' ); |
|
| 229 | + return $this->get_first_related('Price_Type'); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | public function is_percent() { |
| 250 | 250 | $price_type = $this->type_obj(); |
| 251 | - return $price_type->get( 'PRT_is_percent' ); |
|
| 251 | + return $price_type->get('PRT_is_percent'); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | * @return string |
| 261 | 261 | */ |
| 262 | 262 | public function pretty_price() { |
| 263 | - return ! $this->is_percent() ? $this->get_pretty('PRC_amount') : $this->get('PRC_amount') . '%'; |
|
| 263 | + return ! $this->is_percent() ? $this->get_pretty('PRC_amount') : $this->get('PRC_amount').'%'; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | * @return mixed |
| 270 | 270 | */ |
| 271 | 271 | public function get_price_without_currency_symbol() { |
| 272 | - return str_replace( EE_Registry::instance()->CFG->currency->sign, '', $this->get_pretty( 'PRC_amount' ) ); |
|
| 272 | + return str_replace(EE_Registry::instance()->CFG->currency->sign, '', $this->get_pretty('PRC_amount')); |
|
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | |
@@ -99,11 +99,11 @@ |
||
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * set deleted |
|
| 103 | - * |
|
| 104 | - * @access public |
|
| 105 | - * @param bool $PRC_deleted |
|
| 106 | - */ |
|
| 102 | + * set deleted |
|
| 103 | + * |
|
| 104 | + * @access public |
|
| 105 | + * @param bool $PRC_deleted |
|
| 106 | + */ |
|
| 107 | 107 | public function set_deleted( $PRC_deleted = NULL ) { |
| 108 | 108 | $this->set( 'PRC_deleted', $PRC_deleted ); |
| 109 | 109 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @param array $props_n_values |
| 33 | - * @return EE_Question|mixed |
|
| 33 | + * @return null|EE_Question |
|
| 34 | 34 | */ |
| 35 | 35 | public static function new_instance( $props_n_values = array() ) { |
| 36 | 36 | $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | /** |
| 178 | 178 | * returns the text for displaying the question to users |
| 179 | 179 | * @access public |
| 180 | - * @return string |
|
| 180 | + * @return boolean |
|
| 181 | 181 | */ |
| 182 | 182 | public function display_text() { |
| 183 | 183 | return $this->get( 'QST_display_text' ); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | /** |
| 189 | 189 | * returns the text for the administrative label |
| 190 | 190 | * @access public |
| 191 | - * @return string |
|
| 191 | + * @return boolean |
|
| 192 | 192 | */ |
| 193 | 193 | public function admin_label() { |
| 194 | 194 | return $this->get( 'QST_admin_label' ); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | /** |
| 200 | 200 | * returns the attendee column name for this question |
| 201 | 201 | * @access public |
| 202 | - * @return string |
|
| 202 | + * @return boolean |
|
| 203 | 203 | */ |
| 204 | 204 | public function system_ID() { |
| 205 | 205 | return $this->get( 'QST_system' ); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * returns the text which should be displayed when a user |
| 223 | 223 | * doesn't answer this question in a form |
| 224 | 224 | * @access public |
| 225 | - * @return string |
|
| 225 | + * @return boolean |
|
| 226 | 226 | */ |
| 227 | 227 | public function required_text() { |
| 228 | 228 | return $this->get( 'QST_required_text' ); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | /** |
| 234 | 234 | * returns the type of this question |
| 235 | 235 | * @access public |
| 236 | - * @return string |
|
| 236 | + * @return boolean |
|
| 237 | 237 | */ |
| 238 | 238 | public function type() { |
| 239 | 239 | return $this->get( 'QST_type' ); |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * returns an integer showing where this question should |
| 246 | 246 | * be placed in a sequence of questions |
| 247 | 247 | * @access public |
| 248 | - * @return int |
|
| 248 | + * @return boolean |
|
| 249 | 249 | */ |
| 250 | 250 | public function order() { |
| 251 | 251 | return $this->get( 'QST_order' ); |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | /** |
| 269 | 269 | * returns the id the wordpress user who created this question |
| 270 | 270 | * @access public |
| 271 | - * @return int |
|
| 271 | + * @return boolean |
|
| 272 | 272 | */ |
| 273 | 273 | public function wp_user() { |
| 274 | 274 | return $this->get( 'QST_wp_user' ); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | * Adds an option for this question. Note: if the option were previously associated with a different |
| 363 | 363 | * Question, that relationship will be overwritten. |
| 364 | 364 | * @param EE_Question_Option $option |
| 365 | - * @return boolean success |
|
| 365 | + * @return EE_Base_Class success |
|
| 366 | 366 | */ |
| 367 | 367 | public function add_option( EE_Question_Option $option ) { |
| 368 | 368 | return $this->_add_relation_to( $option, 'Question_Option' ); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | /** |
| 386 | 386 | * Marks the option as deleted. |
| 387 | 387 | * @param EE_Question_Option $option |
| 388 | - * @return boolean success |
|
| 388 | + * @return EE_Base_Class success |
|
| 389 | 389 | */ |
| 390 | 390 | public function remove_option( EE_Question_Option $option ) { |
| 391 | 391 | return $this->_remove_relation_to( $option, 'Question_Option' ); |
@@ -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 |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | * @param array $props_n_values |
| 33 | 33 | * @return EE_Question|mixed |
| 34 | 34 | */ |
| 35 | - public static function new_instance( $props_n_values = array() ) { |
|
| 36 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
| 37 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
| 35 | + public static function new_instance($props_n_values = array()) { |
|
| 36 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 37 | + return $has_object ? $has_object : new self($props_n_values); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | * @param array $props_n_values |
| 44 | 44 | * @return EE_Question |
| 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 string $QST_display_text |
| 57 | 57 | */ |
| 58 | - public function set_display_text( $QST_display_text = '' ) { |
|
| 59 | - $this->set( 'QST_display_text', $QST_display_text ); |
|
| 58 | + public function set_display_text($QST_display_text = '') { |
|
| 59 | + $this->set('QST_display_text', $QST_display_text); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | * @access public |
| 68 | 68 | * @param string $QST_admin_label |
| 69 | 69 | */ |
| 70 | - public function set_admin_label( $QST_admin_label = '' ) { |
|
| 71 | - $this->set( 'QST_admin_label', $QST_admin_label ); |
|
| 70 | + public function set_admin_label($QST_admin_label = '') { |
|
| 71 | + $this->set('QST_admin_label', $QST_admin_label); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | * @access public |
| 80 | 80 | * @param mixed $QST_system |
| 81 | 81 | */ |
| 82 | - public function set_system_ID( $QST_system = '' ) { |
|
| 83 | - $this->set( 'QST_system', $QST_system ); |
|
| 82 | + public function set_system_ID($QST_system = '') { |
|
| 83 | + $this->set('QST_system', $QST_system); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | * @access public |
| 92 | 92 | * @param string $QST_type |
| 93 | 93 | */ |
| 94 | - public function set_question_type( $QST_type = '' ) { |
|
| 95 | - $this->set( 'QST_type', $QST_type ); |
|
| 94 | + public function set_question_type($QST_type = '') { |
|
| 95 | + $this->set('QST_type', $QST_type); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | * @access public |
| 104 | 104 | * @param bool $QST_required |
| 105 | 105 | */ |
| 106 | - public function set_required( $QST_required = FALSE ) { |
|
| 107 | - $this->set( 'QST_required', $QST_required ); |
|
| 106 | + public function set_required($QST_required = FALSE) { |
|
| 107 | + $this->set('QST_required', $QST_required); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | * @access public |
| 116 | 116 | * @param string $QST_required_text |
| 117 | 117 | */ |
| 118 | - public function set_required_text( $QST_required_text = '' ) { |
|
| 119 | - $this->set( 'QST_required_text', $QST_required_text ); |
|
| 118 | + public function set_required_text($QST_required_text = '') { |
|
| 119 | + $this->set('QST_required_text', $QST_required_text); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | * @access public |
| 128 | 128 | * @param int $QST_order |
| 129 | 129 | */ |
| 130 | - public function set_order( $QST_order = 0 ) { |
|
| 131 | - $this->set( 'QST_order', $QST_order ); |
|
| 130 | + public function set_order($QST_order = 0) { |
|
| 131 | + $this->set('QST_order', $QST_order); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | * @access public |
| 140 | 140 | * @param bool $QST_admin_only |
| 141 | 141 | */ |
| 142 | - public function set_admin_only( $QST_admin_only = FALSE ) { |
|
| 143 | - $this->set( 'QST_admin_only', $QST_admin_only ); |
|
| 142 | + public function set_admin_only($QST_admin_only = FALSE) { |
|
| 143 | + $this->set('QST_admin_only', $QST_admin_only); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | * @access public |
| 152 | 152 | * @param int $QST_wp_user |
| 153 | 153 | */ |
| 154 | - public function set_wp_user( $QST_wp_user = 1 ) { |
|
| 155 | - $this->set( 'QST_wp_user', $QST_wp_user ); |
|
| 154 | + public function set_wp_user($QST_wp_user = 1) { |
|
| 155 | + $this->set('QST_wp_user', $QST_wp_user); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | * @access public |
| 169 | 169 | * @param bool $QST_deleted |
| 170 | 170 | */ |
| 171 | - public function set_deleted( $QST_deleted = FALSE ) { |
|
| 172 | - $this->set( 'QST_deleted', $QST_deleted ); |
|
| 171 | + public function set_deleted($QST_deleted = FALSE) { |
|
| 172 | + $this->set('QST_deleted', $QST_deleted); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | * @return string |
| 181 | 181 | */ |
| 182 | 182 | public function display_text() { |
| 183 | - return $this->get( 'QST_display_text' ); |
|
| 183 | + return $this->get('QST_display_text'); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @return string |
| 192 | 192 | */ |
| 193 | 193 | public function admin_label() { |
| 194 | - return $this->get( 'QST_admin_label' ); |
|
| 194 | + return $this->get('QST_admin_label'); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | * @return string |
| 203 | 203 | */ |
| 204 | 204 | public function system_ID() { |
| 205 | - return $this->get( 'QST_system' ); |
|
| 205 | + return $this->get('QST_system'); |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @return boolean |
| 214 | 214 | */ |
| 215 | 215 | public function required() { |
| 216 | - return $this->get( 'QST_required' ); |
|
| 216 | + return $this->get('QST_required'); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @return string |
| 226 | 226 | */ |
| 227 | 227 | public function required_text() { |
| 228 | - return $this->get( 'QST_required_text' ); |
|
| 228 | + return $this->get('QST_required_text'); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @return string |
| 237 | 237 | */ |
| 238 | 238 | public function type() { |
| 239 | - return $this->get( 'QST_type' ); |
|
| 239 | + return $this->get('QST_type'); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @return int |
| 249 | 249 | */ |
| 250 | 250 | public function order() { |
| 251 | - return $this->get( 'QST_order' ); |
|
| 251 | + return $this->get('QST_order'); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | * @return boolean |
| 261 | 261 | */ |
| 262 | 262 | public function admin_only() { |
| 263 | - return $this->get( 'QST_admin_only' ); |
|
| 263 | + return $this->get('QST_admin_only'); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | * @return int |
| 272 | 272 | */ |
| 273 | 273 | public function wp_user() { |
| 274 | - return $this->get( 'QST_wp_user' ); |
|
| 274 | + return $this->get('QST_wp_user'); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * @return boolean |
| 283 | 283 | */ |
| 284 | 284 | public function deleted() { |
| 285 | - return $this->get( 'QST_deleted' ); |
|
| 285 | + return $this->get('QST_deleted'); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * @return EE_Answer[] |
| 293 | 293 | */ |
| 294 | 294 | public function answers() { |
| 295 | - return $this->get_many_related( 'Answer' ); |
|
| 295 | + return $this->get_many_related('Answer'); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | * @return boolean true = has answers, false = no answers. |
| 303 | 303 | */ |
| 304 | 304 | public function has_answers() { |
| 305 | - return $this->count_related( 'Answer' ) > 0 ? TRUE : FALSE; |
|
| 305 | + return $this->count_related('Answer') > 0 ? TRUE : FALSE; |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | * @return EE_Question_Group[] |
| 313 | 313 | */ |
| 314 | 314 | public function question_groups() { |
| 315 | - return $this->get_many_related( 'Question_Group' ); |
|
| 315 | + return $this->get_many_related('Question_Group'); |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
@@ -326,24 +326,24 @@ discard block |
||
| 326 | 326 | * whether it was trashed or not. |
| 327 | 327 | * @return EE_Question_Option[] |
| 328 | 328 | */ |
| 329 | - public function options( $notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL ) { |
|
| 330 | - if ( ! $this->ID() ) { |
|
| 329 | + public function options($notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL) { |
|
| 330 | + if ( ! $this->ID()) { |
|
| 331 | 331 | return array(); |
| 332 | 332 | } |
| 333 | 333 | $query_params = array(); |
| 334 | - if ( $selected_value_to_always_include ) { |
|
| 335 | - if ( is_array( $selected_value_to_always_include ) ) { |
|
| 336 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = array( 'IN', $selected_value_to_always_include ); |
|
| 334 | + if ($selected_value_to_always_include) { |
|
| 335 | + if (is_array($selected_value_to_always_include)) { |
|
| 336 | + $query_params[0]['OR*options-query']['QSO_value'] = array('IN', $selected_value_to_always_include); |
|
| 337 | 337 | } else { |
| 338 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = $selected_value_to_always_include; |
|
| 338 | + $query_params[0]['OR*options-query']['QSO_value'] = $selected_value_to_always_include; |
|
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | - if ( $notDeletedOptionsOnly ) { |
|
| 342 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_deleted' ] = FALSE; |
|
| 341 | + if ($notDeletedOptionsOnly) { |
|
| 342 | + $query_params[0]['OR*options-query']['QSO_deleted'] = FALSE; |
|
| 343 | 343 | } |
| 344 | 344 | //order by QSO_order |
| 345 | - $query_params[ 'order_by' ] = array( 'QSO_order' => 'ASC' ); |
|
| 346 | - return $this->get_many_related( 'Question_Option', $query_params ); |
|
| 345 | + $query_params['order_by'] = array('QSO_order' => 'ASC'); |
|
| 346 | + return $this->get_many_related('Question_Option', $query_params); |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | * @return \EE_Question_Option[] |
| 354 | 354 | */ |
| 355 | 355 | public function temp_options() { |
| 356 | - return $this->_model_relations[ 'Question_Option' ]; |
|
| 356 | + return $this->_model_relations['Question_Option']; |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | * @param EE_Question_Option $option |
| 365 | 365 | * @return boolean success |
| 366 | 366 | */ |
| 367 | - public function add_option( EE_Question_Option $option ) { |
|
| 368 | - return $this->_add_relation_to( $option, 'Question_Option' ); |
|
| 367 | + public function add_option(EE_Question_Option $option) { |
|
| 368 | + return $this->_add_relation_to($option, 'Question_Option'); |
|
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
@@ -375,8 +375,8 @@ discard block |
||
| 375 | 375 | * @param EE_Question_Option $option |
| 376 | 376 | * @return boolean success |
| 377 | 377 | */ |
| 378 | - public function add_temp_option( EE_Question_Option $option ) { |
|
| 379 | - $this->_model_relations[ 'Question_Option' ][ ] = $option; |
|
| 378 | + public function add_temp_option(EE_Question_Option $option) { |
|
| 379 | + $this->_model_relations['Question_Option'][] = $option; |
|
| 380 | 380 | return TRUE; |
| 381 | 381 | } |
| 382 | 382 | |
@@ -387,8 +387,8 @@ discard block |
||
| 387 | 387 | * @param EE_Question_Option $option |
| 388 | 388 | * @return boolean success |
| 389 | 389 | */ |
| 390 | - public function remove_option( EE_Question_Option $option ) { |
|
| 391 | - return $this->_remove_relation_to( $option, 'Question_Option' ); |
|
| 390 | + public function remove_option(EE_Question_Option $option) { |
|
| 391 | + return $this->_remove_relation_to($option, 'Question_Option'); |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
@@ -397,8 +397,8 @@ discard block |
||
| 397 | 397 | * @return bool |
| 398 | 398 | */ |
| 399 | 399 | public function is_system_question() { |
| 400 | - $system_ID = $this->get( 'QST_system' ); |
|
| 401 | - return ! empty( $system_ID ) ? TRUE : FALSE; |
|
| 400 | + $system_ID = $this->get('QST_system'); |
|
| 401 | + return ! empty($system_ID) ? TRUE : FALSE; |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
@@ -411,8 +411,8 @@ discard block |
||
| 411 | 411 | */ |
| 412 | 412 | public function set_order_to_latest() { |
| 413 | 413 | $latest_order = $this->get_model()->get_latest_question_order(); |
| 414 | - $latest_order ++; |
|
| 415 | - $this->set( 'QST_order', $latest_order ); |
|
| 414 | + $latest_order++; |
|
| 415 | + $this->set('QST_order', $latest_order); |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | /** |
| 61 | 61 | * Sets the option's key value |
| 62 | 62 | * @param string $value |
| 63 | - * @return bool success |
|
| 63 | + * @return boolean|null success |
|
| 64 | 64 | */ |
| 65 | 65 | public function set_value( $value ) { |
| 66 | 66 | $this->set( 'QSO_value', $value ); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * Sets the option's Display Text |
| 73 | 73 | * @param string $text |
| 74 | - * @return bool success |
|
| 74 | + * @return boolean|null success |
|
| 75 | 75 | */ |
| 76 | 76 | public function set_desc( $text ) { |
| 77 | 77 | $this->set( 'QSO_desc', $text ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @access public |
| 86 | 86 | * @param integer $order |
| 87 | - * @return bool $success |
|
| 87 | + * @return boolean|null $success |
|
| 88 | 88 | */ |
| 89 | 89 | public function set_order( $order ) { |
| 90 | 90 | $this->set( 'QSO_order', $order ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | /** |
| 96 | 96 | * Sets the ID of the related question |
| 97 | 97 | * @param int $question_ID |
| 98 | - * @return bool success |
|
| 98 | + * @return boolean|null success |
|
| 99 | 99 | */ |
| 100 | 100 | public function set_question_ID( $question_ID ) { |
| 101 | 101 | $this->set( 'QST_ID', $question_ID ); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | /** |
| 107 | 107 | * Sets the option's opt_group |
| 108 | 108 | * @param string $text |
| 109 | - * @return bool success |
|
| 109 | + * @return string success |
|
| 110 | 110 | */ |
| 111 | 111 | public function set_opt_group( $text ) { |
| 112 | 112 | return $this->_QSO_opt_group = $text; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * Gets the option's key value |
| 119 | - * @return string |
|
| 119 | + * @return boolean |
|
| 120 | 120 | */ |
| 121 | 121 | public function value() { |
| 122 | 122 | return $this->get( 'QSO_value' ); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * Gets the option's display text |
| 129 | - * @return string |
|
| 129 | + * @return boolean |
|
| 130 | 130 | */ |
| 131 | 131 | public function desc() { |
| 132 | 132 | return $this->get( 'QSO_desc' ); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * Returns the order or the Question Option |
| 149 | 149 | * |
| 150 | 150 | * @access public |
| 151 | - * @return integer |
|
| 151 | + * @return boolean |
|
| 152 | 152 | */ |
| 153 | 153 | public function order() { |
| 154 | 154 | return $this->get( 'QSO_option' ); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * Gets the related question's ID |
| 161 | - * @return int |
|
| 161 | + * @return boolean |
|
| 162 | 162 | */ |
| 163 | 163 | public function question_ID() { |
| 164 | 164 | return $this->get( 'QST_ID' ); |
@@ -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 |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | * @param array $props_n_values |
| 41 | 41 | * @return EE_Question_Option |
| 42 | 42 | */ |
| 43 | - public static function new_instance( $props_n_values = array() ) { |
|
| 44 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
| 45 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
| 43 | + public static function new_instance($props_n_values = array()) { |
|
| 44 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 45 | + return $has_object ? $has_object : new self($props_n_values); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | * @param array $props_n_values |
| 52 | 52 | * @return EE_Question_Option |
| 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 | |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | * @param string $value |
| 63 | 63 | * @return bool success |
| 64 | 64 | */ |
| 65 | - public function set_value( $value ) { |
|
| 66 | - $this->set( 'QSO_value', $value ); |
|
| 65 | + public function set_value($value) { |
|
| 66 | + $this->set('QSO_value', $value); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | * @param string $text |
| 74 | 74 | * @return bool success |
| 75 | 75 | */ |
| 76 | - public function set_desc( $text ) { |
|
| 77 | - $this->set( 'QSO_desc', $text ); |
|
| 76 | + public function set_desc($text) { |
|
| 77 | + $this->set('QSO_desc', $text); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | * @param integer $order |
| 87 | 87 | * @return bool $success |
| 88 | 88 | */ |
| 89 | - public function set_order( $order ) { |
|
| 90 | - $this->set( 'QSO_order', $order ); |
|
| 89 | + public function set_order($order) { |
|
| 90 | + $this->set('QSO_order', $order); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | * @param int $question_ID |
| 98 | 98 | * @return bool success |
| 99 | 99 | */ |
| 100 | - public function set_question_ID( $question_ID ) { |
|
| 101 | - $this->set( 'QST_ID', $question_ID ); |
|
| 100 | + public function set_question_ID($question_ID) { |
|
| 101 | + $this->set('QST_ID', $question_ID); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param string $text |
| 109 | 109 | * @return bool success |
| 110 | 110 | */ |
| 111 | - public function set_opt_group( $text ) { |
|
| 111 | + public function set_opt_group($text) { |
|
| 112 | 112 | return $this->_QSO_opt_group = $text; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @return string |
| 120 | 120 | */ |
| 121 | 121 | public function value() { |
| 122 | - return $this->get( 'QSO_value' ); |
|
| 122 | + return $this->get('QSO_value'); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @return string |
| 130 | 130 | */ |
| 131 | 131 | public function desc() { |
| 132 | - return $this->get( 'QSO_desc' ); |
|
| 132 | + return $this->get('QSO_desc'); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @return boolean |
| 140 | 140 | */ |
| 141 | 141 | public function deleted() { |
| 142 | - return $this->get( 'QSO_deleted' ); |
|
| 142 | + return $this->get('QSO_deleted'); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @return integer |
| 152 | 152 | */ |
| 153 | 153 | public function order() { |
| 154 | - return $this->get( 'QSO_option' ); |
|
| 154 | + return $this->get('QSO_option'); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | * @return int |
| 162 | 162 | */ |
| 163 | 163 | public function question_ID() { |
| 164 | - return $this->get( 'QST_ID' ); |
|
| 164 | + return $this->get('QST_ID'); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @return EE_Question |
| 172 | 172 | */ |
| 173 | 173 | public function question() { |
| 174 | - return $this->get_first_related( 'Question' ); |
|
| 174 | + return $this->get_first_related('Question'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | 196 | * Gets min |
| 197 | - * @return int |
|
| 197 | + * @return boolean |
|
| 198 | 198 | */ |
| 199 | 199 | function min() { |
| 200 | 200 | return $this->get( 'TKT_min' ); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * This returns the chronologically last datetime that this ticket is associated with |
| 237 | 237 | * @param string $dt_frmt |
| 238 | 238 | * @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 |
| 239 | - * @return array |
|
| 239 | + * @return string |
|
| 240 | 240 | */ |
| 241 | 241 | public function date_range( $dt_frmt = '', $conjunction = ' - ' ) { |
| 242 | 242 | return $this->first_datetime()->start_date( $dt_frmt ) . $conjunction . $this->last_datetime()->end_date( $dt_frmt ); |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | /** |
| 375 | 375 | * Gets all the ticket applicabilities (ie, relations between datetimes and tickets) |
| 376 | 376 | * @param array $query_params see EEM_Base::get_all() |
| 377 | - * @return EE_Datetime_Ticket |
|
| 377 | + * @return EE_Base_Class[] |
|
| 378 | 378 | */ |
| 379 | 379 | public function datetime_tickets( $query_params = array() ) { |
| 380 | 380 | return $this->get_many_related( 'Datetime_Ticket', $query_params ); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | |
| 397 | 397 | /** |
| 398 | 398 | * Gets ID |
| 399 | - * @return string |
|
| 399 | + * @return boolean |
|
| 400 | 400 | */ |
| 401 | 401 | function ID() { |
| 402 | 402 | return $this->get( 'TKT_ID' ); |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | * |
| 411 | 411 | * @since 4.5.0 |
| 412 | 412 | * |
| 413 | - * @return int |
|
| 413 | + * @return boolean |
|
| 414 | 414 | */ |
| 415 | 415 | public function wp_user() { |
| 416 | 416 | return $this->get('TKT_wp_user'); |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | /** |
| 509 | 509 | * Sets name |
| 510 | 510 | * @param string $name |
| 511 | - * @return boolean |
|
| 511 | + * @return boolean|null |
|
| 512 | 512 | */ |
| 513 | 513 | function set_name( $name ) { |
| 514 | 514 | $this->set( 'TKT_name', $name ); |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | |
| 519 | 519 | /** |
| 520 | 520 | * Gets description |
| 521 | - * @return string |
|
| 521 | + * @return boolean |
|
| 522 | 522 | */ |
| 523 | 523 | function description() { |
| 524 | 524 | return $this->get( 'TKT_description' ); |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | /** |
| 530 | 530 | * Sets description |
| 531 | 531 | * @param string $description |
| 532 | - * @return boolean |
|
| 532 | + * @return boolean|null |
|
| 533 | 533 | */ |
| 534 | 534 | function set_description( $description ) { |
| 535 | 535 | $this->set( 'TKT_description', $description ); |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | /** |
| 600 | 600 | * Sets min |
| 601 | 601 | * @param int $min |
| 602 | - * @return boolean |
|
| 602 | + * @return boolean|null |
|
| 603 | 603 | */ |
| 604 | 604 | function set_min( $min ) { |
| 605 | 605 | $this->set( 'TKT_min', $min ); |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | |
| 610 | 610 | /** |
| 611 | 611 | * Gets max |
| 612 | - * @return int |
|
| 612 | + * @return boolean |
|
| 613 | 613 | */ |
| 614 | 614 | function max() { |
| 615 | 615 | return $this->get( 'TKT_max' ); |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | /** |
| 621 | 621 | * Sets max |
| 622 | 622 | * @param int $max |
| 623 | - * @return boolean |
|
| 623 | + * @return boolean|null |
|
| 624 | 624 | */ |
| 625 | 625 | function set_max( $max ) { |
| 626 | 626 | $this->set( 'TKT_max', $max ); |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | /** |
| 632 | 632 | * Sets price |
| 633 | 633 | * @param float $price |
| 634 | - * @return boolean |
|
| 634 | + * @return boolean|null |
|
| 635 | 635 | */ |
| 636 | 636 | function set_price( $price ) { |
| 637 | 637 | $this->set( 'TKT_price', $price ); |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | /** |
| 643 | 643 | * Gets sold |
| 644 | - * @return int |
|
| 644 | + * @return boolean |
|
| 645 | 645 | */ |
| 646 | 646 | function sold() { |
| 647 | 647 | return $this->get( 'TKT_sold' ); |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | /** |
| 653 | 653 | * increments sold by amount passed by $qty |
| 654 | 654 | * @param int $qty |
| 655 | - * @return boolean |
|
| 655 | + * @return boolean|null |
|
| 656 | 656 | */ |
| 657 | 657 | function increase_sold( $qty = 1 ) { |
| 658 | 658 | $sold = $this->get_raw( 'TKT_sold' ) + $qty; |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | /** |
| 665 | 665 | * Sets sold |
| 666 | 666 | * @param int $sold |
| 667 | - * @return boolean |
|
| 667 | + * @return boolean|null |
|
| 668 | 668 | */ |
| 669 | 669 | function set_sold( $sold ) { |
| 670 | 670 | $this->set( 'TKT_sold', $sold ); |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | /** |
| 676 | 676 | * decrements (subtracts) sold by amount passed by $qty |
| 677 | 677 | * @param int $qty |
| 678 | - * @return boolean |
|
| 678 | + * @return boolean|null |
|
| 679 | 679 | */ |
| 680 | 680 | function decrease_sold( $qty = 1 ) { |
| 681 | 681 | $sold = $this->get_raw( 'TKT_sold' ) - $qty; |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | |
| 689 | 689 | /** |
| 690 | 690 | * Gets qty |
| 691 | - * @return int |
|
| 691 | + * @return boolean |
|
| 692 | 692 | */ |
| 693 | 693 | function qty() { |
| 694 | 694 | return $this->get( 'TKT_qty' ); |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | /** |
| 700 | 700 | * Sets qty |
| 701 | 701 | * @param int $qty |
| 702 | - * @return boolean |
|
| 702 | + * @return boolean|null |
|
| 703 | 703 | */ |
| 704 | 704 | function set_qty( $qty ) { |
| 705 | 705 | $this->set( 'TKT_qty', $qty ); |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | |
| 710 | 710 | /** |
| 711 | 711 | * Gets uses |
| 712 | - * @return int |
|
| 712 | + * @return boolean |
|
| 713 | 713 | */ |
| 714 | 714 | function uses() { |
| 715 | 715 | return $this->get( 'TKT_uses' ); |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | /** |
| 721 | 721 | * Sets uses |
| 722 | 722 | * @param int $uses |
| 723 | - * @return boolean |
|
| 723 | + * @return boolean|null |
|
| 724 | 724 | */ |
| 725 | 725 | function set_uses( $uses ) { |
| 726 | 726 | $this->set( 'TKT_uses', $uses ); |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | /** |
| 742 | 742 | * sets the TKT_required property |
| 743 | 743 | * @param boolean $required |
| 744 | - * @return boolean |
|
| 744 | + * @return boolean|null |
|
| 745 | 745 | */ |
| 746 | 746 | public function set_required( $required ) { |
| 747 | 747 | $this->set( 'TKT_required', $required ); |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | /** |
| 763 | 763 | * Sets taxable |
| 764 | 764 | * @param boolean $taxable |
| 765 | - * @return boolean |
|
| 765 | + * @return boolean|null |
|
| 766 | 766 | */ |
| 767 | 767 | function set_taxable( $taxable ) { |
| 768 | 768 | $this->set( 'TKT_taxable', $taxable ); |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | /** |
| 784 | 784 | * Sets is_default |
| 785 | 785 | * @param boolean $is_default |
| 786 | - * @return boolean |
|
| 786 | + * @return boolean|null |
|
| 787 | 787 | */ |
| 788 | 788 | function set_is_default( $is_default ) { |
| 789 | 789 | $this->set( 'TKT_is_default', $is_default ); |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | |
| 794 | 794 | /** |
| 795 | 795 | * Gets order |
| 796 | - * @return int |
|
| 796 | + * @return boolean |
|
| 797 | 797 | */ |
| 798 | 798 | function order() { |
| 799 | 799 | return $this->get( 'TKT_order' ); |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | /** |
| 805 | 805 | * Sets order |
| 806 | 806 | * @param int $order |
| 807 | - * @return boolean |
|
| 807 | + * @return boolean|null |
|
| 808 | 808 | */ |
| 809 | 809 | function set_order( $order ) { |
| 810 | 810 | $this->set( 'TKT_order', $order ); |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | |
| 815 | 815 | /** |
| 816 | 816 | * Gets row |
| 817 | - * @return int |
|
| 817 | + * @return boolean |
|
| 818 | 818 | */ |
| 819 | 819 | function row() { |
| 820 | 820 | return $this->get( 'TKT_row' ); |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | /** |
| 826 | 826 | * Sets row |
| 827 | 827 | * @param int $row |
| 828 | - * @return boolean |
|
| 828 | + * @return boolean|null |
|
| 829 | 829 | */ |
| 830 | 830 | function set_row( $row ) { |
| 831 | 831 | $this->set( 'TKT_row', $row ); |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | /** |
| 847 | 847 | * Sets deleted |
| 848 | 848 | * @param boolean $deleted |
| 849 | - * @return boolean |
|
| 849 | + * @return boolean|null |
|
| 850 | 850 | */ |
| 851 | 851 | function set_deleted( $deleted ) { |
| 852 | 852 | $this->set( 'TKT_deleted', $deleted ); |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | |
| 857 | 857 | /** |
| 858 | 858 | * Gets parent |
| 859 | - * @return int |
|
| 859 | + * @return boolean |
|
| 860 | 860 | */ |
| 861 | 861 | function parent_ID() { |
| 862 | 862 | return $this->get( 'TKT_parent' ); |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | /** |
| 868 | 868 | * Sets parent |
| 869 | 869 | * @param int $parent |
| 870 | - * @return boolean |
|
| 870 | + * @return boolean|null |
|
| 871 | 871 | */ |
| 872 | 872 | function set_parent_ID( $parent ) { |
| 873 | 873 | $this->set( 'TKT_parent', $parent ); |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | |
| 892 | 892 | /** |
| 893 | 893 | * Gets name |
| 894 | - * @return string |
|
| 894 | + * @return boolean |
|
| 895 | 895 | */ |
| 896 | 896 | function name() { |
| 897 | 897 | return $this->get( 'TKT_name' ); |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | |
| 902 | 902 | /** |
| 903 | 903 | * Gets price |
| 904 | - * @return float |
|
| 904 | + * @return boolean |
|
| 905 | 905 | */ |
| 906 | 906 | function price() { |
| 907 | 907 | return $this->get( 'TKT_price' ); |
@@ -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 |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | * @param string $timezone |
| 64 | 64 | * @return EE_Ticket |
| 65 | 65 | */ |
| 66 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
| 67 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
| 68 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
| 66 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
| 67 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
| 68 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | * @param string $timezone |
| 77 | 77 | * @return EE_Ticket |
| 78 | 78 | */ |
| 79 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
| 80 | - return new self( $props_n_values, TRUE, $timezone ); |
|
| 79 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
| 80 | + return new self($props_n_values, TRUE, $timezone); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @return bool |
| 87 | 87 | */ |
| 88 | 88 | public function parent() { |
| 89 | - return $this->get( 'TKT_parent' ); |
|
| 89 | + return $this->get('TKT_parent'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
@@ -96,18 +96,18 @@ discard block |
||
| 96 | 96 | * @param int $DTT_ID the primary key for a particular datetime |
| 97 | 97 | * @return boolean |
| 98 | 98 | */ |
| 99 | - public function available( $DTT_ID = 0 ) { |
|
| 99 | + public function available($DTT_ID = 0) { |
|
| 100 | 100 | // are we checking availability for a particular datetime ? |
| 101 | - if ( $DTT_ID ) { |
|
| 101 | + if ($DTT_ID) { |
|
| 102 | 102 | // get that datetime object |
| 103 | - $datetime = $this->get_first_related( 'Datetime', array( array( 'DTT_ID' => $DTT_ID ) ) ); |
|
| 103 | + $datetime = $this->get_first_related('Datetime', array(array('DTT_ID' => $DTT_ID))); |
|
| 104 | 104 | // if ticket sales for this datetime have exceeded the reg limit... |
| 105 | - if ( $datetime instanceof EE_Datetime && $datetime->sold_out() ) { |
|
| 105 | + if ($datetime instanceof EE_Datetime && $datetime->sold_out()) { |
|
| 106 | 106 | return FALSE; |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | // datetime is still open for registration, but is this ticket sold out ? |
| 110 | - return $this->get_raw( 'TKT_qty' ) < 1 || $this->get_raw( 'TKT_qty' ) > $this->get_raw( 'TKT_sold' ) ? TRUE : FALSE; |
|
| 110 | + return $this->get_raw('TKT_qty') < 1 || $this->get_raw('TKT_qty') > $this->get_raw('TKT_sold') ? TRUE : FALSE; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
@@ -117,21 +117,21 @@ discard block |
||
| 117 | 117 | * @param bool $display true = we'll return a localized string, otherwise we just return the value of the relevant status const |
| 118 | 118 | * @return mixed(int|string) status int if the display string isn't requested |
| 119 | 119 | */ |
| 120 | - public function ticket_status( $display = FALSE ) { |
|
| 121 | - if ( ! $this->is_remaining() ) { |
|
| 122 | - return $display ? EEH_Template::pretty_status( EE_Ticket::sold_out, FALSE, 'sentence' ) : EE_Ticket::sold_out; |
|
| 120 | + public function ticket_status($display = FALSE) { |
|
| 121 | + if ( ! $this->is_remaining()) { |
|
| 122 | + return $display ? EEH_Template::pretty_status(EE_Ticket::sold_out, FALSE, 'sentence') : EE_Ticket::sold_out; |
|
| 123 | 123 | } |
| 124 | - if ( $this->get( 'TKT_deleted' ) ) { |
|
| 125 | - return $display ? EEH_Template::pretty_status( EE_Ticket::archived, FALSE, 'sentence' ) : EE_Ticket::archived; |
|
| 124 | + if ($this->get('TKT_deleted')) { |
|
| 125 | + return $display ? EEH_Template::pretty_status(EE_Ticket::archived, FALSE, 'sentence') : EE_Ticket::archived; |
|
| 126 | 126 | } |
| 127 | - if ( $this->is_expired() ) { |
|
| 128 | - return $display ? EEH_Template::pretty_status( EE_Ticket::expired, FALSE, 'sentence' ) : EE_Ticket::expired; |
|
| 127 | + if ($this->is_expired()) { |
|
| 128 | + return $display ? EEH_Template::pretty_status(EE_Ticket::expired, FALSE, 'sentence') : EE_Ticket::expired; |
|
| 129 | 129 | } |
| 130 | - if ( $this->is_pending() ) { |
|
| 131 | - return $display ? EEH_Template::pretty_status( EE_Ticket::pending, FALSE, 'sentence' ) : EE_Ticket::pending; |
|
| 130 | + if ($this->is_pending()) { |
|
| 131 | + return $display ? EEH_Template::pretty_status(EE_Ticket::pending, FALSE, 'sentence') : EE_Ticket::pending; |
|
| 132 | 132 | } |
| 133 | - if ( $this->is_on_sale() ) { |
|
| 134 | - return $display ? EEH_Template::pretty_status( EE_Ticket::onsale, FALSE, 'sentence' ) : EE_Ticket::onsale; |
|
| 133 | + if ($this->is_on_sale()) { |
|
| 134 | + return $display ? EEH_Template::pretty_status(EE_Ticket::onsale, FALSE, 'sentence') : EE_Ticket::onsale; |
|
| 135 | 135 | } |
| 136 | 136 | return ''; |
| 137 | 137 | } |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | * @param int $DTT_ID if an int above 0 is included here then we get a specific dtt. |
| 146 | 146 | * @return boolean true = tickets remaining, false not. |
| 147 | 147 | */ |
| 148 | - public function is_remaining( $DTT_ID = 0 ) { |
|
| 149 | - $num_remaining = $this->remaining( $DTT_ID ); |
|
| 150 | - if ( $num_remaining === 0 ) { |
|
| 148 | + public function is_remaining($DTT_ID = 0) { |
|
| 149 | + $num_remaining = $this->remaining($DTT_ID); |
|
| 150 | + if ($num_remaining === 0) { |
|
| 151 | 151 | return FALSE; |
| 152 | 152 | } |
| 153 | - if ( $num_remaining > 0 && $num_remaining < $this->min() ) { |
|
| 153 | + if ($num_remaining > 0 && $num_remaining < $this->min()) { |
|
| 154 | 154 | return FALSE; |
| 155 | 155 | } |
| 156 | 156 | return TRUE; |
@@ -164,25 +164,25 @@ discard block |
||
| 164 | 164 | * all related datetimes |
| 165 | 165 | * @return int |
| 166 | 166 | */ |
| 167 | - public function remaining( $DTT_ID = 0 ) { |
|
| 167 | + public function remaining($DTT_ID = 0) { |
|
| 168 | 168 | // are we checking availability for a particular datetime ? |
| 169 | - if ( $DTT_ID ) { |
|
| 169 | + if ($DTT_ID) { |
|
| 170 | 170 | // get array with the one requested datetime |
| 171 | - $datetimes = $this->get_many_related( 'Datetime', array( array( 'DTT_ID' => $DTT_ID ) ) ); |
|
| 171 | + $datetimes = $this->get_many_related('Datetime', array(array('DTT_ID' => $DTT_ID))); |
|
| 172 | 172 | } else { |
| 173 | 173 | // we need to check availability of ALL datetimes |
| 174 | - $datetimes = $this->get_many_related( 'Datetime', array( 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) ) ); |
|
| 174 | + $datetimes = $this->get_many_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))); |
|
| 175 | 175 | } |
| 176 | 176 | // d( $datetimes ); |
| 177 | 177 | // if datetime reg limit is not unlimited |
| 178 | - if ( ! empty( $datetimes ) ) { |
|
| 178 | + if ( ! empty($datetimes)) { |
|
| 179 | 179 | // although TKT_qty and $datetime->spaces_remaining() could both be INF |
| 180 | 180 | //we only need to check for INF explicitly if we want to optimize. |
| 181 | 181 | //because INF - x = INF; and min(x,INF) = x( |
| 182 | - $tickets_remaining = $this->get( 'TKT_qty' ) - $this->get( 'TKT_sold' ); |
|
| 183 | - foreach ( $datetimes as $datetime ) { |
|
| 184 | - if ( $datetime instanceof EE_Datetime ) { |
|
| 185 | - $tickets_remaining = min( $tickets_remaining, $datetime->spaces_remaining() ); |
|
| 182 | + $tickets_remaining = $this->get('TKT_qty') - $this->get('TKT_sold'); |
|
| 183 | + foreach ($datetimes as $datetime) { |
|
| 184 | + if ($datetime instanceof EE_Datetime) { |
|
| 185 | + $tickets_remaining = min($tickets_remaining, $datetime->spaces_remaining()); |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | return $tickets_remaining; |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * @return int |
| 198 | 198 | */ |
| 199 | 199 | function min() { |
| 200 | - return $this->get( 'TKT_min' ); |
|
| 200 | + return $this->get('TKT_min'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @return boolean |
| 208 | 208 | */ |
| 209 | 209 | public function is_expired() { |
| 210 | - return ( $this->get_raw( 'TKT_end_date' ) < time() ); |
|
| 210 | + return ($this->get_raw('TKT_end_date') < time()); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * @return boolean |
| 218 | 218 | */ |
| 219 | 219 | public function is_pending() { |
| 220 | - return ( $this->get_raw( 'TKT_start_date' ) > time() ); |
|
| 220 | + return ($this->get_raw('TKT_start_date') > time()); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | * @return boolean |
| 228 | 228 | */ |
| 229 | 229 | public function is_on_sale() { |
| 230 | - return ( $this->get_raw( 'TKT_start_date' ) < time() && $this->get_raw( 'TKT_end_date' ) > time() ); |
|
| 230 | + return ($this->get_raw('TKT_start_date') < time() && $this->get_raw('TKT_end_date') > time()); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | * @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 |
| 239 | 239 | * @return array |
| 240 | 240 | */ |
| 241 | - public function date_range( $dt_frmt = '', $conjunction = ' - ' ) { |
|
| 242 | - return $this->first_datetime()->start_date( $dt_frmt ) . $conjunction . $this->last_datetime()->end_date( $dt_frmt ); |
|
| 241 | + public function date_range($dt_frmt = '', $conjunction = ' - ') { |
|
| 242 | + return $this->first_datetime()->start_date($dt_frmt).$conjunction.$this->last_datetime()->end_date($dt_frmt); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
@@ -249,8 +249,8 @@ discard block |
||
| 249 | 249 | * @return EE_Datetime |
| 250 | 250 | */ |
| 251 | 251 | public function first_datetime() { |
| 252 | - $datetimes = $this->datetimes( array( 'limit' => 1 ) ); |
|
| 253 | - return reset( $datetimes ); |
|
| 252 | + $datetimes = $this->datetimes(array('limit' => 1)); |
|
| 253 | + return reset($datetimes); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
@@ -261,11 +261,11 @@ discard block |
||
| 261 | 261 | * @param array $query_params see EEM_Base::get_all() |
| 262 | 262 | * @return EE_Datetime[] |
| 263 | 263 | */ |
| 264 | - public function datetimes( $query_params = array() ) { |
|
| 265 | - if ( ! isset( $query_params[ 'order_by' ] ) ) { |
|
| 266 | - $query_params[ 'order_by' ][ 'DTT_order' ] = 'ASC'; |
|
| 264 | + public function datetimes($query_params = array()) { |
|
| 265 | + if ( ! isset($query_params['order_by'])) { |
|
| 266 | + $query_params['order_by']['DTT_order'] = 'ASC'; |
|
| 267 | 267 | } |
| 268 | - return $this->get_many_related( 'Datetime', $query_params ); |
|
| 268 | + return $this->get_many_related('Datetime', $query_params); |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | |
@@ -275,8 +275,8 @@ discard block |
||
| 275 | 275 | * @return EE_Datetime |
| 276 | 276 | */ |
| 277 | 277 | public function last_datetime() { |
| 278 | - $datetimes = $this->datetimes( array( 'limit' => 1, 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) ) ); |
|
| 279 | - return end( $datetimes ); |
|
| 278 | + $datetimes = $this->datetimes(array('limit' => 1, 'order_by' => array('DTT_EVT_start' => 'DESC'))); |
|
| 279 | + return end($datetimes); |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
@@ -290,22 +290,22 @@ discard block |
||
| 290 | 290 | * @param int $dtt_id [optional] include the dtt_id with $what = 'datetime'. |
| 291 | 291 | * @return mixed (array|int) how many tickets have sold |
| 292 | 292 | */ |
| 293 | - public function tickets_sold( $what = 'ticket', $dtt_id = NULL ) { |
|
| 293 | + public function tickets_sold($what = 'ticket', $dtt_id = NULL) { |
|
| 294 | 294 | $total = 0; |
| 295 | 295 | $tickets_sold = $this->_all_tickets_sold(); |
| 296 | - switch ( $what ) { |
|
| 296 | + switch ($what) { |
|
| 297 | 297 | case 'ticket' : |
| 298 | - return $tickets_sold[ 'ticket' ]; |
|
| 298 | + return $tickets_sold['ticket']; |
|
| 299 | 299 | break; |
| 300 | 300 | case 'datetime' : |
| 301 | - if ( empty( $tickets_sold[ 'datetime' ] ) ) { |
|
| 301 | + if (empty($tickets_sold['datetime'])) { |
|
| 302 | 302 | return $total; |
| 303 | 303 | } |
| 304 | - if ( ! empty( $dtt_id ) && ! isset( $tickets_sold[ 'datetime' ][ $dtt_id ] ) ) { |
|
| 305 | - EE_Error::add_error( __( "You've requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included. Are you SURE that is a datetime related to this ticket?", "event_espresso" ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 304 | + if ( ! empty($dtt_id) && ! isset($tickets_sold['datetime'][$dtt_id])) { |
|
| 305 | + EE_Error::add_error(__("You've requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included. Are you SURE that is a datetime related to this ticket?", "event_espresso"), __FILE__, __FUNCTION__, __LINE__); |
|
| 306 | 306 | return $total; |
| 307 | 307 | } |
| 308 | - return empty( $dtt_id ) ? $tickets_sold[ 'datetime' ] : $tickets_sold[ 'datetime' ][ $dtt_id ]; |
|
| 308 | + return empty($dtt_id) ? $tickets_sold['datetime'] : $tickets_sold['datetime'][$dtt_id]; |
|
| 309 | 309 | break; |
| 310 | 310 | default: |
| 311 | 311 | return $total; |
@@ -319,15 +319,15 @@ discard block |
||
| 319 | 319 | * @return EE_Ticket[] |
| 320 | 320 | */ |
| 321 | 321 | protected function _all_tickets_sold() { |
| 322 | - $datetimes = $this->get_many_related( 'Datetime' ); |
|
| 322 | + $datetimes = $this->get_many_related('Datetime'); |
|
| 323 | 323 | $tickets_sold = array(); |
| 324 | - if ( ! empty( $datetimes ) ) { |
|
| 325 | - foreach ( $datetimes as $datetime ) { |
|
| 326 | - $tickets_sold[ 'datetime' ][ $datetime->ID() ] = $datetime->get( 'DTT_sold' ); |
|
| 324 | + if ( ! empty($datetimes)) { |
|
| 325 | + foreach ($datetimes as $datetime) { |
|
| 326 | + $tickets_sold['datetime'][$datetime->ID()] = $datetime->get('DTT_sold'); |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | //Tickets sold |
| 330 | - $tickets_sold[ 'ticket' ] = $this->get_raw( 'TKT_sold' ); |
|
| 330 | + $tickets_sold['ticket'] = $this->get_raw('TKT_sold'); |
|
| 331 | 331 | return $tickets_sold; |
| 332 | 332 | } |
| 333 | 333 | |
@@ -340,9 +340,9 @@ discard block |
||
| 340 | 340 | * @param bool $return_array whether to return as an array indexed by price id or just the object. |
| 341 | 341 | * @return EE_Price |
| 342 | 342 | */ |
| 343 | - public function base_price( $return_array = FALSE ) { |
|
| 344 | - $_where = array( 'Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price ); |
|
| 345 | - return $return_array ? $this->get_many_related( 'Price', array( $_where ) ) : $this->get_first_related( 'Price', array( $_where ) ); |
|
| 343 | + public function base_price($return_array = FALSE) { |
|
| 344 | + $_where = array('Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price); |
|
| 345 | + return $return_array ? $this->get_many_related('Price', array($_where)) : $this->get_first_related('Price', array($_where)); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
@@ -354,8 +354,8 @@ discard block |
||
| 354 | 354 | * @return EE_Price[] |
| 355 | 355 | */ |
| 356 | 356 | public function price_modifiers() { |
| 357 | - $query_params = array( 0 => array( 'Price_Type.PBT_ID' => array( 'NOT IN', array( EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax ) ) ) ); |
|
| 358 | - return $this->prices( $query_params ); |
|
| 357 | + $query_params = array(0 => array('Price_Type.PBT_ID' => array('NOT IN', array(EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax)))); |
|
| 358 | + return $this->prices($query_params); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
@@ -365,8 +365,8 @@ discard block |
||
| 365 | 365 | * @param array $query_params like EEM_Base::get_all |
| 366 | 366 | * @return EE_Price[] |
| 367 | 367 | */ |
| 368 | - public function prices( $query_params = array() ) { |
|
| 369 | - return $this->get_many_related( 'Price', $query_params ); |
|
| 368 | + public function prices($query_params = array()) { |
|
| 369 | + return $this->get_many_related('Price', $query_params); |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | * @param array $query_params see EEM_Base::get_all() |
| 377 | 377 | * @return EE_Datetime_Ticket |
| 378 | 378 | */ |
| 379 | - public function datetime_tickets( $query_params = array() ) { |
|
| 380 | - return $this->get_many_related( 'Datetime_Ticket', $query_params ); |
|
| 379 | + public function datetime_tickets($query_params = array()) { |
|
| 380 | + return $this->get_many_related('Datetime_Ticket', $query_params); |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
@@ -388,8 +388,8 @@ discard block |
||
| 388 | 388 | * @param boolean $show_deleted |
| 389 | 389 | * @return EE_Datetime[] |
| 390 | 390 | */ |
| 391 | - public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE ) { |
|
| 392 | - return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_ticket_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted ); |
|
| 391 | + public function datetimes_ordered($show_expired = TRUE, $show_deleted = FALSE) { |
|
| 392 | + return EEM_Datetime::instance($this->_timezone)->get_datetimes_for_ticket_ordered_by_DTT_order($this->ID(), $show_expired, $show_deleted); |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | * @return string |
| 400 | 400 | */ |
| 401 | 401 | function ID() { |
| 402 | - return $this->get( 'TKT_ID' ); |
|
| 402 | + return $this->get('TKT_ID'); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | * @return EE_Ticket_Template |
| 424 | 424 | */ |
| 425 | 425 | public function template() { |
| 426 | - return $this->get_first_related( 'Ticket_Template' ); |
|
| 426 | + return $this->get_first_related('Ticket_Template'); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | * @return EE_Price[] |
| 434 | 434 | */ |
| 435 | 435 | public function get_ticket_taxes_for_admin() { |
| 436 | - return EE_Taxes::get_taxes_for_admin( $this ); |
|
| 436 | + return EE_Taxes::get_taxes_for_admin($this); |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | * @return bool |
| 443 | 443 | */ |
| 444 | 444 | public function ticket_price() { |
| 445 | - return $this->get( 'TKT_price' ); |
|
| 445 | + return $this->get('TKT_price'); |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | * @return mixed |
| 452 | 452 | */ |
| 453 | 453 | public function pretty_price() { |
| 454 | - return $this->get_pretty( 'TKT_price' ); |
|
| 454 | + return $this->get_pretty('TKT_price'); |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | |
@@ -470,11 +470,11 @@ discard block |
||
| 470 | 470 | * @param bool $no_cache |
| 471 | 471 | * @return float |
| 472 | 472 | */ |
| 473 | - public function get_ticket_total_with_taxes( $no_cache = FALSE ) { |
|
| 474 | - if ( ! isset( $this->_ticket_total_with_taxes ) || $no_cache ) { |
|
| 473 | + public function get_ticket_total_with_taxes($no_cache = FALSE) { |
|
| 474 | + if ( ! isset($this->_ticket_total_with_taxes) || $no_cache) { |
|
| 475 | 475 | $this->_ticket_total_with_taxes = $this->get_ticket_subtotal() + $this->get_ticket_taxes_total_for_admin(); |
| 476 | 476 | } |
| 477 | - return (float)$this->_ticket_total_with_taxes; |
|
| 477 | + return (float) $this->_ticket_total_with_taxes; |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | * @return float |
| 484 | 484 | */ |
| 485 | 485 | public function get_ticket_subtotal() { |
| 486 | - return EE_Taxes::get_subtotal_for_admin( $this ); |
|
| 486 | + return EE_Taxes::get_subtotal_for_admin($this); |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | * @return float |
| 494 | 494 | */ |
| 495 | 495 | public function get_ticket_taxes_total_for_admin() { |
| 496 | - return EE_Taxes::get_total_taxes_for_admin( $this ); |
|
| 496 | + return EE_Taxes::get_total_taxes_for_admin($this); |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | |
@@ -503,8 +503,8 @@ discard block |
||
| 503 | 503 | * @param string $name |
| 504 | 504 | * @return boolean |
| 505 | 505 | */ |
| 506 | - function set_name( $name ) { |
|
| 507 | - $this->set( 'TKT_name', $name ); |
|
| 506 | + function set_name($name) { |
|
| 507 | + $this->set('TKT_name', $name); |
|
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | * @return string |
| 515 | 515 | */ |
| 516 | 516 | function description() { |
| 517 | - return $this->get( 'TKT_description' ); |
|
| 517 | + return $this->get('TKT_description'); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | |
@@ -524,8 +524,8 @@ discard block |
||
| 524 | 524 | * @param string $description |
| 525 | 525 | * @return boolean |
| 526 | 526 | */ |
| 527 | - function set_description( $description ) { |
|
| 528 | - $this->set( 'TKT_description', $description ); |
|
| 527 | + function set_description($description) { |
|
| 528 | + $this->set('TKT_description', $description); |
|
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
@@ -536,8 +536,8 @@ discard block |
||
| 536 | 536 | * @param string $tm_frmt |
| 537 | 537 | * @return string |
| 538 | 538 | */ |
| 539 | - function start_date( $dt_frmt = '', $tm_frmt = '' ) { |
|
| 540 | - return $this->_get_datetime( 'TKT_start_date', $dt_frmt, $tm_frmt ); |
|
| 539 | + function start_date($dt_frmt = '', $tm_frmt = '') { |
|
| 540 | + return $this->_get_datetime('TKT_start_date', $dt_frmt, $tm_frmt); |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | |
@@ -547,8 +547,8 @@ discard block |
||
| 547 | 547 | * @param string $start_date |
| 548 | 548 | * @return void |
| 549 | 549 | */ |
| 550 | - function set_start_date( $start_date ) { |
|
| 551 | - $this->_set_date_time( 'B', $start_date, 'TKT_start_date' ); |
|
| 550 | + function set_start_date($start_date) { |
|
| 551 | + $this->_set_date_time('B', $start_date, 'TKT_start_date'); |
|
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | |
@@ -559,8 +559,8 @@ discard block |
||
| 559 | 559 | * @param string $tm_frmt |
| 560 | 560 | * @return string |
| 561 | 561 | */ |
| 562 | - function end_date( $dt_frmt = '', $tm_frmt = '' ) { |
|
| 563 | - return $this->_get_datetime( 'TKT_end_date', $dt_frmt, $tm_frmt ); |
|
| 562 | + function end_date($dt_frmt = '', $tm_frmt = '') { |
|
| 563 | + return $this->_get_datetime('TKT_end_date', $dt_frmt, $tm_frmt); |
|
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | |
@@ -570,8 +570,8 @@ discard block |
||
| 570 | 570 | * @param string $end_date |
| 571 | 571 | * @return void |
| 572 | 572 | */ |
| 573 | - function set_end_date( $end_date ) { |
|
| 574 | - $this->_set_date_time( 'B', $end_date, 'TKT_end_date' ); |
|
| 573 | + function set_end_date($end_date) { |
|
| 574 | + $this->_set_date_time('B', $end_date, 'TKT_end_date'); |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | |
@@ -583,8 +583,8 @@ discard block |
||
| 583 | 583 | * |
| 584 | 584 | * @param string $time a string representation of the sell until time (ex 9am or 7:30pm) |
| 585 | 585 | */ |
| 586 | - function set_end_time( $time ) { |
|
| 587 | - $this->_set_time_for( $time, 'TKT_end_date' ); |
|
| 586 | + function set_end_time($time) { |
|
| 587 | + $this->_set_time_for($time, 'TKT_end_date'); |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | |
@@ -594,8 +594,8 @@ discard block |
||
| 594 | 594 | * @param int $min |
| 595 | 595 | * @return boolean |
| 596 | 596 | */ |
| 597 | - function set_min( $min ) { |
|
| 598 | - $this->set( 'TKT_min', $min ); |
|
| 597 | + function set_min($min) { |
|
| 598 | + $this->set('TKT_min', $min); |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | * @return int |
| 606 | 606 | */ |
| 607 | 607 | function max() { |
| 608 | - return $this->get( 'TKT_max' ); |
|
| 608 | + return $this->get('TKT_max'); |
|
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | |
@@ -615,8 +615,8 @@ discard block |
||
| 615 | 615 | * @param int $max |
| 616 | 616 | * @return boolean |
| 617 | 617 | */ |
| 618 | - function set_max( $max ) { |
|
| 619 | - $this->set( 'TKT_max', $max ); |
|
| 618 | + function set_max($max) { |
|
| 619 | + $this->set('TKT_max', $max); |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | |
@@ -626,8 +626,8 @@ discard block |
||
| 626 | 626 | * @param float $price |
| 627 | 627 | * @return boolean |
| 628 | 628 | */ |
| 629 | - function set_price( $price ) { |
|
| 630 | - $this->set( 'TKT_price', $price ); |
|
| 629 | + function set_price($price) { |
|
| 630 | + $this->set('TKT_price', $price); |
|
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | * @return int |
| 638 | 638 | */ |
| 639 | 639 | function sold() { |
| 640 | - return $this->get( 'TKT_sold' ); |
|
| 640 | + return $this->get('TKT_sold'); |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | |
@@ -647,9 +647,9 @@ discard block |
||
| 647 | 647 | * @param int $qty |
| 648 | 648 | * @return boolean |
| 649 | 649 | */ |
| 650 | - function increase_sold( $qty = 1 ) { |
|
| 651 | - $sold = $this->get_raw( 'TKT_sold' ) + $qty; |
|
| 652 | - return $this->set_sold( $sold ); |
|
| 650 | + function increase_sold($qty = 1) { |
|
| 651 | + $sold = $this->get_raw('TKT_sold') + $qty; |
|
| 652 | + return $this->set_sold($sold); |
|
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | |
@@ -659,8 +659,8 @@ discard block |
||
| 659 | 659 | * @param int $sold |
| 660 | 660 | * @return boolean |
| 661 | 661 | */ |
| 662 | - function set_sold( $sold ) { |
|
| 663 | - $this->set( 'TKT_sold', $sold ); |
|
| 662 | + function set_sold($sold) { |
|
| 663 | + $this->set('TKT_sold', $sold); |
|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | 666 | |
@@ -670,11 +670,11 @@ discard block |
||
| 670 | 670 | * @param int $qty |
| 671 | 671 | * @return boolean |
| 672 | 672 | */ |
| 673 | - function decrease_sold( $qty = 1 ) { |
|
| 674 | - $sold = $this->get_raw( 'TKT_sold' ) - $qty; |
|
| 673 | + function decrease_sold($qty = 1) { |
|
| 674 | + $sold = $this->get_raw('TKT_sold') - $qty; |
|
| 675 | 675 | // sold can not go below zero |
| 676 | - $sold = max( 0, $sold ); |
|
| 677 | - return $this->set_sold( $sold ); |
|
| 676 | + $sold = max(0, $sold); |
|
| 677 | + return $this->set_sold($sold); |
|
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | * @return int |
| 685 | 685 | */ |
| 686 | 686 | function qty() { |
| 687 | - return $this->get( 'TKT_qty' ); |
|
| 687 | + return $this->get('TKT_qty'); |
|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | |
@@ -694,8 +694,8 @@ discard block |
||
| 694 | 694 | * @param int $qty |
| 695 | 695 | * @return boolean |
| 696 | 696 | */ |
| 697 | - function set_qty( $qty ) { |
|
| 698 | - $this->set( 'TKT_qty', $qty ); |
|
| 697 | + function set_qty($qty) { |
|
| 698 | + $this->set('TKT_qty', $qty); |
|
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | * @return int |
| 706 | 706 | */ |
| 707 | 707 | function uses() { |
| 708 | - return $this->get( 'TKT_uses' ); |
|
| 708 | + return $this->get('TKT_uses'); |
|
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | |
@@ -715,8 +715,8 @@ discard block |
||
| 715 | 715 | * @param int $uses |
| 716 | 716 | * @return boolean |
| 717 | 717 | */ |
| 718 | - function set_uses( $uses ) { |
|
| 719 | - $this->set( 'TKT_uses', $uses ); |
|
| 718 | + function set_uses($uses) { |
|
| 719 | + $this->set('TKT_uses', $uses); |
|
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | * @return boolean |
| 727 | 727 | */ |
| 728 | 728 | public function required() { |
| 729 | - return $this->get( 'TKT_required' ); |
|
| 729 | + return $this->get('TKT_required'); |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | |
@@ -736,8 +736,8 @@ discard block |
||
| 736 | 736 | * @param boolean $required |
| 737 | 737 | * @return boolean |
| 738 | 738 | */ |
| 739 | - public function set_required( $required ) { |
|
| 740 | - $this->set( 'TKT_required', $required ); |
|
| 739 | + public function set_required($required) { |
|
| 740 | + $this->set('TKT_required', $required); |
|
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | * @return boolean |
| 748 | 748 | */ |
| 749 | 749 | function taxable() { |
| 750 | - return $this->get( 'TKT_taxable' ); |
|
| 750 | + return $this->get('TKT_taxable'); |
|
| 751 | 751 | } |
| 752 | 752 | |
| 753 | 753 | |
@@ -757,8 +757,8 @@ discard block |
||
| 757 | 757 | * @param boolean $taxable |
| 758 | 758 | * @return boolean |
| 759 | 759 | */ |
| 760 | - function set_taxable( $taxable ) { |
|
| 761 | - $this->set( 'TKT_taxable', $taxable ); |
|
| 760 | + function set_taxable($taxable) { |
|
| 761 | + $this->set('TKT_taxable', $taxable); |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | * @return boolean |
| 769 | 769 | */ |
| 770 | 770 | function is_default() { |
| 771 | - return $this->get( 'TKT_is_default' ); |
|
| 771 | + return $this->get('TKT_is_default'); |
|
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | |
@@ -778,8 +778,8 @@ discard block |
||
| 778 | 778 | * @param boolean $is_default |
| 779 | 779 | * @return boolean |
| 780 | 780 | */ |
| 781 | - function set_is_default( $is_default ) { |
|
| 782 | - $this->set( 'TKT_is_default', $is_default ); |
|
| 781 | + function set_is_default($is_default) { |
|
| 782 | + $this->set('TKT_is_default', $is_default); |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | * @return int |
| 790 | 790 | */ |
| 791 | 791 | function order() { |
| 792 | - return $this->get( 'TKT_order' ); |
|
| 792 | + return $this->get('TKT_order'); |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | |
@@ -799,8 +799,8 @@ discard block |
||
| 799 | 799 | * @param int $order |
| 800 | 800 | * @return boolean |
| 801 | 801 | */ |
| 802 | - function set_order( $order ) { |
|
| 803 | - $this->set( 'TKT_order', $order ); |
|
| 802 | + function set_order($order) { |
|
| 803 | + $this->set('TKT_order', $order); |
|
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | * @return int |
| 811 | 811 | */ |
| 812 | 812 | function row() { |
| 813 | - return $this->get( 'TKT_row' ); |
|
| 813 | + return $this->get('TKT_row'); |
|
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | |
@@ -820,8 +820,8 @@ discard block |
||
| 820 | 820 | * @param int $row |
| 821 | 821 | * @return boolean |
| 822 | 822 | */ |
| 823 | - function set_row( $row ) { |
|
| 824 | - $this->set( 'TKT_row', $row ); |
|
| 823 | + function set_row($row) { |
|
| 824 | + $this->set('TKT_row', $row); |
|
| 825 | 825 | } |
| 826 | 826 | |
| 827 | 827 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | * @return boolean |
| 832 | 832 | */ |
| 833 | 833 | function deleted() { |
| 834 | - return $this->get( 'TKT_deleted' ); |
|
| 834 | + return $this->get('TKT_deleted'); |
|
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | |
@@ -841,8 +841,8 @@ discard block |
||
| 841 | 841 | * @param boolean $deleted |
| 842 | 842 | * @return boolean |
| 843 | 843 | */ |
| 844 | - function set_deleted( $deleted ) { |
|
| 845 | - $this->set( 'TKT_deleted', $deleted ); |
|
| 844 | + function set_deleted($deleted) { |
|
| 845 | + $this->set('TKT_deleted', $deleted); |
|
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | * @return int |
| 853 | 853 | */ |
| 854 | 854 | function parent_ID() { |
| 855 | - return $this->get( 'TKT_parent' ); |
|
| 855 | + return $this->get('TKT_parent'); |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | |
@@ -862,8 +862,8 @@ discard block |
||
| 862 | 862 | * @param int $parent |
| 863 | 863 | * @return boolean |
| 864 | 864 | */ |
| 865 | - function set_parent_ID( $parent ) { |
|
| 866 | - $this->set( 'TKT_parent', $parent ); |
|
| 865 | + function set_parent_ID($parent) { |
|
| 866 | + $this->set('TKT_parent', $parent); |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | |
@@ -874,10 +874,10 @@ discard block |
||
| 874 | 874 | */ |
| 875 | 875 | function name_and_info() { |
| 876 | 876 | $times = array(); |
| 877 | - foreach ( $this->datetimes() as $datetime ) { |
|
| 877 | + foreach ($this->datetimes() as $datetime) { |
|
| 878 | 878 | $times[] = $datetime->start_date_and_time(); |
| 879 | 879 | } |
| 880 | - return $this->name() . " @ " . implode( ", ", $times ) . " for " . $this->price(); |
|
| 880 | + return $this->name()." @ ".implode(", ", $times)." for ".$this->price(); |
|
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | * @return string |
| 888 | 888 | */ |
| 889 | 889 | function name() { |
| 890 | - return $this->get( 'TKT_name' ); |
|
| 890 | + return $this->get('TKT_name'); |
|
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | * @return float |
| 898 | 898 | */ |
| 899 | 899 | function price() { |
| 900 | - return $this->get( 'TKT_price' ); |
|
| 900 | + return $this->get('TKT_price'); |
|
| 901 | 901 | } |
| 902 | 902 | |
| 903 | 903 | |
@@ -907,8 +907,8 @@ discard block |
||
| 907 | 907 | * @param array $query_params like EEM_Base::get_all's |
| 908 | 908 | * @return EE_Registration[] |
| 909 | 909 | */ |
| 910 | - public function registrations( $query_params = array() ) { |
|
| 911 | - return $this->get_many_related( 'Registration', $query_params ); |
|
| 910 | + public function registrations($query_params = array()) { |
|
| 911 | + return $this->get_many_related('Registration', $query_params); |
|
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | |
@@ -919,8 +919,8 @@ discard block |
||
| 919 | 919 | * @return int |
| 920 | 920 | */ |
| 921 | 921 | public function update_tickets_sold() { |
| 922 | - $count_regs_for_this_ticket = $this->count_registrations( array( array( 'STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0 ) ) ); |
|
| 923 | - $this->set_sold( $count_regs_for_this_ticket ); |
|
| 922 | + $count_regs_for_this_ticket = $this->count_registrations(array(array('STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0))); |
|
| 923 | + $this->set_sold($count_regs_for_this_ticket); |
|
| 924 | 924 | $this->save(); |
| 925 | 925 | return $count_regs_for_this_ticket; |
| 926 | 926 | } |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | * @param array $query_params like EEM_Base::get_all's |
| 933 | 933 | * @return int |
| 934 | 934 | */ |
| 935 | - public function count_registrations( $query_params = array() ) { |
|
| 935 | + public function count_registrations($query_params = array()) { |
|
| 936 | 936 | return $this->count_related('Registration', $query_params); |
| 937 | 937 | } |
| 938 | 938 | } //end EE_Ticket class |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * Gets name |
| 56 | - * @return string |
|
| 56 | + * @return boolean |
|
| 57 | 57 | */ |
| 58 | 58 | function name() { |
| 59 | 59 | return $this->get( 'VNU_name' ); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Gets phone |
| 65 | - * @return string |
|
| 65 | + * @return boolean |
|
| 66 | 66 | */ |
| 67 | 67 | function phone() { |
| 68 | 68 | return $this->get( 'VNU_phone' ); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * venue_url |
| 75 | - * @return string |
|
| 75 | + * @return boolean |
|
| 76 | 76 | */ |
| 77 | 77 | function venue_url() { |
| 78 | 78 | return $this->get( 'VNU_url' ); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * Gets desc |
| 84 | - * @return string |
|
| 84 | + * @return boolean |
|
| 85 | 85 | */ |
| 86 | 86 | function description() { |
| 87 | 87 | return $this->get( 'VNU_desc' ); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * Gets short description (AKA: the excerpt) |
| 94 | - * @return string |
|
| 94 | + * @return boolean |
|
| 95 | 95 | */ |
| 96 | 96 | function excerpt() { |
| 97 | 97 | return $this->get( 'VNU_short_desc' ); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * Gets identifier |
| 104 | - * @return string |
|
| 104 | + * @return boolean |
|
| 105 | 105 | */ |
| 106 | 106 | function identifier() { |
| 107 | 107 | return $this->get( 'VNU_identifier' ); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | 113 | * Gets address |
| 114 | - * @return string |
|
| 114 | + * @return boolean |
|
| 115 | 115 | */ |
| 116 | 116 | function address() { |
| 117 | 117 | return $this->get( 'VNU_address' ); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Gets address2 |
| 124 | - * @return string |
|
| 124 | + * @return boolean |
|
| 125 | 125 | */ |
| 126 | 126 | function address2() { |
| 127 | 127 | return $this->get( 'VNU_address2' ); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | /** |
| 134 | 134 | * Gets city |
| 135 | - * @return string |
|
| 135 | + * @return boolean |
|
| 136 | 136 | */ |
| 137 | 137 | function city() { |
| 138 | 138 | return $this->get( 'VNU_city' ); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | 142 | * Gets state |
| 143 | - * @return int |
|
| 143 | + * @return boolean |
|
| 144 | 144 | */ |
| 145 | 145 | function state_ID() { |
| 146 | 146 | return $this->get( 'STA_ID' ); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | 196 | * country_ID |
| 197 | - * @return string |
|
| 197 | + * @return boolean |
|
| 198 | 198 | */ |
| 199 | 199 | function country_ID() { |
| 200 | 200 | return $this->get( 'CNT_ISO' ); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | /** |
| 241 | 241 | * Gets zip |
| 242 | - * @return string |
|
| 242 | + * @return boolean |
|
| 243 | 243 | */ |
| 244 | 244 | function zip() { |
| 245 | 245 | return $this->get( 'VNU_zip' ); |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | 261 | * Gets created |
| 262 | - * @return string |
|
| 262 | + * @return boolean |
|
| 263 | 263 | */ |
| 264 | 264 | function created() { |
| 265 | 265 | return $this->get( 'VNU_created' ); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * Gets modified |
| 272 | - * @return string |
|
| 272 | + * @return boolean |
|
| 273 | 273 | */ |
| 274 | 274 | function modified() { |
| 275 | 275 | return $this->get( 'VNU_modified' ); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | /** |
| 281 | 281 | * Gets order |
| 282 | - * @return int |
|
| 282 | + * @return boolean |
|
| 283 | 283 | */ |
| 284 | 284 | function order() { |
| 285 | 285 | return $this->get( 'VNU_order' ); |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | 291 | * Gets wp_user |
| 292 | - * @return int |
|
| 292 | + * @return boolean |
|
| 293 | 293 | */ |
| 294 | 294 | function wp_user() { |
| 295 | 295 | return $this->get( 'VNU_wp_user' ); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | |
| 300 | 300 | /** |
| 301 | - * @return string |
|
| 301 | + * @return boolean |
|
| 302 | 302 | */ |
| 303 | 303 | function virtual_phone() { |
| 304 | 304 | return $this->get( 'VNU_virtual_phone' ); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | |
| 309 | 309 | /** |
| 310 | - * @return string |
|
| 310 | + * @return boolean |
|
| 311 | 311 | */ |
| 312 | 312 | function virtual_url() { |
| 313 | 313 | return $this->get( 'VNU_virtual_url' ); |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | |
| 326 | 326 | |
| 327 | 327 | /** |
| 328 | - * @return string |
|
| 328 | + * @return boolean |
|
| 329 | 329 | */ |
| 330 | 330 | function google_map_link() { |
| 331 | 331 | return $this->get( 'VNU_google_map_link' ); |
@@ -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 |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | * @param array $props_n_values |
| 34 | 34 | * @return EE_Venue |
| 35 | 35 | */ |
| 36 | - public static function new_instance( $props_n_values = array() ) { |
|
| 37 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
| 38 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
| 36 | + public static function new_instance($props_n_values = array()) { |
|
| 37 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 38 | + return $has_object ? $has_object : new self($props_n_values); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | * @param array $props_n_values |
| 46 | 46 | * @return EE_Venue |
| 47 | 47 | */ |
| 48 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
| 49 | - return new self( $props_n_values, TRUE ); |
|
| 48 | + public static function new_instance_from_db($props_n_values = array()) { |
|
| 49 | + return new self($props_n_values, TRUE); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @return string |
| 57 | 57 | */ |
| 58 | 58 | function name() { |
| 59 | - return $this->get( 'VNU_name' ); |
|
| 59 | + return $this->get('VNU_name'); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * @return string |
| 66 | 66 | */ |
| 67 | 67 | function phone() { |
| 68 | - return $this->get( 'VNU_phone' ); |
|
| 68 | + return $this->get('VNU_phone'); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * @return string |
| 76 | 76 | */ |
| 77 | 77 | function venue_url() { |
| 78 | - return $this->get( 'VNU_url' ); |
|
| 78 | + return $this->get('VNU_url'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @return string |
| 85 | 85 | */ |
| 86 | 86 | function description() { |
| 87 | - return $this->get( 'VNU_desc' ); |
|
| 87 | + return $this->get('VNU_desc'); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @return string |
| 95 | 95 | */ |
| 96 | 96 | function excerpt() { |
| 97 | - return $this->get( 'VNU_short_desc' ); |
|
| 97 | + return $this->get('VNU_short_desc'); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @return string |
| 105 | 105 | */ |
| 106 | 106 | function identifier() { |
| 107 | - return $this->get( 'VNU_identifier' ); |
|
| 107 | + return $this->get('VNU_identifier'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @return string |
| 115 | 115 | */ |
| 116 | 116 | function address() { |
| 117 | - return $this->get( 'VNU_address' ); |
|
| 117 | + return $this->get('VNU_address'); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @return string |
| 125 | 125 | */ |
| 126 | 126 | function address2() { |
| 127 | - return $this->get( 'VNU_address2' ); |
|
| 127 | + return $this->get('VNU_address2'); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * @return string |
| 136 | 136 | */ |
| 137 | 137 | function city() { |
| 138 | - return $this->get( 'VNU_city' ); |
|
| 138 | + return $this->get('VNU_city'); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @return int |
| 144 | 144 | */ |
| 145 | 145 | function state_ID() { |
| 146 | - return $this->get( 'STA_ID' ); |
|
| 146 | + return $this->get('STA_ID'); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * @return string |
| 153 | 153 | */ |
| 154 | 154 | public function state_abbrev() { |
| 155 | - return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __( 'Unknown', 'event_espresso' ); |
|
| 155 | + return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __('Unknown', 'event_espresso'); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | * @return string |
| 162 | 162 | */ |
| 163 | 163 | public function state_name() { |
| 164 | - return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() : __( 'Unknown', 'event_espresso' ); |
|
| 164 | + return $this->state_obj() instanceof EE_State ? $this->state_obj()->name() : __('Unknown', 'event_espresso'); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @return EE_State |
| 172 | 172 | */ |
| 173 | 173 | function state_obj() { |
| 174 | - return $this->get_first_related( 'State' ); |
|
| 174 | + return $this->get_first_related('State'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * @return string |
| 184 | 184 | */ |
| 185 | 185 | public function state() { |
| 186 | - if ( apply_filters( 'FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj() ) ) { |
|
| 186 | + if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) { |
|
| 187 | 187 | return $this->state_abbrev(); |
| 188 | 188 | } else { |
| 189 | 189 | return $this->state_name(); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * @return string |
| 198 | 198 | */ |
| 199 | 199 | function country_ID() { |
| 200 | - return $this->get( 'CNT_ISO' ); |
|
| 200 | + return $this->get('CNT_ISO'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * @return string |
| 207 | 207 | */ |
| 208 | 208 | public function country_name() { |
| 209 | - return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() : __( 'Unknown', 'event_espresso' ); |
|
| 209 | + return $this->country_obj() instanceof EE_Country ? $this->country_obj()->name() : __('Unknown', 'event_espresso'); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | * @return EE_Country |
| 217 | 217 | */ |
| 218 | 218 | function country_obj() { |
| 219 | - return $this->get_first_related( 'Country' ); |
|
| 219 | + return $this->get_first_related('Country'); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | * @return string |
| 229 | 229 | */ |
| 230 | 230 | public function country() { |
| 231 | - if ( apply_filters( 'FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj() ) ) { |
|
| 231 | + if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) { |
|
| 232 | 232 | return $this->country_ID(); |
| 233 | 233 | } else { |
| 234 | 234 | return $this->country_name(); |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | * @return string |
| 243 | 243 | */ |
| 244 | 244 | function zip() { |
| 245 | - return $this->get( 'VNU_zip' ); |
|
| 245 | + return $this->get('VNU_zip'); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | * @return int |
| 253 | 253 | */ |
| 254 | 254 | function capacity() { |
| 255 | - return $this->get_pretty( 'VNU_capacity', 'symbol' ); |
|
| 255 | + return $this->get_pretty('VNU_capacity', 'symbol'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @return string |
| 263 | 263 | */ |
| 264 | 264 | function created() { |
| 265 | - return $this->get( 'VNU_created' ); |
|
| 265 | + return $this->get('VNU_created'); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | * @return string |
| 273 | 273 | */ |
| 274 | 274 | function modified() { |
| 275 | - return $this->get( 'VNU_modified' ); |
|
| 275 | + return $this->get('VNU_modified'); |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * @return int |
| 283 | 283 | */ |
| 284 | 284 | function order() { |
| 285 | - return $this->get( 'VNU_order' ); |
|
| 285 | + return $this->get('VNU_order'); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * @return int |
| 293 | 293 | */ |
| 294 | 294 | function wp_user() { |
| 295 | - return $this->get( 'VNU_wp_user' ); |
|
| 295 | + return $this->get('VNU_wp_user'); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | * @return string |
| 302 | 302 | */ |
| 303 | 303 | function virtual_phone() { |
| 304 | - return $this->get( 'VNU_virtual_phone' ); |
|
| 304 | + return $this->get('VNU_virtual_phone'); |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | * @return string |
| 311 | 311 | */ |
| 312 | 312 | function virtual_url() { |
| 313 | - return $this->get( 'VNU_virtual_url' ); |
|
| 313 | + return $this->get('VNU_virtual_url'); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | * @return bool |
| 320 | 320 | */ |
| 321 | 321 | function enable_for_gmap() { |
| 322 | - return $this->get( 'VNU_enable_for_gmap' ); |
|
| 322 | + return $this->get('VNU_enable_for_gmap'); |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | * @return string |
| 329 | 329 | */ |
| 330 | 330 | function google_map_link() { |
| 331 | - return $this->get( 'VNU_google_map_link' ); |
|
| 331 | + return $this->get('VNU_google_map_link'); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | |
@@ -340,16 +340,16 @@ discard block |
||
| 340 | 340 | * @param bool $upcoming |
| 341 | 341 | * @return EE_Event[] |
| 342 | 342 | */ |
| 343 | - function events( $query_params = array(), $upcoming = FALSE ) { |
|
| 344 | - if ( $upcoming ) { |
|
| 343 | + function events($query_params = array(), $upcoming = FALSE) { |
|
| 344 | + if ($upcoming) { |
|
| 345 | 345 | $query_params = array( |
| 346 | 346 | array( |
| 347 | 347 | 'status' => 'publish', |
| 348 | - 'Datetime.DTT_EVT_start' => array( '>', current_time( 'mysql' )) |
|
| 348 | + 'Datetime.DTT_EVT_start' => array('>', current_time('mysql')) |
|
| 349 | 349 | ) |
| 350 | 350 | ); |
| 351 | 351 | } |
| 352 | - return $this->get_many_related( 'Event', $query_params ); |
|
| 352 | + return $this->get_many_related('Event', $query_params); |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
@@ -367,8 +367,8 @@ discard block |
||
| 367 | 367 | /** |
| 368 | 368 | * Sets address |
| 369 | 369 | */ |
| 370 | - function set_address( $address = '' ) { |
|
| 371 | - $this->set( 'VNU_address', $address ); |
|
| 370 | + function set_address($address = '') { |
|
| 371 | + $this->set('VNU_address', $address); |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | /** |
| 377 | 377 | * @param string $address2 |
| 378 | 378 | */ |
| 379 | - function set_address2( $address2 = '' ) { |
|
| 380 | - $this->set( 'VNU_address2', $address2 ); |
|
| 379 | + function set_address2($address2 = '') { |
|
| 380 | + $this->set('VNU_address2', $address2); |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
@@ -385,8 +385,8 @@ discard block |
||
| 385 | 385 | /** |
| 386 | 386 | * @param string $city |
| 387 | 387 | */ |
| 388 | - function set_city( $city = '' ) { |
|
| 389 | - $this->set( 'VNU_city', $city ); |
|
| 388 | + function set_city($city = '') { |
|
| 389 | + $this->set('VNU_city', $city); |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
@@ -394,8 +394,8 @@ discard block |
||
| 394 | 394 | /** |
| 395 | 395 | * @param int $state |
| 396 | 396 | */ |
| 397 | - function set_state_ID( $state = 0 ) { |
|
| 398 | - $this->set( 'STA_ID', $state ); |
|
| 397 | + function set_state_ID($state = 0) { |
|
| 398 | + $this->set('STA_ID', $state); |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | |
@@ -406,8 +406,8 @@ discard block |
||
| 406 | 406 | * @param EE_State /int $state_id_or_obj |
| 407 | 407 | * @return EE_State |
| 408 | 408 | */ |
| 409 | - function set_state_obj( $state_id_or_obj ) { |
|
| 410 | - return $this->_add_relation_to( $state_id_or_obj, 'State' ); |
|
| 409 | + function set_state_obj($state_id_or_obj) { |
|
| 410 | + return $this->_add_relation_to($state_id_or_obj, 'State'); |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
@@ -415,8 +415,8 @@ discard block |
||
| 415 | 415 | /** |
| 416 | 416 | * @param int $country_ID |
| 417 | 417 | */ |
| 418 | - function set_country_ID( $country_ID = 0 ) { |
|
| 419 | - $this->set( 'CNT_ISO', $country_ID ); |
|
| 418 | + function set_country_ID($country_ID = 0) { |
|
| 419 | + $this->set('CNT_ISO', $country_ID); |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | * @param EE_Country /string $country_id_or_obj |
| 426 | 426 | * @return EE_Country |
| 427 | 427 | */ |
| 428 | - function set_country_obj( $country_id_or_obj ) { |
|
| 428 | + function set_country_obj($country_id_or_obj) { |
|
| 429 | 429 | return $this->_add_relation_to($country_id_or_obj, 'Country'); |
| 430 | 430 | } |
| 431 | 431 | |
@@ -434,8 +434,8 @@ discard block |
||
| 434 | 434 | /** |
| 435 | 435 | * @param string $zip |
| 436 | 436 | */ |
| 437 | - function set_zip( $zip = '' ) { |
|
| 438 | - $this->set( 'VNU_zip', $zip ); |
|
| 437 | + function set_zip($zip = '') { |
|
| 438 | + $this->set('VNU_zip', $zip); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | |
@@ -443,8 +443,8 @@ discard block |
||
| 443 | 443 | /** |
| 444 | 444 | * @param int $capacity |
| 445 | 445 | */ |
| 446 | - function set_capacity( $capacity = 0 ) { |
|
| 447 | - $this->set( 'VNU_capacity', $capacity ); |
|
| 446 | + function set_capacity($capacity = 0) { |
|
| 447 | + $this->set('VNU_capacity', $capacity); |
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | |
@@ -452,8 +452,8 @@ discard block |
||
| 452 | 452 | /** |
| 453 | 453 | * @param string $created |
| 454 | 454 | */ |
| 455 | - function set_created( $created = '' ) { |
|
| 456 | - $this->set( 'VNU_created', $created ); |
|
| 455 | + function set_created($created = '') { |
|
| 456 | + $this->set('VNU_created', $created); |
|
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | |
@@ -461,8 +461,8 @@ discard block |
||
| 461 | 461 | /** |
| 462 | 462 | * @param string $desc |
| 463 | 463 | */ |
| 464 | - function set_description( $desc = '' ) { |
|
| 465 | - $this->set( 'VNU_desc', $desc ); |
|
| 464 | + function set_description($desc = '') { |
|
| 465 | + $this->set('VNU_desc', $desc); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | /** |
| 471 | 471 | * @param string $identifier |
| 472 | 472 | */ |
| 473 | - function set_identifier( $identifier = '' ) { |
|
| 474 | - $this->set( 'VNU_identifier', $identifier ); |
|
| 473 | + function set_identifier($identifier = '') { |
|
| 474 | + $this->set('VNU_identifier', $identifier); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | |
@@ -479,8 +479,8 @@ discard block |
||
| 479 | 479 | /** |
| 480 | 480 | * @param string $modified |
| 481 | 481 | */ |
| 482 | - function set_modified( $modified = '' ) { |
|
| 483 | - $this->set( 'VNU_modified', $modified ); |
|
| 482 | + function set_modified($modified = '') { |
|
| 483 | + $this->set('VNU_modified', $modified); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | |
@@ -488,8 +488,8 @@ discard block |
||
| 488 | 488 | /** |
| 489 | 489 | * @param string $name |
| 490 | 490 | */ |
| 491 | - function set_name( $name = '' ) { |
|
| 492 | - $this->set( 'VNU_name', $name ); |
|
| 491 | + function set_name($name = '') { |
|
| 492 | + $this->set('VNU_name', $name); |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
@@ -497,8 +497,8 @@ discard block |
||
| 497 | 497 | /** |
| 498 | 498 | * @param int $order |
| 499 | 499 | */ |
| 500 | - function set_order( $order = 0 ) { |
|
| 501 | - $this->set( 'VNU_order', $order ); |
|
| 500 | + function set_order($order = 0) { |
|
| 501 | + $this->set('VNU_order', $order); |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | |
@@ -506,8 +506,8 @@ discard block |
||
| 506 | 506 | /** |
| 507 | 507 | * @param string $phone |
| 508 | 508 | */ |
| 509 | - function set_phone( $phone = '' ) { |
|
| 510 | - $this->set( 'VNU_phone', $phone ); |
|
| 509 | + function set_phone($phone = '') { |
|
| 510 | + $this->set('VNU_phone', $phone); |
|
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | |
@@ -515,8 +515,8 @@ discard block |
||
| 515 | 515 | /** |
| 516 | 516 | * @param int $wp_user |
| 517 | 517 | */ |
| 518 | - function set_wp_user( $wp_user = 1 ) { |
|
| 519 | - $this->set( 'VNU_wp_user', $wp_user ); |
|
| 518 | + function set_wp_user($wp_user = 1) { |
|
| 519 | + $this->set('VNU_wp_user', $wp_user); |
|
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | |
@@ -524,8 +524,8 @@ discard block |
||
| 524 | 524 | /** |
| 525 | 525 | * @param string $url |
| 526 | 526 | */ |
| 527 | - function set_venue_url( $url = '' ) { |
|
| 528 | - $this->set( 'VNU_url', $url ); |
|
| 527 | + function set_venue_url($url = '') { |
|
| 528 | + $this->set('VNU_url', $url); |
|
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
@@ -533,8 +533,8 @@ discard block |
||
| 533 | 533 | /** |
| 534 | 534 | * @param string $phone |
| 535 | 535 | */ |
| 536 | - function set_virtual_phone( $phone = '' ) { |
|
| 537 | - $this->set( 'VNU_virtual_phone', $phone ); |
|
| 536 | + function set_virtual_phone($phone = '') { |
|
| 537 | + $this->set('VNU_virtual_phone', $phone); |
|
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | |
@@ -542,8 +542,8 @@ discard block |
||
| 542 | 542 | /** |
| 543 | 543 | * @param string $url |
| 544 | 544 | */ |
| 545 | - function set_virtual_url( $url = '' ) { |
|
| 546 | - $this->set( 'VNU_virtual_url', $url ); |
|
| 545 | + function set_virtual_url($url = '') { |
|
| 546 | + $this->set('VNU_virtual_url', $url); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | |
@@ -551,8 +551,8 @@ discard block |
||
| 551 | 551 | /** |
| 552 | 552 | * @param string $enable |
| 553 | 553 | */ |
| 554 | - function set_enable_for_gmap( $enable = '' ) { |
|
| 555 | - $this->set( 'VNU_enable_for_gmap', $enable ); |
|
| 554 | + function set_enable_for_gmap($enable = '') { |
|
| 555 | + $this->set('VNU_enable_for_gmap', $enable); |
|
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | |
@@ -560,8 +560,8 @@ discard block |
||
| 560 | 560 | /** |
| 561 | 561 | * @param string $google_map_link |
| 562 | 562 | */ |
| 563 | - function set_google_map_link( $google_map_link = '' ) { |
|
| 564 | - $this->set( 'VNU_google_map_link', $google_map_link ); |
|
| 563 | + function set_google_map_link($google_map_link = '') { |
|
| 564 | + $this->set('VNU_google_map_link', $google_map_link); |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * instantiate a new price object with blank/empty properties |
| 83 | 83 | * |
| 84 | 84 | * @access public |
| 85 | - * @return mixed array on success, FALSE on fail |
|
| 85 | + * @return boolean array on success, FALSE on fail |
|
| 86 | 86 | */ |
| 87 | 87 | public function get_new_price() { |
| 88 | 88 | return $this->create_default_object(); |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | * retrieve all active prices for a particular event |
| 110 | 110 | * |
| 111 | 111 | * @access public |
| 112 | - * @return array on success |
|
| 113 | - * @return boolean false on fail |
|
| 112 | + * @return EE_Base_Class[] on success |
|
| 113 | + * @return EE_Base_Class[] false on fail |
|
| 114 | 114 | */ |
| 115 | 115 | public function get_all_event_prices( $EVT_ID ) { |
| 116 | 116 | return $this->get_all(array( |
@@ -184,8 +184,6 @@ discard block |
||
| 184 | 184 | * retrieve all prices for an ticket plus default global prices, but not taxes |
| 185 | 185 | * |
| 186 | 186 | * @access public |
| 187 | - * @param int $TKT the id of the event. If not included then we assume that this is a new ticket. |
|
| 188 | - * @return boolean false on fail |
|
| 189 | 187 | */ |
| 190 | 188 | public function get_all_ticket_prices_for_admin( $TKT_ID = FALSE ) { |
| 191 | 189 | $ticket_prices = array(); |
@@ -272,7 +270,7 @@ discard block |
||
| 272 | 270 | * |
| 273 | 271 | * @access public |
| 274 | 272 | * @param int $type - PRT_ID |
| 275 | - * @return boolean false on fail |
|
| 273 | + * @return EE_Base_Class[] false on fail |
|
| 276 | 274 | */ |
| 277 | 275 | public function get_all_prices_that_are_type($type = FALSE) { |
| 278 | 276 | return $this->get_all(array( |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * ------------------------------------------------------------------------ |
| 23 | 23 | */ |
| 24 | -require_once ( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' ); |
|
| 25 | -require_once ( EE_CLASSES . 'EE_Price.class.php' ); |
|
| 24 | +require_once (EE_MODELS.'EEM_Soft_Delete_Base.model.php'); |
|
| 25 | +require_once (EE_CLASSES.'EE_Price.class.php'); |
|
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | class EEM_Price extends EEM_Soft_Delete_Base { |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | * @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved). Note this just sends the timezone info to the date time model field objects. Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option) |
| 40 | 40 | * @return void |
| 41 | 41 | */ |
| 42 | - protected function __construct( $timezone ) { |
|
| 43 | - require_once( EE_MODELS . 'EEM_Price_Type.model.php'); |
|
| 44 | - $this->singular_item = __('Price','event_espresso'); |
|
| 45 | - $this->plural_item = __('Prices','event_espresso'); |
|
| 42 | + protected function __construct($timezone) { |
|
| 43 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
| 44 | + $this->singular_item = __('Price', 'event_espresso'); |
|
| 45 | + $this->plural_item = __('Prices', 'event_espresso'); |
|
| 46 | 46 | |
| 47 | 47 | $this->_tables = array( |
| 48 | - 'Price'=>new EE_Primary_Table('esp_price','PRC_ID') |
|
| 48 | + 'Price'=>new EE_Primary_Table('esp_price', 'PRC_ID') |
|
| 49 | 49 | ); |
| 50 | 50 | $this->_fields = array( |
| 51 | 51 | 'Price'=> array( |
| 52 | 52 | 'PRC_ID'=>new EE_Primary_Key_Int_Field('PRC_ID', 'Price ID'), |
| 53 | - 'PRT_ID'=>new EE_Foreign_Key_Int_Field('PRT_ID', 'Price type Id', false, NULL, 'Price_Type'), |
|
| 53 | + 'PRT_ID'=>new EE_Foreign_Key_Int_Field('PRT_ID', 'Price type Id', false, NULL, 'Price_Type'), |
|
| 54 | 54 | 'PRC_amount'=>new EE_Money_Field('PRC_amount', 'Price Amount', false, 0), |
| 55 | 55 | 'PRC_name'=>new EE_Plain_Text_Field('PRC_name', 'Name of Price', false, ''), |
| 56 | 56 | 'PRC_desc'=>new EE_Post_Content_Field('PRC_desc', 'Price Description', false, ''), |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | 'PRC_overrides'=>new EE_Integer_Field('PRC_overrides', 'Price ID for a global Price that will be overridden by this Price ( for replacing default prices )', true, 0), |
| 59 | 59 | 'PRC_order'=>new EE_Integer_Field('PRC_order', 'Order of Application of Price (lower numbers apply first?)', false, 1), |
| 60 | 60 | 'PRC_deleted'=>new EE_Trashed_Flag_Field('PRC_deleted', 'Flag Indicating if this has been deleted or not', false, false), |
| 61 | - 'PRC_parent' => new EE_Integer_Field('PRC_parent', __('Indicates what PRC_ID is the parent of this PRC_ID'), true, 0 ), |
|
| 62 | - 'PRC_wp_user' => new EE_WP_User_Field('PRC_wp_user', __('Price Creator ID', 'event_espresso'), FALSE ), |
|
| 61 | + 'PRC_parent' => new EE_Integer_Field('PRC_parent', __('Indicates what PRC_ID is the parent of this PRC_ID'), true, 0), |
|
| 62 | + 'PRC_wp_user' => new EE_WP_User_Field('PRC_wp_user', __('Price Creator ID', 'event_espresso'), FALSE), |
|
| 63 | 63 | ) |
| 64 | 64 | ); |
| 65 | 65 | $this->_model_relations = array( |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | 'Price_Type'=>new EE_Belongs_To_Relation(), |
| 68 | 68 | 'WP_User' => new EE_Belongs_To_Relation(), |
| 69 | 69 | ); |
| 70 | - parent::__construct( $timezone ); |
|
| 70 | + parent::__construct($timezone); |
|
| 71 | 71 | |
| 72 | - require_once ( EE_CLASSES . 'EE_Price.class.php' ); |
|
| 72 | + require_once (EE_CLASSES.'EE_Price.class.php'); |
|
| 73 | 73 | |
| 74 | 74 | } |
| 75 | 75 | |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | * @return array on success |
| 110 | 110 | * @return boolean false on fail |
| 111 | 111 | */ |
| 112 | - public function get_all_event_prices( $EVT_ID ) { |
|
| 112 | + public function get_all_event_prices($EVT_ID) { |
|
| 113 | 113 | return $this->get_all(array( |
| 114 | 114 | array( |
| 115 | 115 | 'EVT_ID'=>$EVT_ID, |
| 116 | - 'Price_Type.PBT_ID'=>array('!=', EEM_Price_Type::base_type_tax) |
|
| 116 | + 'Price_Type.PBT_ID'=>array('!=', EEM_Price_Type::base_type_tax) |
|
| 117 | 117 | ), |
| 118 | 118 | 'order_by'=>$this->_order_by_array_for_get_all_method() |
| 119 | 119 | )); |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | * @return array on success |
| 129 | 129 | * @return boolean false on fail |
| 130 | 130 | */ |
| 131 | - public function get_all_default_prices( $count = FALSE ) { |
|
| 131 | + public function get_all_default_prices($count = FALSE) { |
|
| 132 | 132 | $_where = array( |
| 133 | - 'Price_Type.PBT_ID'=>array('!=',4), |
|
| 133 | + 'Price_Type.PBT_ID'=>array('!=', 4), |
|
| 134 | 134 | 'PRC_deleted' => 0, |
| 135 | 135 | 'PRC_is_default' => 1 |
| 136 | 136 | ); |
@@ -161,14 +161,14 @@ discard block |
||
| 161 | 161 | public function get_all_prices_that_are_taxes() { |
| 162 | 162 | $taxes = array(); |
| 163 | 163 | $all_taxes = $this->get_all(array( |
| 164 | - array( 'Price_Type.PBT_ID'=> EEM_Price_Type::base_type_tax ), |
|
| 165 | - 'order_by' => array( 'Price_Type.PRT_order' => 'ASC', 'PRC_order' => 'ASC' ) |
|
| 164 | + array('Price_Type.PBT_ID'=> EEM_Price_Type::base_type_tax), |
|
| 165 | + 'order_by' => array('Price_Type.PRT_order' => 'ASC', 'PRC_order' => 'ASC') |
|
| 166 | 166 | )); |
| 167 | 167 | // $all_taxes = $this->_select_all_prices_where( |
| 168 | 168 | // array( 'prt.PBT_ID' => 4, 'prc.PRC_deleted' => FALSE ) |
| 169 | 169 | // ); |
| 170 | - foreach ( $all_taxes as $tax ) { |
|
| 171 | - $taxes[ $tax->order() ][ $tax->ID() ] = $tax; |
|
| 170 | + foreach ($all_taxes as $tax) { |
|
| 171 | + $taxes[$tax->order()][$tax->ID()] = $tax; |
|
| 172 | 172 | } |
| 173 | 173 | return $taxes; |
| 174 | 174 | } |
@@ -184,18 +184,18 @@ discard block |
||
| 184 | 184 | * @param int $TKT the id of the event. If not included then we assume that this is a new ticket. |
| 185 | 185 | * @return boolean false on fail |
| 186 | 186 | */ |
| 187 | - public function get_all_ticket_prices_for_admin( $TKT_ID = FALSE ) { |
|
| 187 | + public function get_all_ticket_prices_for_admin($TKT_ID = FALSE) { |
|
| 188 | 188 | $ticket_prices = array(); |
| 189 | - if ( empty($TKT_ID) ) { |
|
| 189 | + if (empty($TKT_ID)) { |
|
| 190 | 190 | |
| 191 | 191 | //if there is no tkt, get prices with no tkt ID, are global, are not a tax, and are active |
| 192 | 192 | //return that list |
| 193 | 193 | $ticket_prices = $this->get_all_default_prices(); |
| 194 | 194 | |
| 195 | - if ( $global_prices ) { |
|
| 195 | + if ($global_prices) { |
|
| 196 | 196 | $array_of_price_objects = array(); |
| 197 | 197 | foreach ($global_prices as $price) { |
| 198 | - $array_of_price_objects[ $price->type() ][] = $price; |
|
| 198 | + $array_of_price_objects[$price->type()][] = $price; |
|
| 199 | 199 | } |
| 200 | 200 | return $array_of_price_objects; |
| 201 | 201 | } else { |
@@ -213,9 +213,9 @@ discard block |
||
| 213 | 213 | )); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - if ( !empty( $ticket_prices ) ) { |
|
| 217 | - foreach ( $ticket_prices as $price ) { |
|
| 218 | - $array_of_price_objects[ $price->type() ][] = $price; |
|
| 216 | + if ( ! empty($ticket_prices)) { |
|
| 217 | + foreach ($ticket_prices as $price) { |
|
| 218 | + $array_of_price_objects[$price->type()][] = $price; |
|
| 219 | 219 | } |
| 220 | 220 | return $array_of_price_objects; |
| 221 | 221 | |
@@ -234,10 +234,10 @@ discard block |
||
| 234 | 234 | * @access private |
| 235 | 235 | * @return boolean false on fail |
| 236 | 236 | */ |
| 237 | - private function _sort_event_prices_by_type( $price_a, $price_b ) { |
|
| 237 | + private function _sort_event_prices_by_type($price_a, $price_b) { |
|
| 238 | 238 | $PRT = EEM_Price_Type::instance(); |
| 239 | - if ( $price_a->type_obj()->order() == $price_b->type_obj()->order() ) { |
|
| 240 | - return $this->_sort_event_prices_by_order( $price_a, $price_b ); |
|
| 239 | + if ($price_a->type_obj()->order() == $price_b->type_obj()->order()) { |
|
| 240 | + return $this->_sort_event_prices_by_order($price_a, $price_b); |
|
| 241 | 241 | } |
| 242 | 242 | return $price_a->type_obj()->order() < $price_b->type_obj()->order() ? -1 : 1; |
| 243 | 243 | } |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | * @return boolean false on fail |
| 254 | 254 | */ |
| 255 | 255 | private function _sort_event_prices_by_order($price_a, $price_b) { |
| 256 | - if ( $price_a->order() == $price_b->order() ) { |
|
| 257 | - return $this->_sort_event_prices_by_start_date( $price_a, $price_b ); |
|
| 256 | + if ($price_a->order() == $price_b->order()) { |
|
| 257 | + return $this->_sort_event_prices_by_start_date($price_a, $price_b); |
|
| 258 | 258 | } |
| 259 | 259 | return $price_a->order() < $price_b->order() ? -1 : 1; |
| 260 | 260 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * Of course you don't have to use it, but this is the order we usually want to sort prices by |
| 286 | 286 | * @return array which can be used like so: $this->get_all(array(array(...where stuff...),'order_by'=>$this->_order_by_array_for_get_all_method())); |
| 287 | 287 | */ |
| 288 | - public function _order_by_array_for_get_all_method(){ |
|
| 288 | + public function _order_by_array_for_get_all_method() { |
|
| 289 | 289 | return array( |
| 290 | 290 | 'PRC_order'=>'ASC', |
| 291 | 291 | 'Price_Type.PRT_order'=>'ASC', |
@@ -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 | * Event Espresso |
| 4 | 6 | * |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * @return mixed |
|
| 62 | + * @return string |
|
| 63 | 63 | */ |
| 64 | 64 | public function config_section() { |
| 65 | 65 | return $this->_config_section; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | - * @return mixed |
|
| 80 | + * @return string |
|
| 81 | 81 | */ |
| 82 | 82 | public function config_class() { |
| 83 | 83 | return $this->_config_class; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | - * @param mixed $config_name |
|
| 89 | + * @param string $config_name |
|
| 90 | 90 | */ |
| 91 | 91 | public function set_config_name( $config_name ) { |
| 92 | 92 | $this->_config_name = ! empty( $config_name ) ? $config_name : get_called_class(); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * @return mixed |
|
| 98 | + * @return string |
|
| 99 | 99 | */ |
| 100 | 100 | public function config_name() { |
| 101 | 101 | return $this->_config_name; |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * @param string $config_section |
| 54 | 54 | */ |
| 55 | - public function set_config_section( $config_section = '' ) { |
|
| 56 | - $this->_config_section = ! empty( $config_section ) ? $config_section : 'modules'; |
|
| 55 | + public function set_config_section($config_section = '') { |
|
| 56 | + $this->_config_section = ! empty($config_section) ? $config_section : 'modules'; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | /** |
| 71 | 71 | * @param string $config_class |
| 72 | 72 | */ |
| 73 | - public function set_config_class( $config_class = '' ) { |
|
| 73 | + public function set_config_class($config_class = '') { |
|
| 74 | 74 | $this->_config_class = $config_class; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * @param mixed $config_name |
| 90 | 90 | */ |
| 91 | - public function set_config_name( $config_name ) { |
|
| 92 | - $this->_config_name = ! empty( $config_name ) ? $config_name : get_called_class(); |
|
| 91 | + public function set_config_name($config_name) { |
|
| 92 | + $this->_config_name = ! empty($config_name) ? $config_name : get_called_class(); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @param EE_Config_Base $config_obj |
| 113 | 113 | * @return mixed EE_Config_Base | NULL |
| 114 | 114 | */ |
| 115 | - protected function _set_config( EE_Config_Base $config_obj = NULL ) { |
|
| 116 | - return EE_Config::instance()->set_config( $this->config_section(), $this->config_name(), $this->config_class(), $config_obj ); |
|
| 115 | + protected function _set_config(EE_Config_Base $config_obj = NULL) { |
|
| 116 | + return EE_Config::instance()->set_config($this->config_section(), $this->config_name(), $this->config_class(), $config_obj); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | * @param EE_Config_Base $config_obj |
| 127 | 127 | * @return mixed EE_Config_Base | NULL |
| 128 | 128 | */ |
| 129 | - protected function _update_config( EE_Config_Base $config_obj = NULL ) { |
|
| 130 | - $this->_config = EE_Config::instance()->update_config( $this->config_section(), $this->config_name(), $config_obj ); |
|
| 129 | + protected function _update_config(EE_Config_Base $config_obj = NULL) { |
|
| 130 | + $this->_config = EE_Config::instance()->update_config($this->config_section(), $this->config_name(), $config_obj); |
|
| 131 | 131 | return $this->_config; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | * @return EE_Config_Base |
| 140 | 140 | */ |
| 141 | 141 | public function config() { |
| 142 | - if ( empty( $this->_config )) { |
|
| 143 | - $this->_config = EE_Config::instance()->get_config( $this->config_section(), $this->config_name(), $this->config_class() ); |
|
| 142 | + if (empty($this->_config)) { |
|
| 143 | + $this->_config = EE_Config::instance()->get_config($this->config_section(), $this->config_name(), $this->config_class()); |
|
| 144 | 144 | } |
| 145 | 145 | return $this->_config; |
| 146 | 146 | } |
@@ -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 | * Event Espresso |
| 4 | 6 | * |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @access public |
| 118 | 118 | * @param int $EVT_ID |
| 119 | - * @return string |
|
| 119 | + * @return boolean |
|
| 120 | 120 | */ |
| 121 | 121 | public static function event_has_content_or_excerpt( $EVT_ID = 0 ) { |
| 122 | 122 | $event = EEH_Event_View::get_event( $EVT_ID ); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * event_active_status |
| 137 | 137 | * |
| 138 | 138 | * @access public |
| 139 | - * @param null $num_words |
|
| 139 | + * @param integer $num_words |
|
| 140 | 140 | * @param null $more |
| 141 | 141 | * @return string |
| 142 | 142 | */ |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * |
| 319 | 319 | * @access public |
| 320 | 320 | * @param int $EVT_ID |
| 321 | - * @return string |
|
| 321 | + * @return string|null |
|
| 322 | 322 | */ |
| 323 | 323 | public static function get_primary_date_obj( $EVT_ID = 0 ) { |
| 324 | 324 | $event = EEH_Event_View::get_event( $EVT_ID ); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | * |
| 344 | 344 | * @access public |
| 345 | 345 | * @param int $EVT_ID |
| 346 | - * @return string |
|
| 346 | + * @return boolean|string |
|
| 347 | 347 | */ |
| 348 | 348 | public static function get_last_date_obj( $EVT_ID = 0 ) { |
| 349 | 349 | $event = EEH_Event_View::get_event( $EVT_ID ); |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | * |
| 369 | 369 | * @access public |
| 370 | 370 | * @param int $EVT_ID |
| 371 | - * @return string |
|
| 371 | + * @return string|null |
|
| 372 | 372 | */ |
| 373 | 373 | public static function get_earliest_date_obj( $EVT_ID = 0 ) { |
| 374 | 374 | $event = EEH_Event_View::get_event( $EVT_ID ); |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | * |
| 419 | 419 | * @access public |
| 420 | 420 | * @param int $EVT_ID |
| 421 | - * @param null $include_expired |
|
| 421 | + * @param false|null $include_expired |
|
| 422 | 422 | * @param bool $include_deleted |
| 423 | 423 | * @param null $limit |
| 424 | 424 | * @return EE_Datetime[] |
@@ -40,27 +40,27 @@ discard block |
||
| 40 | 40 | * @param int $EVT_ID |
| 41 | 41 | * @return object |
| 42 | 42 | */ |
| 43 | - public static function get_event( $EVT_ID = 0 ) { |
|
| 44 | - $EVT_ID = $EVT_ID instanceof WP_Post ? $EVT_ID->ID : absint( $EVT_ID ); |
|
| 43 | + public static function get_event($EVT_ID = 0) { |
|
| 44 | + $EVT_ID = $EVT_ID instanceof WP_Post ? $EVT_ID->ID : absint($EVT_ID); |
|
| 45 | 45 | // do we already have the Event you are looking for? |
| 46 | - if ( EEH_Event_View::$_event instanceof EE_Event && $EVT_ID && EEH_Event_View::$_event->ID() === $EVT_ID ) { |
|
| 46 | + if (EEH_Event_View::$_event instanceof EE_Event && $EVT_ID && EEH_Event_View::$_event->ID() === $EVT_ID) { |
|
| 47 | 47 | return EEH_Event_View::$_event; |
| 48 | 48 | } |
| 49 | 49 | EEH_Event_View::$_event = NULL; |
| 50 | 50 | // international newspaper? |
| 51 | 51 | global $post; |
| 52 | 52 | // if this is being called from an EE_Event post, then we can just grab the attached EE_Event object |
| 53 | - if ( isset( $post->post_type ) && $post->post_type == 'espresso_events' || $EVT_ID ) { |
|
| 53 | + if (isset($post->post_type) && $post->post_type == 'espresso_events' || $EVT_ID) { |
|
| 54 | 54 | // d( $post ); |
| 55 | 55 | // grab the event we're looking for |
| 56 | - if ( isset( $post->EE_Event ) && ( $EVT_ID == 0 || ( $EVT_ID == $post->ID ))) { |
|
| 56 | + if (isset($post->EE_Event) && ($EVT_ID == 0 || ($EVT_ID == $post->ID))) { |
|
| 57 | 57 | EEH_Event_View::$_event = $post->EE_Event; |
| 58 | 58 | // d( EEH_Event_View::$_event ); |
| 59 | 59 | } |
| 60 | 60 | // now if we STILL do NOT have an EE_Event model object, BUT we have an Event ID... |
| 61 | - if ( ! EEH_Event_View::$_event instanceof EE_Event && $EVT_ID ) { |
|
| 61 | + if ( ! EEH_Event_View::$_event instanceof EE_Event && $EVT_ID) { |
|
| 62 | 62 | // sigh... pull it from the db |
| 63 | - EEH_Event_View::$_event = EEM_Event::instance()->get_one_by_ID( $EVT_ID ); |
|
| 63 | + EEH_Event_View::$_event = EEM_Event::instance()->get_one_by_ID($EVT_ID); |
|
| 64 | 64 | // d( EEH_Event_View::$_event ); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | * @param int $EVT_ID |
| 77 | 77 | * @return boolean |
| 78 | 78 | */ |
| 79 | - public static function display_ticket_selector( $EVT_ID = 0 ) { |
|
| 80 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 79 | + public static function display_ticket_selector($EVT_ID = 0) { |
|
| 80 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 81 | 81 | return $event instanceof EE_Event ? $event->display_ticket_selector() : FALSE; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | * @param int $EVT_ID |
| 91 | 91 | * @return string |
| 92 | 92 | */ |
| 93 | - public static function event_status( $EVT_ID = 0 ) { |
|
| 94 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 95 | - return $event instanceof EE_Event ? $event->pretty_active_status( FALSE ) : ''; |
|
| 93 | + public static function event_status($EVT_ID = 0) { |
|
| 94 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 95 | + return $event instanceof EE_Event ? $event->pretty_active_status(FALSE) : ''; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | * @param int $EVT_ID |
| 105 | 105 | * @return string |
| 106 | 106 | */ |
| 107 | - public static function event_active_status( $EVT_ID = 0 ) { |
|
| 108 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 107 | + public static function event_active_status($EVT_ID = 0) { |
|
| 108 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 109 | 109 | return $event instanceof EE_Event ? $event->pretty_active_status() : 'inactive'; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | * @param int $EVT_ID |
| 119 | 119 | * @return string |
| 120 | 120 | */ |
| 121 | - public static function event_has_content_or_excerpt( $EVT_ID = 0 ) { |
|
| 122 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 121 | + public static function event_has_content_or_excerpt($EVT_ID = 0) { |
|
| 122 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 123 | 123 | $has_content_or_excerpt = FALSE; |
| 124 | - if ( $event instanceof EE_Event ) { |
|
| 125 | - $has_content_or_excerpt = $event->description() != '' || $event->short_description( NULL, NULL, TRUE ) != '' ? TRUE : FALSE; |
|
| 124 | + if ($event instanceof EE_Event) { |
|
| 125 | + $has_content_or_excerpt = $event->description() != '' || $event->short_description(NULL, NULL, TRUE) != '' ? TRUE : FALSE; |
|
| 126 | 126 | } |
| 127 | - if ( is_archive() && ! ( espresso_display_full_description_in_event_list() || espresso_display_excerpt_in_event_list() )) { |
|
| 127 | + if (is_archive() && ! (espresso_display_full_description_in_event_list() || espresso_display_excerpt_in_event_list())) { |
|
| 128 | 128 | $has_content_or_excerpt = FALSE; |
| 129 | 129 | } |
| 130 | 130 | return $has_content_or_excerpt; |
@@ -140,39 +140,39 @@ discard block |
||
| 140 | 140 | * @param null $more |
| 141 | 141 | * @return string |
| 142 | 142 | */ |
| 143 | - public static function event_content_or_excerpt( $num_words = NULL, $more = NULL ) { |
|
| 143 | + public static function event_content_or_excerpt($num_words = NULL, $more = NULL) { |
|
| 144 | 144 | |
| 145 | 145 | global $post; |
| 146 | 146 | $content = ''; |
| 147 | 147 | |
| 148 | 148 | ob_start(); |
| 149 | - if (( is_single() ) || ( is_archive() && espresso_display_full_description_in_event_list() )) { |
|
| 149 | + if ((is_single()) || (is_archive() && espresso_display_full_description_in_event_list())) { |
|
| 150 | 150 | //echo '<h2 style="color:#E76700;">the_content<br/><span style="font-size:9px;font-weight:normal;color:#666">' . __FILE__ . '</span> <b style="font-size:10px;color:#333"> ' . __LINE__ . ' </b></h2>'; |
| 151 | 151 | the_content(); |
| 152 | - } else if (( is_archive() && has_excerpt( $post->ID ) && espresso_display_excerpt_in_event_list() ) || apply_filters( 'FHEE__EES_Espresso_Events__process_shortcode__true', FALSE )) { |
|
| 152 | + } else if ((is_archive() && has_excerpt($post->ID) && espresso_display_excerpt_in_event_list()) || apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', FALSE)) { |
|
| 153 | 153 | //echo '<h2 style="color:#E76700;">the_excerpt<br/><span style="font-size:9px;font-weight:normal;color:#666">' . __FILE__ . '</span> <b style="font-size:10px;color:#333"> ' . __LINE__ . ' </b></h2>'; |
| 154 | 154 | the_excerpt(); |
| 155 | - } else if (( is_archive() && ! has_excerpt( $post->ID ) && espresso_display_excerpt_in_event_list() )) { |
|
| 155 | + } else if ((is_archive() && ! has_excerpt($post->ID) && espresso_display_excerpt_in_event_list())) { |
|
| 156 | 156 | //echo '<h2 style="color:#E76700;">get_the_content<br/><span style="font-size:9px;font-weight:normal;color:#666">' . __FILE__ . '</span><b style="font-size:10px;color:#333"> ' . __LINE__ . ' </b></h2>'; |
| 157 | - if ( ! empty( $num_words )) { |
|
| 158 | - if ( empty( $more )) { |
|
| 159 | - $more = ' <a href="' . get_permalink() . '" class="more-link">' . __( '(more…)' ) . '</a>'; |
|
| 160 | - $more = apply_filters( 'the_content_more_link', $more ); |
|
| 157 | + if ( ! empty($num_words)) { |
|
| 158 | + if (empty($more)) { |
|
| 159 | + $more = ' <a href="'.get_permalink().'" class="more-link">'.__('(more…)').'</a>'; |
|
| 160 | + $more = apply_filters('the_content_more_link', $more); |
|
| 161 | 161 | } |
| 162 | - $content = str_replace( 'NOMORELINK', '', get_the_content( 'NOMORELINK' )); |
|
| 162 | + $content = str_replace('NOMORELINK', '', get_the_content('NOMORELINK')); |
|
| 163 | 163 | |
| 164 | - $content = wp_trim_words( $content, $num_words, ' ' ) . $more; |
|
| 164 | + $content = wp_trim_words($content, $num_words, ' ').$more; |
|
| 165 | 165 | } else { |
| 166 | - $content = get_the_content(); |
|
| 166 | + $content = get_the_content(); |
|
| 167 | 167 | } |
| 168 | 168 | global $allowedtags; |
| 169 | - $content = wp_kses( $content, $allowedtags ); |
|
| 170 | - $content = strip_shortcodes( $content ); |
|
| 171 | - echo apply_filters( 'the_content', $content ); |
|
| 169 | + $content = wp_kses($content, $allowedtags); |
|
| 170 | + $content = strip_shortcodes($content); |
|
| 171 | + echo apply_filters('the_content', $content); |
|
| 172 | 172 | |
| 173 | 173 | } else { |
| 174 | 174 | //echo '<h2 style="color:#E76700;">nothing<br/><span style="font-size:9px;font-weight:normal;color:#666">' . __FILE__ . '</span> <b style="font-size:10px;color:#333"> ' . __LINE__ . ' </b></h2>'; |
| 175 | - echo apply_filters( 'the_content', $content ); |
|
| 175 | + echo apply_filters('the_content', $content); |
|
| 176 | 176 | } |
| 177 | 177 | return ob_get_clean(); |
| 178 | 178 | } |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | * @param int $EVT_ID |
| 187 | 187 | * @return string |
| 188 | 188 | */ |
| 189 | - public static function event_tickets_available( $EVT_ID = 0 ) { |
|
| 190 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 189 | + public static function event_tickets_available($EVT_ID = 0) { |
|
| 190 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 191 | 191 | $tickets_available_for_purchase = array(); |
| 192 | - if( $event instanceof EE_Event ) { |
|
| 193 | - $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, FALSE ); |
|
| 194 | - foreach( $datetimes as $datetime ) { |
|
| 195 | - $tickets_available_for_purchase = array_merge( $tickets_available_for_purchase, $datetime->ticket_types_available_for_purchase() ); |
|
| 192 | + if ($event instanceof EE_Event) { |
|
| 193 | + $datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, FALSE); |
|
| 194 | + foreach ($datetimes as $datetime) { |
|
| 195 | + $tickets_available_for_purchase = array_merge($tickets_available_for_purchase, $datetime->ticket_types_available_for_purchase()); |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | return $tickets_available_for_purchase; |
@@ -208,22 +208,22 @@ discard block |
||
| 208 | 208 | * @param bool $hide_uncategorized |
| 209 | 209 | * @return string |
| 210 | 210 | */ |
| 211 | - public static function event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE ) { |
|
| 211 | + public static function event_categories($EVT_ID = 0, $hide_uncategorized = TRUE) { |
|
| 212 | 212 | $category_links = array(); |
| 213 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 214 | - if ( $event instanceof EE_Event ) { |
|
| 215 | - $event_categories = get_the_terms( $event->ID(), 'espresso_event_categories' ); |
|
| 216 | - if ( $event_categories ) { |
|
| 213 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 214 | + if ($event instanceof EE_Event) { |
|
| 215 | + $event_categories = get_the_terms($event->ID(), 'espresso_event_categories'); |
|
| 216 | + if ($event_categories) { |
|
| 217 | 217 | // loop thru terms and create links |
| 218 | - foreach ( $event_categories as $term ) { |
|
| 219 | - $url = get_term_link( $term, 'espresso_venue_categories' ); |
|
| 220 | - if ( ! is_wp_error( $url ) && (( $hide_uncategorized && strtolower( $term->name ) != __( 'uncategorized', 'event_espresso' )) || ! $hide_uncategorized )) { |
|
| 221 | - $category_links[] = '<a href="' . esc_url( $url ) . '" rel="tag">' . $term->name . '</a>'; |
|
| 218 | + foreach ($event_categories as $term) { |
|
| 219 | + $url = get_term_link($term, 'espresso_venue_categories'); |
|
| 220 | + if ( ! is_wp_error($url) && (($hide_uncategorized && strtolower($term->name) != __('uncategorized', 'event_espresso')) || ! $hide_uncategorized)) { |
|
| 221 | + $category_links[] = '<a href="'.esc_url($url).'" rel="tag">'.$term->name.'</a>'; |
|
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | - return implode( ', ', $category_links ); |
|
| 226 | + return implode(', ', $category_links); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | * @param int $EVT_ID |
| 238 | 238 | * @return string |
| 239 | 239 | */ |
| 240 | - public static function the_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 241 | - $datetime = EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
| 242 | - return $datetime instanceof EE_Datetime ? $datetime->start_date_and_time( $dt_frmt, $tm_frmt ) : ''; |
|
| 240 | + public static function the_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 241 | + $datetime = EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
| 242 | + return $datetime instanceof EE_Datetime ? $datetime->start_date_and_time($dt_frmt, $tm_frmt) : ''; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | * @param int $EVT_ID |
| 254 | 254 | * @return string |
| 255 | 255 | */ |
| 256 | - public static function the_event_end_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 257 | - $datetime = EEH_Event_View::get_last_date_obj( $EVT_ID ); |
|
| 258 | - return $datetime instanceof EE_Datetime ? $datetime->end_date_and_time( $dt_frmt, $tm_frmt ) : ''; |
|
| 256 | + public static function the_event_end_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 257 | + $datetime = EEH_Event_View::get_last_date_obj($EVT_ID); |
|
| 258 | + return $datetime instanceof EE_Datetime ? $datetime->end_date_and_time($dt_frmt, $tm_frmt) : ''; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | |
@@ -269,9 +269,9 @@ discard block |
||
| 269 | 269 | * @param int $EVT_ID |
| 270 | 270 | * @return string |
| 271 | 271 | */ |
| 272 | - public static function the_earliest_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 273 | - $datetime = EEH_Event_View::get_earliest_date_obj( $EVT_ID ); |
|
| 274 | - return $datetime instanceof EE_Datetime ? $datetime->start_date_and_time( $dt_frmt, $tm_frmt ) : ''; |
|
| 272 | + public static function the_earliest_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 273 | + $datetime = EEH_Event_View::get_earliest_date_obj($EVT_ID); |
|
| 274 | + return $datetime instanceof EE_Datetime ? $datetime->start_date_and_time($dt_frmt, $tm_frmt) : ''; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
@@ -285,9 +285,9 @@ discard block |
||
| 285 | 285 | * @param int $EVT_ID |
| 286 | 286 | * @return string |
| 287 | 287 | */ |
| 288 | - public static function the_latest_event_date( $dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0 ) { |
|
| 289 | - $datetime = EEH_Event_View::get_last_date_obj( $EVT_ID ); |
|
| 290 | - return $datetime instanceof EE_Datetime ? $datetime->end_date_and_time( $dt_frmt, $tm_frmt ) : ''; |
|
| 288 | + public static function the_latest_event_date($dt_frmt = 'D M jS', $tm_frmt = 'g:i a', $EVT_ID = 0) { |
|
| 289 | + $datetime = EEH_Event_View::get_last_date_obj($EVT_ID); |
|
| 290 | + return $datetime instanceof EE_Datetime ? $datetime->end_date_and_time($dt_frmt, $tm_frmt) : ''; |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | |
@@ -299,13 +299,13 @@ discard block |
||
| 299 | 299 | * @param int $EVT_ID |
| 300 | 300 | * @return string |
| 301 | 301 | */ |
| 302 | - public static function event_date_as_calendar_page( $EVT_ID = 0 ) { |
|
| 303 | - $datetime = EEH_Event_View::get_primary_date_obj( $EVT_ID ); |
|
| 304 | - if ( $datetime instanceof EE_Datetime ) { |
|
| 302 | + public static function event_date_as_calendar_page($EVT_ID = 0) { |
|
| 303 | + $datetime = EEH_Event_View::get_primary_date_obj($EVT_ID); |
|
| 304 | + if ($datetime instanceof EE_Datetime) { |
|
| 305 | 305 | ?> |
| 306 | 306 | <div class="event-date-calendar-page-dv"> |
| 307 | - <div class="event-date-calendar-page-month-dv"><?php echo date_i18n( 'M', strtotime( $datetime->start_date()));?></div> |
|
| 308 | - <div class="event-date-calendar-page-day-dv"><?php echo $datetime->start_date( 'd' );?></div> |
|
| 307 | + <div class="event-date-calendar-page-month-dv"><?php echo date_i18n('M', strtotime($datetime->start_date())); ?></div> |
|
| 308 | + <div class="event-date-calendar-page-day-dv"><?php echo $datetime->start_date('d'); ?></div> |
|
| 309 | 309 | </div> |
| 310 | 310 | <?php |
| 311 | 311 | } |
@@ -320,17 +320,17 @@ discard block |
||
| 320 | 320 | * @param int $EVT_ID |
| 321 | 321 | * @return string |
| 322 | 322 | */ |
| 323 | - public static function get_primary_date_obj( $EVT_ID = 0 ) { |
|
| 324 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 325 | - if ( $event instanceof EE_Event ) { |
|
| 323 | + public static function get_primary_date_obj($EVT_ID = 0) { |
|
| 324 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 325 | + if ($event instanceof EE_Event) { |
|
| 326 | 326 | $datetimes = $event->get_many_related( |
| 327 | 327 | 'Datetime', |
| 328 | 328 | array( |
| 329 | 329 | 'limit' => 1, |
| 330 | - 'order_by' => array( 'DTT_order' => 'ASC' ) |
|
| 330 | + 'order_by' => array('DTT_order' => 'ASC') |
|
| 331 | 331 | ) |
| 332 | 332 | ); |
| 333 | - return reset( $datetimes ); |
|
| 333 | + return reset($datetimes); |
|
| 334 | 334 | } else { |
| 335 | 335 | return FALSE; |
| 336 | 336 | } |
@@ -345,17 +345,17 @@ discard block |
||
| 345 | 345 | * @param int $EVT_ID |
| 346 | 346 | * @return string |
| 347 | 347 | */ |
| 348 | - public static function get_last_date_obj( $EVT_ID = 0 ) { |
|
| 349 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 350 | - if ( $event instanceof EE_Event ) { |
|
| 348 | + public static function get_last_date_obj($EVT_ID = 0) { |
|
| 349 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 350 | + if ($event instanceof EE_Event) { |
|
| 351 | 351 | $datetimes = $event->get_many_related( |
| 352 | 352 | 'Datetime', |
| 353 | 353 | array( |
| 354 | 354 | 'limit' => 1, |
| 355 | - 'order_by' => array( 'DTT_order' => 'DESC' ) |
|
| 355 | + 'order_by' => array('DTT_order' => 'DESC') |
|
| 356 | 356 | ) |
| 357 | 357 | ); |
| 358 | - return end( $datetimes ); |
|
| 358 | + return end($datetimes); |
|
| 359 | 359 | } else { |
| 360 | 360 | return FALSE; |
| 361 | 361 | } |
@@ -370,17 +370,17 @@ discard block |
||
| 370 | 370 | * @param int $EVT_ID |
| 371 | 371 | * @return string |
| 372 | 372 | */ |
| 373 | - public static function get_earliest_date_obj( $EVT_ID = 0 ) { |
|
| 374 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 375 | - if ( $event instanceof EE_Event ) { |
|
| 373 | + public static function get_earliest_date_obj($EVT_ID = 0) { |
|
| 374 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 375 | + if ($event instanceof EE_Event) { |
|
| 376 | 376 | $datetimes = $event->get_many_related( |
| 377 | 377 | 'Datetime', |
| 378 | 378 | array( |
| 379 | 379 | 'limit' => 1, |
| 380 | - 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) |
|
| 380 | + 'order_by' => array('DTT_EVT_start' => 'ASC') |
|
| 381 | 381 | ) |
| 382 | 382 | ); |
| 383 | - return reset( $datetimes ); |
|
| 383 | + return reset($datetimes); |
|
| 384 | 384 | } else { |
| 385 | 385 | return FALSE; |
| 386 | 386 | } |
@@ -395,17 +395,17 @@ discard block |
||
| 395 | 395 | * @param int $EVT_ID |
| 396 | 396 | * @return string |
| 397 | 397 | */ |
| 398 | - public static function get_latest_date_obj( $EVT_ID = 0 ) { |
|
| 399 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 400 | - if ( $event instanceof EE_Event ) { |
|
| 398 | + public static function get_latest_date_obj($EVT_ID = 0) { |
|
| 399 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 400 | + if ($event instanceof EE_Event) { |
|
| 401 | 401 | $datetimes = $event->get_many_related( |
| 402 | 402 | 'Datetime', |
| 403 | 403 | array( |
| 404 | 404 | 'limit' => 1, |
| 405 | - 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) |
|
| 405 | + 'order_by' => array('DTT_EVT_start' => 'DESC') |
|
| 406 | 406 | ) |
| 407 | 407 | ); |
| 408 | - return end( $datetimes ); |
|
| 408 | + return end($datetimes); |
|
| 409 | 409 | } else { |
| 410 | 410 | return FALSE; |
| 411 | 411 | } |
@@ -423,18 +423,18 @@ discard block |
||
| 423 | 423 | * @param null $limit |
| 424 | 424 | * @return EE_Datetime[] |
| 425 | 425 | */ |
| 426 | - public static function get_all_date_obj( $EVT_ID = 0, $include_expired = NULL, $include_deleted = false, $limit = NULL ) { |
|
| 427 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 428 | - if($include_expired === NULL){ |
|
| 429 | - if($event->is_expired()){ |
|
| 426 | + public static function get_all_date_obj($EVT_ID = 0, $include_expired = NULL, $include_deleted = false, $limit = NULL) { |
|
| 427 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 428 | + if ($include_expired === NULL) { |
|
| 429 | + if ($event->is_expired()) { |
|
| 430 | 430 | $include_expired = TRUE; |
| 431 | - }else{ |
|
| 431 | + } else { |
|
| 432 | 432 | $include_expired = FALSE; |
| 433 | 433 | } |
| 434 | - }else{ |
|
| 434 | + } else { |
|
| 435 | 435 | $include_expired = TRUE; |
| 436 | 436 | } |
| 437 | - if ( $event instanceof EE_Event ) { |
|
| 437 | + if ($event instanceof EE_Event) { |
|
| 438 | 438 | return $event->datetimes_ordered($include_expired, $include_deleted, $limit); |
| 439 | 439 | } else { |
| 440 | 440 | return array(); |
@@ -450,11 +450,11 @@ discard block |
||
| 450 | 450 | * @param int $EVT_ID |
| 451 | 451 | * @return string |
| 452 | 452 | */ |
| 453 | - public static function event_link_url( $EVT_ID = 0 ) { |
|
| 454 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 455 | - if ( $event instanceof EE_Event ) { |
|
| 456 | - $url = $event->external_url() !== NULL && $event->external_url() !== '' ? $event->external_url() : get_permalink( $event->ID() ); |
|
| 457 | - return preg_match( "~^(?:f|ht)tps?://~i", $url ) ? $url : 'http://' . $url; |
|
| 453 | + public static function event_link_url($EVT_ID = 0) { |
|
| 454 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 455 | + if ($event instanceof EE_Event) { |
|
| 456 | + $url = $event->external_url() !== NULL && $event->external_url() !== '' ? $event->external_url() : get_permalink($event->ID()); |
|
| 457 | + return preg_match("~^(?:f|ht)tps?://~i", $url) ? $url : 'http://'.$url; |
|
| 458 | 458 | } |
| 459 | 459 | return NULL; |
| 460 | 460 | } |
@@ -468,11 +468,11 @@ discard block |
||
| 468 | 468 | * @param int $EVT_ID |
| 469 | 469 | * @return string |
| 470 | 470 | */ |
| 471 | - public static function event_phone( $EVT_ID = 0 ) { |
|
| 472 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 473 | - if ( $event instanceof EE_Event ) { |
|
| 474 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
| 475 | - return EEH_Schema::telephone( $event->phone() ); |
|
| 471 | + public static function event_phone($EVT_ID = 0) { |
|
| 472 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 473 | + if ($event instanceof EE_Event) { |
|
| 474 | + EE_Registry::instance()->load_helper('Formatter'); |
|
| 475 | + return EEH_Schema::telephone($event->phone()); |
|
| 476 | 476 | } |
| 477 | 477 | return NULL; |
| 478 | 478 | } |
@@ -489,23 +489,23 @@ discard block |
||
| 489 | 489 | * @param string $after |
| 490 | 490 | * @return string |
| 491 | 491 | */ |
| 492 | - public static function edit_event_link( $EVT_ID = 0, $link = '', $before = '', $after = '' ) { |
|
| 493 | - $event = EEH_Event_View::get_event( $EVT_ID ); |
|
| 494 | - if ( $event instanceof EE_Event ) { |
|
| 492 | + public static function edit_event_link($EVT_ID = 0, $link = '', $before = '', $after = '') { |
|
| 493 | + $event = EEH_Event_View::get_event($EVT_ID); |
|
| 494 | + if ($event instanceof EE_Event) { |
|
| 495 | 495 | // can the user edit this post ? |
| 496 | - if ( current_user_can( 'edit_post', $event->ID() )) { |
|
| 496 | + if (current_user_can('edit_post', $event->ID())) { |
|
| 497 | 497 | // set link text |
| 498 | - $link = ! empty( $link ) ? $link : __('edit this event'); |
|
| 498 | + $link = ! empty($link) ? $link : __('edit this event'); |
|
| 499 | 499 | // generate nonce |
| 500 | - $nonce = wp_create_nonce( 'edit_nonce' ); |
|
| 500 | + $nonce = wp_create_nonce('edit_nonce'); |
|
| 501 | 501 | // generate url to event editor for this event |
| 502 | - $url = add_query_arg( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event->ID(), 'edit_nonce' => $nonce ), admin_url() ); |
|
| 502 | + $url = add_query_arg(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event->ID(), 'edit_nonce' => $nonce), admin_url()); |
|
| 503 | 503 | // get edit CPT text |
| 504 | - $post_type_obj = get_post_type_object( 'espresso_events' ); |
|
| 504 | + $post_type_obj = get_post_type_object('espresso_events'); |
|
| 505 | 505 | // build final link html |
| 506 | - $link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>'; |
|
| 506 | + $link = '<a class="post-edit-link" href="'.$url.'" title="'.esc_attr($post_type_obj->labels->edit_item).'">'.$link.'</a>'; |
|
| 507 | 507 | // put it all together |
| 508 | - return $before . apply_filters( 'edit_post_link', $link, $event->ID() ) . $after; |
|
| 508 | + return $before.apply_filters('edit_post_link', $link, $event->ID()).$after; |
|
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | return ''; |
@@ -1,4 +1,6 @@ discard block |
||
| 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 | * |
@@ -428,10 +430,10 @@ discard block |
||
| 428 | 430 | if($include_expired === NULL){ |
| 429 | 431 | if($event->is_expired()){ |
| 430 | 432 | $include_expired = TRUE; |
| 431 | - }else{ |
|
| 433 | + } else{ |
|
| 432 | 434 | $include_expired = FALSE; |
| 433 | 435 | } |
| 434 | - }else{ |
|
| 436 | + } else{ |
|
| 435 | 437 | $include_expired = TRUE; |
| 436 | 438 | } |
| 437 | 439 | if ( $event instanceof EE_Event ) { |