@@ -18,27 +18,27 @@ |
||
18 | 18 | */ |
19 | 19 | class ModelConfigurationException extends DomainException |
20 | 20 | { |
21 | - /** |
|
22 | - * ModelConfigurationException constructor. |
|
23 | - * |
|
24 | - * @param EEM_Base $model |
|
25 | - * @param string $message Describe what's misconfigured about this model (don't bother mentioning which model, |
|
26 | - * that will be automatically added to the message based on the $model provided in the previous parameter). |
|
27 | - * @param int $code |
|
28 | - * @param Exception $previous |
|
29 | - */ |
|
30 | - public function __construct(EEM_Base $model, $message, $code = 0, Exception $previous = null) |
|
31 | - { |
|
32 | - $message_part_1 = sprintf( |
|
33 | - /* |
|
21 | + /** |
|
22 | + * ModelConfigurationException constructor. |
|
23 | + * |
|
24 | + * @param EEM_Base $model |
|
25 | + * @param string $message Describe what's misconfigured about this model (don't bother mentioning which model, |
|
26 | + * that will be automatically added to the message based on the $model provided in the previous parameter). |
|
27 | + * @param int $code |
|
28 | + * @param Exception $previous |
|
29 | + */ |
|
30 | + public function __construct(EEM_Base $model, $message, $code = 0, Exception $previous = null) |
|
31 | + { |
|
32 | + $message_part_1 = sprintf( |
|
33 | + /* |
|
34 | 34 | * translators: 1: the model name |
35 | 35 | */ |
36 | - esc_html__('The model "%1$s" appears to be misconfigured.', 'event_espresso'), |
|
37 | - $model->get_this_model_name() |
|
38 | - ); |
|
39 | - $message = $message_part_1 . ' ' . $message; |
|
40 | - parent::__construct($message, $code, $previous); |
|
41 | - } |
|
36 | + esc_html__('The model "%1$s" appears to be misconfigured.', 'event_espresso'), |
|
37 | + $model->get_this_model_name() |
|
38 | + ); |
|
39 | + $message = $message_part_1 . ' ' . $message; |
|
40 | + parent::__construct($message, $code, $previous); |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | // End of file ModelConfigurationException.php |
44 | 44 | // Location: EventEspresso\core\exceptions/ModelConfigurationException.php |
@@ -36,7 +36,7 @@ |
||
36 | 36 | esc_html__('The model "%1$s" appears to be misconfigured.', 'event_espresso'), |
37 | 37 | $model->get_this_model_name() |
38 | 38 | ); |
39 | - $message = $message_part_1 . ' ' . $message; |
|
39 | + $message = $message_part_1.' '.$message; |
|
40 | 40 | parent::__construct($message, $code, $previous); |
41 | 41 | } |
42 | 42 | } |
@@ -16,17 +16,17 @@ |
||
16 | 16 | */ |
17 | 17 | class RestPasswordIncorrectException extends RestException |
18 | 18 | { |
19 | - public function __construct($previous = null) |
|
20 | - { |
|
21 | - parent::__construct( |
|
22 | - 'rest_post_incorrect_password', |
|
23 | - esc_html__('Incorrect password.', 'event_espresso'), |
|
24 | - array( |
|
25 | - 'status' => 403, |
|
26 | - ), |
|
27 | - $previous |
|
28 | - ); |
|
29 | - } |
|
19 | + public function __construct($previous = null) |
|
20 | + { |
|
21 | + parent::__construct( |
|
22 | + 'rest_post_incorrect_password', |
|
23 | + esc_html__('Incorrect password.', 'event_espresso'), |
|
24 | + array( |
|
25 | + 'status' => 403, |
|
26 | + ), |
|
27 | + $previous |
|
28 | + ); |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | // End of file RestPasswordIncorrectException.php |
32 | 32 | // Location: EventEspresso\core\exceptions/RestPasswordIncorrectException.php |
@@ -42,10 +42,10 @@ |
||
42 | 42 | ); |
43 | 43 | // this model is generally available for reading |
44 | 44 | $path_to_event = 'Datetime.Event'; |
45 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
46 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
47 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
48 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
45 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
46 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
47 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
48 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
49 | 49 | $this->model_chain_to_password = $path_to_event; |
50 | 50 | parent::__construct($timezone); |
51 | 51 | } |
@@ -11,41 +11,41 @@ |
||
11 | 11 | */ |
12 | 12 | class EEM_Datetime_Ticket extends EEM_Base |
13 | 13 | { |
14 | - // private instance of the EEM_Datetime_Ticket object |
|
15 | - protected static $_instance = null; |
|
14 | + // private instance of the EEM_Datetime_Ticket object |
|
15 | + protected static $_instance = null; |
|
16 | 16 | |
17 | - /** |
|
18 | - * private constructor to prevent direct creation |
|
19 | - * @Constructor |
|
20 | - * @access private |
|
21 | - * @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) |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - protected function __construct($timezone) |
|
25 | - { |
|
26 | - $this->singular_item = esc_html__('Datetime Ticket', 'event_espresso'); |
|
27 | - $this->plural_item = esc_html__('Datetime Tickets', 'event_espresso'); |
|
17 | + /** |
|
18 | + * private constructor to prevent direct creation |
|
19 | + * @Constructor |
|
20 | + * @access private |
|
21 | + * @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) |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + protected function __construct($timezone) |
|
25 | + { |
|
26 | + $this->singular_item = esc_html__('Datetime Ticket', 'event_espresso'); |
|
27 | + $this->plural_item = esc_html__('Datetime Tickets', 'event_espresso'); |
|
28 | 28 | |
29 | - $this->_tables = array( |
|
30 | - 'Datetime_Ticket' => new EE_Primary_Table('esp_datetime_ticket', 'DTK_ID') |
|
31 | - ); |
|
32 | - $this->_fields = array( |
|
33 | - 'Datetime_Ticket' => array( |
|
34 | - 'DTK_ID' => new EE_Primary_Key_Int_Field('DTK_ID', esc_html__('Datetime Ticket ID', 'event_espresso')), |
|
35 | - 'DTT_ID' => new EE_Foreign_Key_Int_Field('DTT_ID', esc_html__('The ID to the Datetime', 'event_espresso'), false, 0, 'Datetime'), |
|
36 | - 'TKT_ID' => new EE_Foreign_Key_Int_Field('TKT_ID', esc_html__('The ID to the Ticket', 'event_espresso'), false, 0, 'Ticket') |
|
37 | - )); |
|
38 | - $this->_model_relations = array( |
|
39 | - 'Ticket' => new EE_Belongs_To_Relation(), |
|
40 | - 'Datetime' => new EE_Belongs_To_Relation() |
|
41 | - ); |
|
42 | - // this model is generally available for reading |
|
43 | - $path_to_event = 'Datetime.Event'; |
|
44 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
45 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
46 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
47 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
48 | - $this->model_chain_to_password = $path_to_event; |
|
49 | - parent::__construct($timezone); |
|
50 | - } |
|
29 | + $this->_tables = array( |
|
30 | + 'Datetime_Ticket' => new EE_Primary_Table('esp_datetime_ticket', 'DTK_ID') |
|
31 | + ); |
|
32 | + $this->_fields = array( |
|
33 | + 'Datetime_Ticket' => array( |
|
34 | + 'DTK_ID' => new EE_Primary_Key_Int_Field('DTK_ID', esc_html__('Datetime Ticket ID', 'event_espresso')), |
|
35 | + 'DTT_ID' => new EE_Foreign_Key_Int_Field('DTT_ID', esc_html__('The ID to the Datetime', 'event_espresso'), false, 0, 'Datetime'), |
|
36 | + 'TKT_ID' => new EE_Foreign_Key_Int_Field('TKT_ID', esc_html__('The ID to the Ticket', 'event_espresso'), false, 0, 'Ticket') |
|
37 | + )); |
|
38 | + $this->_model_relations = array( |
|
39 | + 'Ticket' => new EE_Belongs_To_Relation(), |
|
40 | + 'Datetime' => new EE_Belongs_To_Relation() |
|
41 | + ); |
|
42 | + // this model is generally available for reading |
|
43 | + $path_to_event = 'Datetime.Event'; |
|
44 | + $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
45 | + $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
46 | + $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
47 | + $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
48 | + $this->model_chain_to_password = $path_to_event; |
|
49 | + parent::__construct($timezone); |
|
50 | + } |
|
51 | 51 | } |
@@ -191,7 +191,7 @@ |
||
191 | 191 | 'Term_Taxonomy' => new EE_HABTM_Relation('Term_Relationship'), |
192 | 192 | ); |
193 | 193 | // this model is generally available for reading |
194 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public(); |
|
194 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public(); |
|
195 | 195 | $this->model_chain_to_password = ''; |
196 | 196 | parent::__construct($timezone); |
197 | 197 | } |
@@ -10,189 +10,189 @@ |
||
10 | 10 | */ |
11 | 11 | class EEM_Venue extends EEM_CPT_Base |
12 | 12 | { |
13 | - // private instance of the Attendee object |
|
14 | - protected static $_instance = null; |
|
13 | + // private instance of the Attendee object |
|
14 | + protected static $_instance = null; |
|
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | - protected function __construct($timezone = null) |
|
19 | - { |
|
20 | - $this->singular_item = esc_html__('Venue', 'event_espresso'); |
|
21 | - $this->plural_item = esc_html__('Venues', 'event_espresso'); |
|
22 | - $this->_tables = array( |
|
23 | - 'Venue_CPT' => new EE_Primary_Table('posts', 'ID'), |
|
24 | - 'Venue_Meta' => new EE_Secondary_Table('esp_venue_meta', 'VNUM_ID', 'VNU_ID'), |
|
25 | - ); |
|
26 | - $this->_fields = array( |
|
27 | - 'Venue_CPT' => array( |
|
28 | - 'VNU_ID' => new EE_Primary_Key_Int_Field('ID', esc_html__("Venue ID", "event_espresso")), |
|
29 | - 'VNU_name' => new EE_Plain_Text_Field( |
|
30 | - 'post_title', |
|
31 | - esc_html__("Venue Name", "event_espresso"), |
|
32 | - false, |
|
33 | - '' |
|
34 | - ), |
|
35 | - 'VNU_desc' => new EE_Post_Content_Field( |
|
36 | - 'post_content', |
|
37 | - esc_html__("Venue Description", "event_espresso"), |
|
38 | - false, |
|
39 | - '' |
|
40 | - ), |
|
41 | - 'VNU_identifier' => new EE_Slug_Field('post_name', esc_html__("Venue Identifier", "event_espresso"), false, ''), |
|
42 | - 'VNU_created' => new EE_Datetime_Field( |
|
43 | - 'post_date', |
|
44 | - esc_html__("Date Venue Created", "event_espresso"), |
|
45 | - false, |
|
46 | - EE_Datetime_Field::now |
|
47 | - ), |
|
48 | - 'VNU_short_desc' => new EE_Plain_Text_Field( |
|
49 | - 'post_excerpt', |
|
50 | - esc_html__("Short Description of Venue", "event_espresso"), |
|
51 | - true, |
|
52 | - '' |
|
53 | - ), |
|
54 | - 'VNU_modified' => new EE_Datetime_Field( |
|
55 | - 'post_modified', |
|
56 | - esc_html__("Venue Modified Date", "event_espresso"), |
|
57 | - false, |
|
58 | - EE_Datetime_Field::now |
|
59 | - ), |
|
60 | - 'VNU_wp_user' => new EE_WP_User_Field( |
|
61 | - 'post_author', |
|
62 | - esc_html__("Venue Creator ID", "event_espresso"), |
|
63 | - false |
|
64 | - ), |
|
65 | - 'parent' => new EE_Integer_Field( |
|
66 | - 'post_parent', |
|
67 | - esc_html__("Venue Parent ID", "event_espresso"), |
|
68 | - false, |
|
69 | - 0 |
|
70 | - ), |
|
71 | - 'VNU_order' => new EE_Integer_Field('menu_order', esc_html__("Venue order", "event_espresso"), false, 1), |
|
72 | - 'post_type' => new EE_WP_Post_Type_Field('espresso_venues'), |
|
73 | - 'password' => new EE_Password_Field( |
|
74 | - 'post_password', |
|
75 | - esc_html__('Password', 'event_espresso'), |
|
76 | - false, |
|
77 | - '', |
|
78 | - array( |
|
79 | - 'VNU_desc', |
|
80 | - 'VNU_short_desc', |
|
81 | - 'VNU_address', |
|
82 | - 'VNU_address2', |
|
83 | - 'VNU_city', |
|
84 | - 'STA_ID', |
|
85 | - 'CNT_ISO', |
|
86 | - 'VNU_zip', |
|
87 | - 'VNU_phone', |
|
88 | - 'VNU_capacity', |
|
89 | - 'VNU_url', |
|
90 | - 'VNU_virtual_phone', |
|
91 | - 'VNU_virtual_url', |
|
92 | - 'VNU_google_map_link', |
|
93 | - 'VNU_enable_for_gmap', |
|
94 | - ) |
|
95 | - ) |
|
96 | - ), |
|
97 | - 'Venue_Meta' => array( |
|
98 | - 'VNUM_ID' => new EE_DB_Only_Int_Field( |
|
99 | - 'VNUM_ID', |
|
100 | - esc_html__("ID of Venue Meta Row", "event_espresso"), |
|
101 | - false |
|
102 | - ), |
|
103 | - 'VNU_ID_fk' => new EE_DB_Only_Int_Field( |
|
104 | - 'VNU_ID', |
|
105 | - esc_html__("Foreign Key to Venue Post ", "event_espresso"), |
|
106 | - false |
|
107 | - ), |
|
108 | - 'VNU_address' => new EE_Plain_Text_Field( |
|
109 | - 'VNU_address', |
|
110 | - esc_html__("Venue Address line 1", "event_espresso"), |
|
111 | - true, |
|
112 | - '' |
|
113 | - ), |
|
114 | - 'VNU_address2' => new EE_Plain_Text_Field( |
|
115 | - 'VNU_address2', |
|
116 | - esc_html__("Venue Address line 2", "event_espresso"), |
|
117 | - true, |
|
118 | - '' |
|
119 | - ), |
|
120 | - 'VNU_city' => new EE_Plain_Text_Field( |
|
121 | - 'VNU_city', |
|
122 | - esc_html__("Venue City", "event_espresso"), |
|
123 | - true, |
|
124 | - '' |
|
125 | - ), |
|
126 | - 'STA_ID' => new EE_Foreign_Key_Int_Field( |
|
127 | - 'STA_ID', |
|
128 | - esc_html__("State ID", "event_espresso"), |
|
129 | - true, |
|
130 | - null, |
|
131 | - 'State' |
|
132 | - ), |
|
133 | - 'CNT_ISO' => new EE_Foreign_Key_String_Field( |
|
134 | - 'CNT_ISO', |
|
135 | - esc_html__("Country Code", "event_espresso"), |
|
136 | - true, |
|
137 | - null, |
|
138 | - 'Country' |
|
139 | - ), |
|
140 | - 'VNU_zip' => new EE_Plain_Text_Field( |
|
141 | - 'VNU_zip', |
|
142 | - esc_html__("Venue Zip/Postal Code", "event_espresso"), |
|
143 | - true |
|
144 | - ), |
|
145 | - 'VNU_phone' => new EE_Plain_Text_Field( |
|
146 | - 'VNU_phone', |
|
147 | - esc_html__("Venue Phone", "event_espresso"), |
|
148 | - true |
|
149 | - ), |
|
150 | - 'VNU_capacity' => new EE_Infinite_Integer_Field( |
|
151 | - 'VNU_capacity', |
|
152 | - esc_html__("Venue Capacity", "event_espresso"), |
|
153 | - true, |
|
154 | - EE_INF |
|
155 | - ), |
|
156 | - 'VNU_url' => new EE_Plain_Text_Field( |
|
157 | - 'VNU_url', |
|
158 | - esc_html__('Venue Website', 'event_espresso'), |
|
159 | - true |
|
160 | - ), |
|
161 | - 'VNU_virtual_phone' => new EE_Plain_Text_Field( |
|
162 | - 'VNU_virtual_phone', |
|
163 | - esc_html__('Call in Number', 'event_espresso'), |
|
164 | - true |
|
165 | - ), |
|
166 | - 'VNU_virtual_url' => new EE_Plain_Text_Field( |
|
167 | - 'VNU_virtual_url', |
|
168 | - esc_html__('Virtual URL', 'event_espresso'), |
|
169 | - true |
|
170 | - ), |
|
171 | - 'VNU_google_map_link' => new EE_Plain_Text_Field( |
|
172 | - 'VNU_google_map_link', |
|
173 | - esc_html__('Google Map Link', 'event_espresso'), |
|
174 | - true |
|
175 | - ), |
|
176 | - 'VNU_enable_for_gmap' => new EE_Boolean_Field( |
|
177 | - 'VNU_enable_for_gmap', |
|
178 | - esc_html__('Show Google Map?', 'event_espresso'), |
|
179 | - false, |
|
180 | - false |
|
181 | - ), |
|
182 | - ), |
|
183 | - ); |
|
184 | - $this->_model_relations = array( |
|
185 | - 'Event' => new EE_HABTM_Relation('Event_Venue'), |
|
186 | - 'State' => new EE_Belongs_To_Relation(), |
|
187 | - 'Country' => new EE_Belongs_To_Relation(), |
|
188 | - 'Event_Venue' => new EE_Has_Many_Relation(), |
|
189 | - 'WP_User' => new EE_Belongs_To_Relation(), |
|
190 | - 'Term_Relationship' => new EE_Has_Many_Relation(), |
|
191 | - 'Term_Taxonomy' => new EE_HABTM_Relation('Term_Relationship'), |
|
192 | - ); |
|
193 | - // this model is generally available for reading |
|
194 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public(); |
|
195 | - $this->model_chain_to_password = ''; |
|
196 | - parent::__construct($timezone); |
|
197 | - } |
|
18 | + protected function __construct($timezone = null) |
|
19 | + { |
|
20 | + $this->singular_item = esc_html__('Venue', 'event_espresso'); |
|
21 | + $this->plural_item = esc_html__('Venues', 'event_espresso'); |
|
22 | + $this->_tables = array( |
|
23 | + 'Venue_CPT' => new EE_Primary_Table('posts', 'ID'), |
|
24 | + 'Venue_Meta' => new EE_Secondary_Table('esp_venue_meta', 'VNUM_ID', 'VNU_ID'), |
|
25 | + ); |
|
26 | + $this->_fields = array( |
|
27 | + 'Venue_CPT' => array( |
|
28 | + 'VNU_ID' => new EE_Primary_Key_Int_Field('ID', esc_html__("Venue ID", "event_espresso")), |
|
29 | + 'VNU_name' => new EE_Plain_Text_Field( |
|
30 | + 'post_title', |
|
31 | + esc_html__("Venue Name", "event_espresso"), |
|
32 | + false, |
|
33 | + '' |
|
34 | + ), |
|
35 | + 'VNU_desc' => new EE_Post_Content_Field( |
|
36 | + 'post_content', |
|
37 | + esc_html__("Venue Description", "event_espresso"), |
|
38 | + false, |
|
39 | + '' |
|
40 | + ), |
|
41 | + 'VNU_identifier' => new EE_Slug_Field('post_name', esc_html__("Venue Identifier", "event_espresso"), false, ''), |
|
42 | + 'VNU_created' => new EE_Datetime_Field( |
|
43 | + 'post_date', |
|
44 | + esc_html__("Date Venue Created", "event_espresso"), |
|
45 | + false, |
|
46 | + EE_Datetime_Field::now |
|
47 | + ), |
|
48 | + 'VNU_short_desc' => new EE_Plain_Text_Field( |
|
49 | + 'post_excerpt', |
|
50 | + esc_html__("Short Description of Venue", "event_espresso"), |
|
51 | + true, |
|
52 | + '' |
|
53 | + ), |
|
54 | + 'VNU_modified' => new EE_Datetime_Field( |
|
55 | + 'post_modified', |
|
56 | + esc_html__("Venue Modified Date", "event_espresso"), |
|
57 | + false, |
|
58 | + EE_Datetime_Field::now |
|
59 | + ), |
|
60 | + 'VNU_wp_user' => new EE_WP_User_Field( |
|
61 | + 'post_author', |
|
62 | + esc_html__("Venue Creator ID", "event_espresso"), |
|
63 | + false |
|
64 | + ), |
|
65 | + 'parent' => new EE_Integer_Field( |
|
66 | + 'post_parent', |
|
67 | + esc_html__("Venue Parent ID", "event_espresso"), |
|
68 | + false, |
|
69 | + 0 |
|
70 | + ), |
|
71 | + 'VNU_order' => new EE_Integer_Field('menu_order', esc_html__("Venue order", "event_espresso"), false, 1), |
|
72 | + 'post_type' => new EE_WP_Post_Type_Field('espresso_venues'), |
|
73 | + 'password' => new EE_Password_Field( |
|
74 | + 'post_password', |
|
75 | + esc_html__('Password', 'event_espresso'), |
|
76 | + false, |
|
77 | + '', |
|
78 | + array( |
|
79 | + 'VNU_desc', |
|
80 | + 'VNU_short_desc', |
|
81 | + 'VNU_address', |
|
82 | + 'VNU_address2', |
|
83 | + 'VNU_city', |
|
84 | + 'STA_ID', |
|
85 | + 'CNT_ISO', |
|
86 | + 'VNU_zip', |
|
87 | + 'VNU_phone', |
|
88 | + 'VNU_capacity', |
|
89 | + 'VNU_url', |
|
90 | + 'VNU_virtual_phone', |
|
91 | + 'VNU_virtual_url', |
|
92 | + 'VNU_google_map_link', |
|
93 | + 'VNU_enable_for_gmap', |
|
94 | + ) |
|
95 | + ) |
|
96 | + ), |
|
97 | + 'Venue_Meta' => array( |
|
98 | + 'VNUM_ID' => new EE_DB_Only_Int_Field( |
|
99 | + 'VNUM_ID', |
|
100 | + esc_html__("ID of Venue Meta Row", "event_espresso"), |
|
101 | + false |
|
102 | + ), |
|
103 | + 'VNU_ID_fk' => new EE_DB_Only_Int_Field( |
|
104 | + 'VNU_ID', |
|
105 | + esc_html__("Foreign Key to Venue Post ", "event_espresso"), |
|
106 | + false |
|
107 | + ), |
|
108 | + 'VNU_address' => new EE_Plain_Text_Field( |
|
109 | + 'VNU_address', |
|
110 | + esc_html__("Venue Address line 1", "event_espresso"), |
|
111 | + true, |
|
112 | + '' |
|
113 | + ), |
|
114 | + 'VNU_address2' => new EE_Plain_Text_Field( |
|
115 | + 'VNU_address2', |
|
116 | + esc_html__("Venue Address line 2", "event_espresso"), |
|
117 | + true, |
|
118 | + '' |
|
119 | + ), |
|
120 | + 'VNU_city' => new EE_Plain_Text_Field( |
|
121 | + 'VNU_city', |
|
122 | + esc_html__("Venue City", "event_espresso"), |
|
123 | + true, |
|
124 | + '' |
|
125 | + ), |
|
126 | + 'STA_ID' => new EE_Foreign_Key_Int_Field( |
|
127 | + 'STA_ID', |
|
128 | + esc_html__("State ID", "event_espresso"), |
|
129 | + true, |
|
130 | + null, |
|
131 | + 'State' |
|
132 | + ), |
|
133 | + 'CNT_ISO' => new EE_Foreign_Key_String_Field( |
|
134 | + 'CNT_ISO', |
|
135 | + esc_html__("Country Code", "event_espresso"), |
|
136 | + true, |
|
137 | + null, |
|
138 | + 'Country' |
|
139 | + ), |
|
140 | + 'VNU_zip' => new EE_Plain_Text_Field( |
|
141 | + 'VNU_zip', |
|
142 | + esc_html__("Venue Zip/Postal Code", "event_espresso"), |
|
143 | + true |
|
144 | + ), |
|
145 | + 'VNU_phone' => new EE_Plain_Text_Field( |
|
146 | + 'VNU_phone', |
|
147 | + esc_html__("Venue Phone", "event_espresso"), |
|
148 | + true |
|
149 | + ), |
|
150 | + 'VNU_capacity' => new EE_Infinite_Integer_Field( |
|
151 | + 'VNU_capacity', |
|
152 | + esc_html__("Venue Capacity", "event_espresso"), |
|
153 | + true, |
|
154 | + EE_INF |
|
155 | + ), |
|
156 | + 'VNU_url' => new EE_Plain_Text_Field( |
|
157 | + 'VNU_url', |
|
158 | + esc_html__('Venue Website', 'event_espresso'), |
|
159 | + true |
|
160 | + ), |
|
161 | + 'VNU_virtual_phone' => new EE_Plain_Text_Field( |
|
162 | + 'VNU_virtual_phone', |
|
163 | + esc_html__('Call in Number', 'event_espresso'), |
|
164 | + true |
|
165 | + ), |
|
166 | + 'VNU_virtual_url' => new EE_Plain_Text_Field( |
|
167 | + 'VNU_virtual_url', |
|
168 | + esc_html__('Virtual URL', 'event_espresso'), |
|
169 | + true |
|
170 | + ), |
|
171 | + 'VNU_google_map_link' => new EE_Plain_Text_Field( |
|
172 | + 'VNU_google_map_link', |
|
173 | + esc_html__('Google Map Link', 'event_espresso'), |
|
174 | + true |
|
175 | + ), |
|
176 | + 'VNU_enable_for_gmap' => new EE_Boolean_Field( |
|
177 | + 'VNU_enable_for_gmap', |
|
178 | + esc_html__('Show Google Map?', 'event_espresso'), |
|
179 | + false, |
|
180 | + false |
|
181 | + ), |
|
182 | + ), |
|
183 | + ); |
|
184 | + $this->_model_relations = array( |
|
185 | + 'Event' => new EE_HABTM_Relation('Event_Venue'), |
|
186 | + 'State' => new EE_Belongs_To_Relation(), |
|
187 | + 'Country' => new EE_Belongs_To_Relation(), |
|
188 | + 'Event_Venue' => new EE_Has_Many_Relation(), |
|
189 | + 'WP_User' => new EE_Belongs_To_Relation(), |
|
190 | + 'Term_Relationship' => new EE_Has_Many_Relation(), |
|
191 | + 'Term_Taxonomy' => new EE_HABTM_Relation('Term_Relationship'), |
|
192 | + ); |
|
193 | + // this model is generally available for reading |
|
194 | + $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public(); |
|
195 | + $this->model_chain_to_password = ''; |
|
196 | + parent::__construct($timezone); |
|
197 | + } |
|
198 | 198 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | ); |
33 | 33 | // this model is generally available for reading |
34 | 34 | $path_to_event = 'Event'; |
35 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
36 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
37 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
38 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
35 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
36 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
37 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
38 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
39 | 39 | $this->model_chain_to_password = $path_to_event; |
40 | 40 | parent::__construct($timezone); |
41 | 41 | } |
@@ -8,36 +8,36 @@ |
||
8 | 8 | */ |
9 | 9 | class EEM_Event_Venue extends EEM_Base |
10 | 10 | { |
11 | - // private instance of the Attendee object |
|
12 | - protected static $_instance = null; |
|
11 | + // private instance of the Attendee object |
|
12 | + protected static $_instance = null; |
|
13 | 13 | |
14 | - protected function __construct($timezone = null) |
|
15 | - { |
|
16 | - $this->singular_item = esc_html__('Event to Question Group Link', 'event_espresso'); |
|
17 | - $this->plural_item = esc_html__('Event to Question Group Links', 'event_espresso'); |
|
18 | - $this->_tables = array( |
|
19 | - 'Event_Venue' => new EE_Primary_Table('esp_event_venue', 'EVV_ID') |
|
20 | - ); |
|
21 | - $this->_fields = array( |
|
22 | - 'Event_Venue' => array( |
|
23 | - 'EVV_ID' => new EE_Primary_Key_Int_Field('EVV_ID', esc_html__('Event to Venue Link ID', 'event_espresso')), |
|
24 | - 'EVT_ID' => new EE_Foreign_Key_Int_Field('EVT_ID', esc_html__('Event ID', 'event_espresso'), false, 0, 'Event'), |
|
25 | - 'VNU_ID' => new EE_Foreign_Key_Int_Field('VNU_ID', esc_html__('Venue ID', 'event_espresso'), false, 0, 'Venue'), |
|
26 | - 'EVV_primary' => new EE_Boolean_Field('EVV_primary', esc_html__("Flag indicating venue is primary one for event", "event_espresso"), false, true) |
|
14 | + protected function __construct($timezone = null) |
|
15 | + { |
|
16 | + $this->singular_item = esc_html__('Event to Question Group Link', 'event_espresso'); |
|
17 | + $this->plural_item = esc_html__('Event to Question Group Links', 'event_espresso'); |
|
18 | + $this->_tables = array( |
|
19 | + 'Event_Venue' => new EE_Primary_Table('esp_event_venue', 'EVV_ID') |
|
20 | + ); |
|
21 | + $this->_fields = array( |
|
22 | + 'Event_Venue' => array( |
|
23 | + 'EVV_ID' => new EE_Primary_Key_Int_Field('EVV_ID', esc_html__('Event to Venue Link ID', 'event_espresso')), |
|
24 | + 'EVT_ID' => new EE_Foreign_Key_Int_Field('EVT_ID', esc_html__('Event ID', 'event_espresso'), false, 0, 'Event'), |
|
25 | + 'VNU_ID' => new EE_Foreign_Key_Int_Field('VNU_ID', esc_html__('Venue ID', 'event_espresso'), false, 0, 'Venue'), |
|
26 | + 'EVV_primary' => new EE_Boolean_Field('EVV_primary', esc_html__("Flag indicating venue is primary one for event", "event_espresso"), false, true) |
|
27 | 27 | |
28 | - ) |
|
29 | - ); |
|
30 | - $this->_model_relations = array( |
|
31 | - 'Event' => new EE_Belongs_To_Relation(), |
|
32 | - 'Venue' => new EE_Belongs_To_Relation() |
|
33 | - ); |
|
34 | - // this model is generally available for reading |
|
35 | - $path_to_event = 'Event'; |
|
36 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
37 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
38 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
39 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
40 | - $this->model_chain_to_password = $path_to_event; |
|
41 | - parent::__construct($timezone); |
|
42 | - } |
|
28 | + ) |
|
29 | + ); |
|
30 | + $this->_model_relations = array( |
|
31 | + 'Event' => new EE_Belongs_To_Relation(), |
|
32 | + 'Venue' => new EE_Belongs_To_Relation() |
|
33 | + ); |
|
34 | + // this model is generally available for reading |
|
35 | + $path_to_event = 'Event'; |
|
36 | + $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
37 | + $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
38 | + $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
39 | + $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
40 | + $this->model_chain_to_password = $path_to_event; |
|
41 | + parent::__construct($timezone); |
|
42 | + } |
|
43 | 43 | } |
@@ -12,45 +12,45 @@ |
||
12 | 12 | */ |
13 | 13 | class EE_Password_Field extends EE_Text_Field_Base |
14 | 14 | { |
15 | - /** |
|
16 | - * @var array |
|
17 | - */ |
|
18 | - protected $protected_fields; |
|
15 | + /** |
|
16 | + * @var array |
|
17 | + */ |
|
18 | + protected $protected_fields; |
|
19 | 19 | |
20 | - /** |
|
21 | - * EE_Password_Field constructor. |
|
22 | - * @param $table_column |
|
23 | - * @param $nicename |
|
24 | - * @param $nullable |
|
25 | - * @param null $default_value |
|
26 | - * @param array $protected_fields |
|
27 | - */ |
|
28 | - public function __construct($table_column, $nicename, $nullable, $default_value = null, $protected_fields = array()) |
|
29 | - { |
|
30 | - $this->protected_fields = $protected_fields; |
|
31 | - parent::__construct($table_column, $nicename, $nullable, $default_value); |
|
32 | - } |
|
20 | + /** |
|
21 | + * EE_Password_Field constructor. |
|
22 | + * @param $table_column |
|
23 | + * @param $nicename |
|
24 | + * @param $nullable |
|
25 | + * @param null $default_value |
|
26 | + * @param array $protected_fields |
|
27 | + */ |
|
28 | + public function __construct($table_column, $nicename, $nullable, $default_value = null, $protected_fields = array()) |
|
29 | + { |
|
30 | + $this->protected_fields = $protected_fields; |
|
31 | + parent::__construct($table_column, $nicename, $nullable, $default_value); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Returns the names of the fields on this model that this password field should protect |
|
36 | - * @since 4.9.74.p |
|
37 | - * @return array |
|
38 | - */ |
|
39 | - public function protectedFields() |
|
40 | - { |
|
41 | - return $this->protected_fields; |
|
42 | - } |
|
34 | + /** |
|
35 | + * Returns the names of the fields on this model that this password field should protect |
|
36 | + * @since 4.9.74.p |
|
37 | + * @return array |
|
38 | + */ |
|
39 | + public function protectedFields() |
|
40 | + { |
|
41 | + return $this->protected_fields; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * Returns whether or not the specified field is protected by this model |
|
46 | - * @since 4.9.74.p |
|
47 | - * @param $field_name |
|
48 | - * @return bool |
|
49 | - */ |
|
50 | - public function fieldIsProtected($field_name) |
|
51 | - { |
|
52 | - return in_array($field_name, $this->protectedFields(), true); |
|
53 | - } |
|
44 | + /** |
|
45 | + * Returns whether or not the specified field is protected by this model |
|
46 | + * @since 4.9.74.p |
|
47 | + * @param $field_name |
|
48 | + * @return bool |
|
49 | + */ |
|
50 | + public function fieldIsProtected($field_name) |
|
51 | + { |
|
52 | + return in_array($field_name, $this->protectedFields(), true); |
|
53 | + } |
|
54 | 54 | } |
55 | 55 | // End of file EE_Password_Field.php |
56 | 56 | // Location: ${NAMESPACE}/EE_Password_Field.php |
@@ -57,7 +57,7 @@ |
||
57 | 57 | * check whether count of tickets is approaching the potential |
58 | 58 | * limits for the server. |
59 | 59 | */ |
60 | - if (! empty($data['input_count'])) { |
|
60 | + if ( ! empty($data['input_count'])) { |
|
61 | 61 | $response['max_input_vars_check'] = $this->environment->max_input_vars_limit_check( |
62 | 62 | $data['input_count'] |
63 | 63 | ); |
@@ -15,52 +15,52 @@ |
||
15 | 15 | */ |
16 | 16 | class EventEditorHeartbeat |
17 | 17 | { |
18 | - /** |
|
19 | - * @var Domain $domain |
|
20 | - */ |
|
21 | - protected $domain; |
|
18 | + /** |
|
19 | + * @var Domain $domain |
|
20 | + */ |
|
21 | + protected $domain; |
|
22 | 22 | |
23 | - /** |
|
24 | - * @var EE_Environment_Config $environment |
|
25 | - */ |
|
26 | - protected $environment; |
|
23 | + /** |
|
24 | + * @var EE_Environment_Config $environment |
|
25 | + */ |
|
26 | + protected $environment; |
|
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * EventEditorHeartbeat constructor. |
|
31 | - * |
|
32 | - * @param Domain $domain |
|
33 | - * @param EE_Environment_Config $environment |
|
34 | - */ |
|
35 | - public function __construct(Domain $domain, EE_Environment_Config $environment) |
|
36 | - { |
|
37 | - $this->domain = $domain; |
|
38 | - $this->environment = $environment; |
|
39 | - if ($this->domain->isCaffeinated()) { |
|
40 | - add_filter('heartbeat_received', array($this, 'heartbeatResponse'), 10, 2); |
|
41 | - } |
|
42 | - } |
|
29 | + /** |
|
30 | + * EventEditorHeartbeat constructor. |
|
31 | + * |
|
32 | + * @param Domain $domain |
|
33 | + * @param EE_Environment_Config $environment |
|
34 | + */ |
|
35 | + public function __construct(Domain $domain, EE_Environment_Config $environment) |
|
36 | + { |
|
37 | + $this->domain = $domain; |
|
38 | + $this->environment = $environment; |
|
39 | + if ($this->domain->isCaffeinated()) { |
|
40 | + add_filter('heartbeat_received', array($this, 'heartbeatResponse'), 10, 2); |
|
41 | + } |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | - /** |
|
46 | - * This will be used to listen for any heartbeat data packages coming via the WordPress heartbeat API and handle |
|
47 | - * accordingly. |
|
48 | - * |
|
49 | - * @param array $response The existing heartbeat response array. |
|
50 | - * @param array $data The incoming data package. |
|
51 | - * @return array possibly appended response. |
|
52 | - */ |
|
53 | - public function heartbeatResponse($response, $data) |
|
54 | - { |
|
55 | - /** |
|
56 | - * check whether count of tickets is approaching the potential |
|
57 | - * limits for the server. |
|
58 | - */ |
|
59 | - if (! empty($data['input_count'])) { |
|
60 | - $response['max_input_vars_check'] = $this->environment->max_input_vars_limit_check( |
|
61 | - $data['input_count'] |
|
62 | - ); |
|
63 | - } |
|
64 | - return $response; |
|
65 | - } |
|
45 | + /** |
|
46 | + * This will be used to listen for any heartbeat data packages coming via the WordPress heartbeat API and handle |
|
47 | + * accordingly. |
|
48 | + * |
|
49 | + * @param array $response The existing heartbeat response array. |
|
50 | + * @param array $data The incoming data package. |
|
51 | + * @return array possibly appended response. |
|
52 | + */ |
|
53 | + public function heartbeatResponse($response, $data) |
|
54 | + { |
|
55 | + /** |
|
56 | + * check whether count of tickets is approaching the potential |
|
57 | + * limits for the server. |
|
58 | + */ |
|
59 | + if (! empty($data['input_count'])) { |
|
60 | + $response['max_input_vars_check'] = $this->environment->max_input_vars_limit_check( |
|
61 | + $data['input_count'] |
|
62 | + ); |
|
63 | + } |
|
64 | + return $response; |
|
65 | + } |
|
66 | 66 | } |
@@ -19,53 +19,53 @@ |
||
19 | 19 | */ |
20 | 20 | class SettingsForm extends PayPalSettingsForm |
21 | 21 | { |
22 | - /** |
|
23 | - * SettingsForm constructor. |
|
24 | - * |
|
25 | - * @param array $options_array |
|
26 | - * @param string $help_tab_link |
|
27 | - * @throws InvalidDataTypeException |
|
28 | - * @throws InvalidInterfaceException |
|
29 | - * @throws InvalidArgumentException |
|
30 | - */ |
|
31 | - public function __construct(array $options_array = array(), $help_tab_link = '') |
|
32 | - { |
|
33 | - $options_array = array_replace_recursive( |
|
34 | - array( |
|
35 | - 'extra_meta_inputs' => array( |
|
36 | - 'request_shipping_addr' => new EE_Yes_No_Input( |
|
37 | - array( |
|
38 | - 'html_label_text' => sprintf( |
|
39 | - esc_html__('Request Shipping Address %s', 'event_espresso'), |
|
40 | - $help_tab_link |
|
41 | - ), |
|
42 | - 'html_help_text' => esc_html__( |
|
43 | - // @codingStandardsIgnoreStart |
|
44 | - 'If set to "Yes", then a shipping address will be requested on the PayPal checkout page.', |
|
45 | - // @codingStandardsIgnoreEnd |
|
46 | - 'event_espresso' |
|
47 | - ), |
|
48 | - 'required' => true, |
|
49 | - 'default' => false, |
|
50 | - ) |
|
51 | - ), |
|
52 | - 'image_url' => new EE_Admin_File_Uploader_Input( |
|
53 | - array( |
|
54 | - 'html_label_text' => sprintf( |
|
55 | - esc_html__('Image URL %s', 'event_espresso'), |
|
56 | - $help_tab_link |
|
57 | - ), |
|
58 | - 'html_help_text' => esc_html__( |
|
59 | - 'Used for your business/personal logo on the PayPal page', |
|
60 | - 'event_espresso' |
|
61 | - ), |
|
62 | - 'required' => false, |
|
63 | - ) |
|
64 | - ), |
|
65 | - ) |
|
66 | - ), |
|
67 | - $options_array |
|
68 | - ); |
|
69 | - parent::__construct($options_array, $help_tab_link); |
|
70 | - } |
|
22 | + /** |
|
23 | + * SettingsForm constructor. |
|
24 | + * |
|
25 | + * @param array $options_array |
|
26 | + * @param string $help_tab_link |
|
27 | + * @throws InvalidDataTypeException |
|
28 | + * @throws InvalidInterfaceException |
|
29 | + * @throws InvalidArgumentException |
|
30 | + */ |
|
31 | + public function __construct(array $options_array = array(), $help_tab_link = '') |
|
32 | + { |
|
33 | + $options_array = array_replace_recursive( |
|
34 | + array( |
|
35 | + 'extra_meta_inputs' => array( |
|
36 | + 'request_shipping_addr' => new EE_Yes_No_Input( |
|
37 | + array( |
|
38 | + 'html_label_text' => sprintf( |
|
39 | + esc_html__('Request Shipping Address %s', 'event_espresso'), |
|
40 | + $help_tab_link |
|
41 | + ), |
|
42 | + 'html_help_text' => esc_html__( |
|
43 | + // @codingStandardsIgnoreStart |
|
44 | + 'If set to "Yes", then a shipping address will be requested on the PayPal checkout page.', |
|
45 | + // @codingStandardsIgnoreEnd |
|
46 | + 'event_espresso' |
|
47 | + ), |
|
48 | + 'required' => true, |
|
49 | + 'default' => false, |
|
50 | + ) |
|
51 | + ), |
|
52 | + 'image_url' => new EE_Admin_File_Uploader_Input( |
|
53 | + array( |
|
54 | + 'html_label_text' => sprintf( |
|
55 | + esc_html__('Image URL %s', 'event_espresso'), |
|
56 | + $help_tab_link |
|
57 | + ), |
|
58 | + 'html_help_text' => esc_html__( |
|
59 | + 'Used for your business/personal logo on the PayPal page', |
|
60 | + 'event_espresso' |
|
61 | + ), |
|
62 | + 'required' => false, |
|
63 | + ) |
|
64 | + ), |
|
65 | + ) |
|
66 | + ), |
|
67 | + $options_array |
|
68 | + ); |
|
69 | + parent::__construct($options_array, $help_tab_link); |
|
70 | + } |
|
71 | 71 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | ); |
33 | 33 | // this model is generally available for reading |
34 | 34 | $path_to_event = 'Event'; |
35 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
36 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
37 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
38 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
35 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
36 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
37 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
38 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
39 | 39 | parent::__construct($timezone); |
40 | 40 | } |
41 | 41 |
@@ -8,72 +8,72 @@ |
||
8 | 8 | */ |
9 | 9 | class EEM_Event_Question_Group extends EEM_Base |
10 | 10 | { |
11 | - /** |
|
12 | - * Name of the field indicating an event should use the question group for the primary attendee |
|
13 | - */ |
|
14 | - const PRIMARY = 'EQG_primary'; |
|
11 | + /** |
|
12 | + * Name of the field indicating an event should use the question group for the primary attendee |
|
13 | + */ |
|
14 | + const PRIMARY = 'EQG_primary'; |
|
15 | 15 | |
16 | - /** |
|
17 | - * Name of hte field indicating an event should use the question group for additional attendees |
|
18 | - */ |
|
19 | - const ADDITIONAL = 'EQG_additional'; |
|
16 | + /** |
|
17 | + * Name of hte field indicating an event should use the question group for additional attendees |
|
18 | + */ |
|
19 | + const ADDITIONAL = 'EQG_additional'; |
|
20 | 20 | |
21 | - // private instance of the Event_Question_Group object |
|
22 | - protected static $_instance = null; |
|
21 | + // private instance of the Event_Question_Group object |
|
22 | + protected static $_instance = null; |
|
23 | 23 | |
24 | - protected function __construct($timezone = null) |
|
25 | - { |
|
26 | - $this->singular_item = esc_html__('Event to Question Group Link', 'event_espresso'); |
|
27 | - $this->plural_item = esc_html__('Event to Question Group Links', 'event_espresso'); |
|
28 | - $this->_tables = array( |
|
29 | - 'Event_Question_Group' => new EE_Primary_Table('esp_event_question_group', 'EQG_ID') |
|
30 | - ); |
|
31 | - $this->_fields = array( |
|
32 | - 'Event_Question_Group' => array( |
|
33 | - 'EQG_ID' => new EE_Primary_Key_Int_Field('EQG_ID', esc_html__('Event to Question Group Link ID', 'event_espresso')), |
|
34 | - 'EVT_ID' => new EE_Foreign_Key_Int_Field('EVT_ID', esc_html__('Event ID', 'event_espresso'), false, 0, 'Event'), |
|
35 | - 'QSG_ID' => new EE_Foreign_Key_Int_Field('QSG_ID', esc_html__('Question Group Id', 'event_espresso'), false, 0, 'Question_Group'), |
|
36 | - 'EQG_primary' => new EE_Boolean_Field('EQG_primary', esc_html__('Flag indicating question is only for primary attendees', 'event_espresso'), false, false), |
|
37 | - 'EQG_additional' => new EE_Boolean_Field('EQG_additional', esc_html__('Flag indicating question is only for additional attendees', 'event_espresso'), false, false) |
|
38 | - ) |
|
39 | - ); |
|
40 | - $this->_model_relations = array( |
|
41 | - 'Event' => new EE_Belongs_To_Relation(), |
|
42 | - 'Question_Group' => new EE_Belongs_To_Relation() |
|
43 | - ); |
|
44 | - // this model is generally available for reading |
|
45 | - $path_to_event = 'Event'; |
|
46 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
47 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
48 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
49 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
50 | - parent::__construct($timezone); |
|
51 | - } |
|
24 | + protected function __construct($timezone = null) |
|
25 | + { |
|
26 | + $this->singular_item = esc_html__('Event to Question Group Link', 'event_espresso'); |
|
27 | + $this->plural_item = esc_html__('Event to Question Group Links', 'event_espresso'); |
|
28 | + $this->_tables = array( |
|
29 | + 'Event_Question_Group' => new EE_Primary_Table('esp_event_question_group', 'EQG_ID') |
|
30 | + ); |
|
31 | + $this->_fields = array( |
|
32 | + 'Event_Question_Group' => array( |
|
33 | + 'EQG_ID' => new EE_Primary_Key_Int_Field('EQG_ID', esc_html__('Event to Question Group Link ID', 'event_espresso')), |
|
34 | + 'EVT_ID' => new EE_Foreign_Key_Int_Field('EVT_ID', esc_html__('Event ID', 'event_espresso'), false, 0, 'Event'), |
|
35 | + 'QSG_ID' => new EE_Foreign_Key_Int_Field('QSG_ID', esc_html__('Question Group Id', 'event_espresso'), false, 0, 'Question_Group'), |
|
36 | + 'EQG_primary' => new EE_Boolean_Field('EQG_primary', esc_html__('Flag indicating question is only for primary attendees', 'event_espresso'), false, false), |
|
37 | + 'EQG_additional' => new EE_Boolean_Field('EQG_additional', esc_html__('Flag indicating question is only for additional attendees', 'event_espresso'), false, false) |
|
38 | + ) |
|
39 | + ); |
|
40 | + $this->_model_relations = array( |
|
41 | + 'Event' => new EE_Belongs_To_Relation(), |
|
42 | + 'Question_Group' => new EE_Belongs_To_Relation() |
|
43 | + ); |
|
44 | + // this model is generally available for reading |
|
45 | + $path_to_event = 'Event'; |
|
46 | + $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Event_Related_Public($path_to_event); |
|
47 | + $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
48 | + $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event); |
|
49 | + $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event, EEM_Base::caps_edit); |
|
50 | + parent::__construct($timezone); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * Decides whether to use the 'EQG_primary' or newer 'EQG_additional' for use in queries, based on whether |
|
55 | - * this is concerning primary attendees or additional attendees. |
|
56 | - * If 1, true, or "primary" is passed in, returns EQG_primary. If 0, false, or "additional" is passed in, returns |
|
57 | - * EQG_additional. |
|
58 | - * @since 4.10.0.p |
|
59 | - * @param string|boolean|int $context |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - public function fieldNameForContext($context) |
|
63 | - { |
|
64 | - // Basically do a strict switch statement. |
|
65 | - switch (true) { |
|
66 | - case $context === 'additional': |
|
67 | - case $context === false: |
|
68 | - case $context === 0: |
|
69 | - $field_name = EEM_Event_Question_Group::ADDITIONAL; |
|
70 | - break; |
|
71 | - case $context === 'primary': |
|
72 | - case $context === true: |
|
73 | - case $context === 1: |
|
74 | - default: |
|
75 | - $field_name = EEM_Event_Question_Group::PRIMARY; |
|
76 | - } |
|
77 | - return apply_filters('FHEE__EEM_Event_Question_Group__fieldNameForContext', $field_name, $context); |
|
78 | - } |
|
53 | + /** |
|
54 | + * Decides whether to use the 'EQG_primary' or newer 'EQG_additional' for use in queries, based on whether |
|
55 | + * this is concerning primary attendees or additional attendees. |
|
56 | + * If 1, true, or "primary" is passed in, returns EQG_primary. If 0, false, or "additional" is passed in, returns |
|
57 | + * EQG_additional. |
|
58 | + * @since 4.10.0.p |
|
59 | + * @param string|boolean|int $context |
|
60 | + * @return string |
|
61 | + */ |
|
62 | + public function fieldNameForContext($context) |
|
63 | + { |
|
64 | + // Basically do a strict switch statement. |
|
65 | + switch (true) { |
|
66 | + case $context === 'additional': |
|
67 | + case $context === false: |
|
68 | + case $context === 0: |
|
69 | + $field_name = EEM_Event_Question_Group::ADDITIONAL; |
|
70 | + break; |
|
71 | + case $context === 'primary': |
|
72 | + case $context === true: |
|
73 | + case $context === 1: |
|
74 | + default: |
|
75 | + $field_name = EEM_Event_Question_Group::PRIMARY; |
|
76 | + } |
|
77 | + return apply_filters('FHEE__EEM_Event_Question_Group__fieldNameForContext', $field_name, $context); |
|
78 | + } |
|
79 | 79 | } |