@@ -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 | /** |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | class EE_Messages_Email_Payment_Failed_Validator extends EE_Messages_Validator { |
19 | 19 | |
20 | 20 | |
21 | - public function __construct( $fields, $context ) { |
|
21 | + public function __construct($fields, $context) { |
|
22 | 22 | $this->_m_name = 'email'; |
23 | 23 | $this->_mt_name = 'payment_failed'; |
24 | 24 | |
25 | - parent::__construct( $fields, $context ); |
|
25 | + parent::__construct($fields, $context); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -33,17 +33,17 @@ discard block |
||
33 | 33 | |
34 | 34 | //modify just event_list |
35 | 35 | $new_config['event_list'] = array( |
36 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
37 | 37 | ); |
38 | 38 | $new_config['ticket_list'] = array( |
39 | 39 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
40 | 40 | ); |
41 | 41 | $new_config['content'] = array( |
42 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
43 | 43 | ); |
44 | - $this->_messenger->set_validator_config( $new_config ); |
|
44 | + $this->_messenger->set_validator_config($new_config); |
|
45 | 45 | |
46 | - if ( $this->_context != 'admin' ) |
|
46 | + if ($this->_context != 'admin') |
|
47 | 47 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * EE_Messages_Email_Payment_Failed_Validator class |
@@ -43,8 +44,9 @@ discard block |
||
43 | 44 | ); |
44 | 45 | $this->_messenger->set_validator_config( $new_config ); |
45 | 46 | |
46 | - if ( $this->_context != 'admin' ) |
|
47 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | + if ( $this->_context != 'admin' ) { |
|
48 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
49 | + } |
|
48 | 50 | |
49 | 51 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
50 | 52 | } |
@@ -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 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'payment_reminder'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | |
46 | 46 | //modify just event_list |
47 | 47 | $new_config['event_list'] = array( |
48 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
48 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
49 | 49 | ); |
50 | 50 | $new_config['ticket_list'] = array( |
51 | 51 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
52 | 52 | ); |
53 | 53 | $new_config['content'] = array( |
54 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
54 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
55 | 55 | ); |
56 | - $this->_messenger->set_validator_config( $new_config ); |
|
56 | + $this->_messenger->set_validator_config($new_config); |
|
57 | 57 | |
58 | - if ( $this->_context != 'admin' ) |
|
58 | + if ($this->_context != 'admin') |
|
59 | 59 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
60 | 60 | |
61 | 61 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -55,8 +56,9 @@ discard block |
||
55 | 56 | ); |
56 | 57 | $this->_messenger->set_validator_config( $new_config ); |
57 | 58 | |
58 | - if ( $this->_context != 'admin' ) |
|
59 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
59 | + if ( $this->_context != 'admin' ) { |
|
60 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
61 | + } |
|
60 | 62 | |
61 | 63 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
62 | 64 | } |
@@ -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 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | class EE_Messages_Email_Cancelled_Registration_Validator extends EE_Messages_Validator { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $fields, $context ) { |
|
33 | + public function __construct($fields, $context) { |
|
34 | 34 | $this->_m_name = 'email'; |
35 | 35 | $this->_mt_name = 'cancelled_registration'; |
36 | 36 | |
37 | - parent::__construct( $fields, $context ); |
|
37 | + parent::__construct($fields, $context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
47 | 47 | 'required' => array('[EVENT_LIST]') |
48 | 48 | ); |
49 | - $this->_messenger->set_validator_config( $new_config ); |
|
49 | + $this->_messenger->set_validator_config($new_config); |
|
50 | 50 | |
51 | - if ( $this->_context != 'admin' ) |
|
51 | + if ($this->_context != 'admin') |
|
52 | 52 | $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
53 | 53 | |
54 | 54 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -55,8 +56,9 @@ discard block |
||
55 | 56 | ); |
56 | 57 | $this->_messenger->set_validator_config( $new_config ); |
57 | 58 | |
58 | - if ( $this->_context != 'admin' ) |
|
59 | - $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
59 | + if ( $this->_context != 'admin' ) { |
|
60 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
61 | + } |
|
60 | 62 | |
61 | 63 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
62 | 64 | } |
@@ -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; |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | * date_format and the second value is the time format |
44 | 44 | * @return EE_Attendee |
45 | 45 | */ |
46 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
47 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
48 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
46 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
47 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
48 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * the website will be used. |
57 | 57 | * @return EE_Attendee |
58 | 58 | */ |
59 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
60 | - return new self( $props_n_values, TRUE, $timezone ); |
|
59 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
60 | + return new self($props_n_values, TRUE, $timezone); |
|
61 | 61 | } |
62 | 62 | /** |
63 | 63 | * Gets code |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | * Gets a prettier name |
160 | 160 | * @return string |
161 | 161 | */ |
162 | - function name(){ |
|
163 | - return sprintf(__("%s (%s)", "event_espresso"),$this->code(),$this->plural_name()); |
|
162 | + function name() { |
|
163 | + return sprintf(__("%s (%s)", "event_espresso"), $this->code(), $this->plural_name()); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param array $props_n_values incoming values from the database |
55 | 55 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
56 | 56 | * the website will be used. |
57 | - * @return EE_Attendee |
|
57 | + * @return EE_Currency |
|
58 | 58 | */ |
59 | 59 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
60 | 60 | return new self( $props_n_values, TRUE, $timezone ); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * Sets code |
72 | 72 | * @param string $code |
73 | - * @return boolean |
|
73 | + * @return boolean|null |
|
74 | 74 | */ |
75 | 75 | function set_code($code) { |
76 | 76 | return $this->set('CUR_code', $code); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * Sets active |
88 | 88 | * @param boolean $active |
89 | - * @return boolean |
|
89 | + * @return boolean|null |
|
90 | 90 | */ |
91 | 91 | function set_active($active) { |
92 | 92 | return $this->set('CUR_active', $active); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * Sets dec_plc |
104 | 104 | * @param int $dec_plc |
105 | - * @return boolean |
|
105 | + * @return boolean|null |
|
106 | 106 | */ |
107 | 107 | function set_dec_plc($dec_plc) { |
108 | 108 | return $this->set('CUR_dec_plc', $dec_plc); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | /** |
119 | 119 | * Sets plural |
120 | 120 | * @param string $plural |
121 | - * @return boolean |
|
121 | + * @return boolean|null |
|
122 | 122 | */ |
123 | 123 | function set_plural_name($plural) { |
124 | 124 | return $this->set('CUR_plural', $plural); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | /** |
135 | 135 | * Sets sign |
136 | 136 | * @param string $sign |
137 | - * @return boolean |
|
137 | + * @return boolean|null |
|
138 | 138 | */ |
139 | 139 | function set_sign($sign) { |
140 | 140 | return $this->set('CUR_sign', $sign); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * Sets single |
152 | 152 | * @param string $single |
153 | - * @return boolean |
|
153 | + * @return boolean|null |
|
154 | 154 | */ |
155 | 155 | function set_singular_name($single) { |
156 | 156 | return $this->set('CUR_single', $single); |
@@ -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 |
@@ -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 |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * date_format and the second value is the time format |
36 | 36 | * @return EE_Attendee |
37 | 37 | */ |
38 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
39 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
40 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
38 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
39 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
40 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | * the website will be used. |
49 | 49 | * @return EE_Attendee |
50 | 50 | */ |
51 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
52 | - return new self( $props_n_values, TRUE, $timezone ); |
|
51 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
52 | + return new self($props_n_values, TRUE, $timezone); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * @access public |
61 | 61 | * @param int $PRT_ID |
62 | 62 | */ |
63 | - public function set_type( $PRT_ID = 0 ) { |
|
64 | - $this->set( 'PRT_ID', $PRT_ID ); |
|
63 | + public function set_type($PRT_ID = 0) { |
|
64 | + $this->set('PRT_ID', $PRT_ID); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @access public |
73 | 73 | * @param float $PRC_amount |
74 | 74 | */ |
75 | - public function set_amount( $PRC_amount = 0.00 ) { |
|
76 | - $this->set( 'PRC_amount', $PRC_amount ); |
|
75 | + public function set_amount($PRC_amount = 0.00) { |
|
76 | + $this->set('PRC_amount', $PRC_amount); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | * @access public |
85 | 85 | * @param string $PRC_name |
86 | 86 | */ |
87 | - public function set_name( $PRC_name = '' ) { |
|
88 | - $this->set( 'PRC_name', $PRC_name ); |
|
87 | + public function set_name($PRC_name = '') { |
|
88 | + $this->set('PRC_name', $PRC_name); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | * @access public |
97 | 97 | * @param string $PRC_desc |
98 | 98 | */ |
99 | - public function set_description( $PRC_desc = '' ) { |
|
100 | - $this->Set( 'PRC_desc', $PRC_desc ); |
|
99 | + public function set_description($PRC_desc = '') { |
|
100 | + $this->Set('PRC_desc', $PRC_desc); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | * @access public |
109 | 109 | * @param bool $PRC_is_default |
110 | 110 | */ |
111 | - public function set_is_default( $PRC_is_default = FALSE ) { |
|
112 | - $this->set( 'PRC_is_default', $PRC_is_default ); |
|
111 | + public function set_is_default($PRC_is_default = FALSE) { |
|
112 | + $this->set('PRC_is_default', $PRC_is_default); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | * @access public |
121 | 121 | * @param bool $PRC_deleted |
122 | 122 | */ |
123 | - public function set_deleted( $PRC_deleted = NULL ) { |
|
124 | - $this->set( 'PRC_deleted', $PRC_deleted ); |
|
123 | + public function set_deleted($PRC_deleted = NULL) { |
|
124 | + $this->set('PRC_deleted', $PRC_deleted); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @return int |
133 | 133 | */ |
134 | 134 | public function type() { |
135 | - return $this->get( 'PRT_ID' ); |
|
135 | + return $this->get('PRT_ID'); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return float |
144 | 144 | */ |
145 | 145 | public function amount() { |
146 | - return $this->get( 'PRC_amount' ); |
|
146 | + return $this->get('PRC_amount'); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @return string |
155 | 155 | */ |
156 | 156 | public function name() { |
157 | - return $this->get( 'PRC_name' ); |
|
157 | + return $this->get('PRC_name'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @return string |
166 | 166 | */ |
167 | 167 | public function desc() { |
168 | - return $this->get( 'PRC_desc' ); |
|
168 | + return $this->get('PRC_desc'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @return int |
177 | 177 | */ |
178 | 178 | public function overrides() { |
179 | - return $this->get( 'PRC_overrides' ); |
|
179 | + return $this->get('PRC_overrides'); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @return int |
188 | 188 | */ |
189 | 189 | public function order() { |
190 | - return $this->get( 'PRC_order' ); |
|
190 | + return $this->get('PRC_order'); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @return bool |
212 | 212 | */ |
213 | 213 | public function is_default() { |
214 | - return $this->get( 'PRC_is_default' ); |
|
214 | + return $this->get('PRC_is_default'); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @return bool |
223 | 223 | */ |
224 | 224 | public function deleted() { |
225 | - return $this->get( 'PRC_deleted' ); |
|
225 | + return $this->get('PRC_deleted'); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * @return bool |
232 | 232 | */ |
233 | 233 | public function parent() { |
234 | - return $this->get( 'PRC_parent' ); |
|
234 | + return $this->get('PRC_parent'); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @return EE_Price_Type |
254 | 254 | */ |
255 | 255 | public function type_obj() { |
256 | - return $this->get_first_related( 'Price_Type' ); |
|
256 | + return $this->get_first_related('Price_Type'); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | public function is_percent() { |
277 | 277 | $price_type = $this->type_obj(); |
278 | - return $price_type->get( 'PRT_is_percent' ); |
|
278 | + return $price_type->get('PRT_is_percent'); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * @return string |
288 | 288 | */ |
289 | 289 | public function pretty_price() { |
290 | - return ! $this->is_percent() ? $this->get_pretty('PRC_amount') : $this->get('PRC_amount') . '%'; |
|
290 | + return ! $this->is_percent() ? $this->get_pretty('PRC_amount') : $this->get('PRC_amount').'%'; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @return mixed |
297 | 297 | */ |
298 | 298 | public function get_price_without_currency_symbol() { |
299 | - return str_replace( EE_Registry::instance()->CFG->currency->sign, '', $this->get_pretty( 'PRC_amount' ) ); |
|
299 | + return str_replace(EE_Registry::instance()->CFG->currency->sign, '', $this->get_pretty('PRC_amount')); |
|
300 | 300 | } |
301 | 301 | } |
302 | 302 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | * @param array $props_n_values incoming values from the database |
47 | 47 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
48 | 48 | * the website will be used. |
49 | - * @return EE_Attendee |
|
49 | + * @return EE_Price |
|
50 | 50 | */ |
51 | 51 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
52 | 52 | return new self( $props_n_values, TRUE, $timezone ); |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | |
104 | 104 | |
105 | 105 | /** |
106 | - * set is_default |
|
107 | - * |
|
108 | - * @access public |
|
109 | - * @param bool $PRC_is_default |
|
110 | - */ |
|
106 | + * set is_default |
|
107 | + * |
|
108 | + * @access public |
|
109 | + * @param bool $PRC_is_default |
|
110 | + */ |
|
111 | 111 | public function set_is_default( $PRC_is_default = FALSE ) { |
112 | 112 | $this->set( 'PRC_is_default', $PRC_is_default ); |
113 | 113 | } |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | |
116 | 116 | |
117 | 117 | /** |
118 | - * set deleted |
|
119 | - * |
|
120 | - * @access public |
|
121 | - * @param bool $PRC_deleted |
|
122 | - */ |
|
118 | + * set deleted |
|
119 | + * |
|
120 | + * @access public |
|
121 | + * @param bool $PRC_deleted |
|
122 | + */ |
|
123 | 123 | public function set_deleted( $PRC_deleted = NULL ) { |
124 | 124 | $this->set( 'PRC_deleted', $PRC_deleted ); |
125 | 125 | } |
@@ -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 |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | * date_format and the second value is the time format |
46 | 46 | * @return EE_Attendee |
47 | 47 | */ |
48 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
49 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
50 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
48 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
49 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
50 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | * the website will be used. |
59 | 59 | * @return EE_Attendee |
60 | 60 | */ |
61 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
62 | - return new self( $props_n_values, TRUE, $timezone ); |
|
61 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
62 | + return new self($props_n_values, TRUE, $timezone); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | * @param string $value |
70 | 70 | * @return bool success |
71 | 71 | */ |
72 | - public function set_value( $value ) { |
|
73 | - $this->set( 'QSO_value', $value ); |
|
72 | + public function set_value($value) { |
|
73 | + $this->set('QSO_value', $value); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | * @param string $text |
81 | 81 | * @return bool success |
82 | 82 | */ |
83 | - public function set_desc( $text ) { |
|
84 | - $this->set( 'QSO_desc', $text ); |
|
83 | + public function set_desc($text) { |
|
84 | + $this->set('QSO_desc', $text); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | * @param integer $order |
94 | 94 | * @return bool $success |
95 | 95 | */ |
96 | - public function set_order( $order ) { |
|
97 | - $this->set( 'QSO_order', $order ); |
|
96 | + public function set_order($order) { |
|
97 | + $this->set('QSO_order', $order); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @param int $question_ID |
105 | 105 | * @return bool success |
106 | 106 | */ |
107 | - public function set_question_ID( $question_ID ) { |
|
108 | - $this->set( 'QST_ID', $question_ID ); |
|
107 | + public function set_question_ID($question_ID) { |
|
108 | + $this->set('QST_ID', $question_ID); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param string $text |
116 | 116 | * @return bool success |
117 | 117 | */ |
118 | - public function set_opt_group( $text ) { |
|
118 | + public function set_opt_group($text) { |
|
119 | 119 | return $this->_QSO_opt_group = $text; |
120 | 120 | } |
121 | 121 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @return string |
127 | 127 | */ |
128 | 128 | public function value() { |
129 | - return $this->get( 'QSO_value' ); |
|
129 | + return $this->get('QSO_value'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @return string |
137 | 137 | */ |
138 | 138 | public function desc() { |
139 | - return $this->get( 'QSO_desc' ); |
|
139 | + return $this->get('QSO_desc'); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @return boolean |
147 | 147 | */ |
148 | 148 | public function deleted() { |
149 | - return $this->get( 'QSO_deleted' ); |
|
149 | + return $this->get('QSO_deleted'); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @return integer |
159 | 159 | */ |
160 | 160 | public function order() { |
161 | - return $this->get( 'QSO_option' ); |
|
161 | + return $this->get('QSO_option'); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @return int |
169 | 169 | */ |
170 | 170 | public function question_ID() { |
171 | - return $this->get( 'QST_ID' ); |
|
171 | + return $this->get('QST_ID'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @return EE_Question |
179 | 179 | */ |
180 | 180 | public function question() { |
181 | - return $this->get_first_related( 'Question' ); |
|
181 | + return $this->get_first_related('Question'); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | * @param array $options { |
198 | 198 | * @type int $QST_ID the QST_ID attribute of this question option, otherwise it will be for the same question as the original |
199 | 199 | */ |
200 | - public function duplicate( $options = array() ) { |
|
200 | + public function duplicate($options = array()) { |
|
201 | 201 | $new_question_option = clone $this; |
202 | - $new_question_option->set( 'QSO_ID', null ); |
|
203 | - if( array_key_exists( 'QST_ID', $options ) ) {//use array_key_exists instead of isset because NULL might be a valid value |
|
204 | - $new_question_option->set_question_ID( $options[ 'QST_ID' ] ); |
|
202 | + $new_question_option->set('QSO_ID', null); |
|
203 | + if (array_key_exists('QST_ID', $options)) {//use array_key_exists instead of isset because NULL might be a valid value |
|
204 | + $new_question_option->set_question_ID($options['QST_ID']); |
|
205 | 205 | } |
206 | 206 | $new_question_option->save(); |
207 | 207 | } |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | * @param string $QSO_system |
220 | 220 | * @return bool |
221 | 221 | */ |
222 | - public function set_system( $QSO_system ) { |
|
223 | - return $this->set( 'QSO_system', $QSO_system ); |
|
222 | + public function set_system($QSO_system) { |
|
223 | + return $this->set('QSO_system', $QSO_system); |
|
224 | 224 | } |
225 | 225 | } |
226 | 226 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param array $props_n_values incoming values from the database |
57 | 57 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
58 | 58 | * the website will be used. |
59 | - * @return EE_Attendee |
|
59 | + * @return EE_Question_Option |
|
60 | 60 | */ |
61 | 61 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
62 | 62 | return new self( $props_n_values, TRUE, $timezone ); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * Sets the option's key value |
69 | 69 | * @param string $value |
70 | - * @return bool success |
|
70 | + * @return boolean|null success |
|
71 | 71 | */ |
72 | 72 | public function set_value( $value ) { |
73 | 73 | $this->set( 'QSO_value', $value ); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * Sets the option's Display Text |
80 | 80 | * @param string $text |
81 | - * @return bool success |
|
81 | + * @return boolean|null success |
|
82 | 82 | */ |
83 | 83 | public function set_desc( $text ) { |
84 | 84 | $this->set( 'QSO_desc', $text ); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @access public |
93 | 93 | * @param integer $order |
94 | - * @return bool $success |
|
94 | + * @return boolean|null $success |
|
95 | 95 | */ |
96 | 96 | public function set_order( $order ) { |
97 | 97 | $this->set( 'QSO_order', $order ); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * Sets the ID of the related question |
104 | 104 | * @param int $question_ID |
105 | - * @return bool success |
|
105 | + * @return boolean|null success |
|
106 | 106 | */ |
107 | 107 | public function set_question_ID( $question_ID ) { |
108 | 108 | $this->set( 'QST_ID', $question_ID ); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | /** |
114 | 114 | * Sets the option's opt_group |
115 | 115 | * @param string $text |
116 | - * @return bool success |
|
116 | + * @return string success |
|
117 | 117 | */ |
118 | 118 | public function set_opt_group( $text ) { |
119 | 119 | return $this->_QSO_opt_group = $text; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | /** |
218 | 218 | * Sets QSO_system |
219 | 219 | * @param string $QSO_system |
220 | - * @return bool |
|
220 | + * @return boolean|null |
|
221 | 221 | */ |
222 | 222 | public function set_system( $QSO_system ) { |
223 | 223 | return $this->set( 'QSO_system', $QSO_system ); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * @param string $timezone |
20 | 20 | * @return EE_Registration_Payment |
21 | 21 | */ |
22 | - public static function new_instance( $props_n_values = array(), $timezone = '', $date_formats = array() ) { |
|
23 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
24 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
22 | + public static function new_instance($props_n_values = array(), $timezone = '', $date_formats = array()) { |
|
23 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
24 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | * @param string $timezone |
32 | 32 | * @return EE_Registration_Payment |
33 | 33 | */ |
34 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
35 | - return new self( $props_n_values, true, $timezone ); |
|
34 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
35 | + return new self($props_n_values, true, $timezone); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return int |
44 | 44 | */ |
45 | 45 | public function registration_ID() { |
46 | - return $this->get( 'REG_ID' ); |
|
46 | + return $this->get('REG_ID'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return int |
55 | 55 | */ |
56 | 56 | public function payment_ID() { |
57 | - return $this->get( 'PAY_ID' ); |
|
57 | + return $this->get('PAY_ID'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @return float |
66 | 66 | */ |
67 | 67 | public function amount() { |
68 | - return $this->get( 'RPY_amount' ); |
|
68 | + return $this->get('RPY_amount'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @access public |
76 | 76 | * @param float $amount |
77 | 77 | */ |
78 | - public function set_amount( $amount = 0.000 ) { |
|
79 | - $this->set( 'RPY_amount', $amount ); |
|
78 | + public function set_amount($amount = 0.000) { |
|
79 | + $this->set('RPY_amount', $amount); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @return \EE_Registration |
88 | 88 | */ |
89 | 89 | public function registration() { |
90 | - return $this->get_first_related( 'Registration' ); |
|
90 | + return $this->get_first_related('Registration'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return \EE_Payment |
99 | 99 | */ |
100 | 100 | public function payment() { |
101 | - return $this->get_first_related( 'Payment' ); |
|
101 | + return $this->get_first_related('Payment'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 |
@@ -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 |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @param string $timezone |
36 | 36 | * @return EE_Ticket_Price|mixed |
37 | 37 | */ |
38 | - public static function new_instance( $props_n_values = array(), $timezone = '', $date_formats = array() ) { |
|
39 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
40 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone, $date_formats ); |
|
38 | + public static function new_instance($props_n_values = array(), $timezone = '', $date_formats = array()) { |
|
39 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
40 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone, $date_formats); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @param string $timezone |
48 | 48 | * @return EE_Ticket_Price |
49 | 49 | */ |
50 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
51 | - return new self( $props_n_values, TRUE, $timezone ); |
|
50 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
51 | + return new self($props_n_values, TRUE, $timezone); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | /** |
6 | 6 | * |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @since 4.6.0 |
16 | 16 | * |
17 | 17 | */ |
18 | -class EE_Default_Where_Conditions{ |
|
18 | +class EE_Default_Where_Conditions { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * This const can be used in EE_Default_Where_Conditions values, and at the time of querying it will be |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * onto any field names |
49 | 49 | * @param array $custom_where_conditions |
50 | 50 | */ |
51 | - public function __construct( $custom_where_conditions = array() ) { |
|
51 | + public function __construct($custom_where_conditions = array()) { |
|
52 | 52 | $this->_where_conditions_provided = $custom_where_conditions; |
53 | 53 | } |
54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * for querying of the model. |
60 | 60 | * @param EEM_Base $model |
61 | 61 | */ |
62 | - function _finalize_construct(EEM_Base $model){ |
|
62 | + function _finalize_construct(EEM_Base $model) { |
|
63 | 63 | $this->_model = $model; |
64 | 64 | } |
65 | 65 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | * @param string $model_relation_chain |
81 | 81 | * @return array like what's expected in EEM_Base::get_all()'s $query_params[0] |
82 | 82 | */ |
83 | - function get_default_where_conditions( $model_relation_chain = '' ){ |
|
84 | - return $this->prepare_where_conditions_for_querying( array_merge( $this->_get_default_where_conditions(), $this->get_where_conditions_provided() ), $model_relation_chain ); |
|
83 | + function get_default_where_conditions($model_relation_chain = '') { |
|
84 | + return $this->prepare_where_conditions_for_querying(array_merge($this->_get_default_where_conditions(), $this->get_where_conditions_provided()), $model_relation_chain); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * Adding model relation chains is handled by the public method get_default_where_conditions |
92 | 92 | * @return array |
93 | 93 | */ |
94 | - protected function _get_default_where_conditions(){ |
|
94 | + protected function _get_default_where_conditions() { |
|
95 | 95 | return array(); |
96 | 96 | } |
97 | 97 | |
@@ -105,36 +105,36 @@ discard block |
||
105 | 105 | * @return array |
106 | 106 | * @throws \EE_Error |
107 | 107 | */ |
108 | - public function prepare_where_conditions_for_querying( $where_conditions, $model_relation_chain ) { |
|
108 | + public function prepare_where_conditions_for_querying($where_conditions, $model_relation_chain) { |
|
109 | 109 | $where_conditions_with_model_relation_chain_prefixes = array(); |
110 | - if ( ! is_array( $where_conditions ) ) { |
|
110 | + if ( ! is_array($where_conditions)) { |
|
111 | 111 | $where_conditions = array(); |
112 | 112 | } |
113 | - foreach ( $where_conditions as $key => $value ) { |
|
113 | + foreach ($where_conditions as $key => $value) { |
|
114 | 114 | if ( |
115 | - in_array( $key, array( 'OR', 'AND', 'NOT' ) ) |
|
116 | - || strpos( $key, 'OR*' ) !== false |
|
117 | - || strpos( $key, 'AND*' ) !== false |
|
118 | - || strpos( $key, 'NOT*' ) !== false |
|
115 | + in_array($key, array('OR', 'AND', 'NOT')) |
|
116 | + || strpos($key, 'OR*') !== false |
|
117 | + || strpos($key, 'AND*') !== false |
|
118 | + || strpos($key, 'NOT*') !== false |
|
119 | 119 | ) { |
120 | - $where_conditions_with_model_relation_chain_prefixes[ $key ] = $this->prepare_where_conditions_for_querying( |
|
120 | + $where_conditions_with_model_relation_chain_prefixes[$key] = $this->prepare_where_conditions_for_querying( |
|
121 | 121 | $value, |
122 | 122 | $model_relation_chain |
123 | 123 | ); |
124 | 124 | } else { |
125 | 125 | if ( |
126 | 126 | $model_relation_chain != '' |
127 | - && $model_relation_chain[ strlen( $model_relation_chain ) - 1 ] != '.' |
|
127 | + && $model_relation_chain[strlen($model_relation_chain) - 1] != '.' |
|
128 | 128 | ) { |
129 | - $model_relation_chain = $model_relation_chain . "."; |
|
129 | + $model_relation_chain = $model_relation_chain."."; |
|
130 | 130 | } |
131 | 131 | //check for the current user id place holder, and if present change it |
132 | - if ( $value === self::current_user_placeholder ) { |
|
132 | + if ($value === self::current_user_placeholder) { |
|
133 | 133 | $value = get_current_user_id(); |
134 | 134 | } |
135 | 135 | //check for user field placeholder |
136 | - if ( $key == self::user_field_name_placeholder ) { |
|
137 | - if ( ! $this->_model->wp_user_field_name() ) { |
|
136 | + if ($key == self::user_field_name_placeholder) { |
|
137 | + if ( ! $this->_model->wp_user_field_name()) { |
|
138 | 138 | throw new EE_Error( |
139 | 139 | sprintf( |
140 | 140 | __( |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | $key = $this->_model->wp_user_field_name(); |
149 | 149 | } |
150 | - $where_conditions_with_model_relation_chain_prefixes[ $model_relation_chain . $key ] = $value; |
|
150 | + $where_conditions_with_model_relation_chain_prefixes[$model_relation_chain.$key] = $value; |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | return $where_conditions_with_model_relation_chain_prefixes; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | /** |
6 | 6 | * |
7 | 7 | * Class EE_Default_Where_Conditions |
8 | - * |
|
8 | + * |
|
9 | 9 | * Strategy to be used for getting default where conditions for EEM_Base children. |
10 | 10 | * Should be initialized and set on construction of model |
11 | 11 | * |