Completed
Branch Gutenberg/master (343a96)
by
unknown
47:31 queued 38:35
created
core/services/validators/URLValidator.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@
 block discarded – undo
16 16
  */
17 17
 class URLValidator
18 18
 {
19
-    /**
20
-     * Returns whether or not the URL is valid
21
-     * @since $VID:$
22
-     * @param $url
23
-     * @return boolean
24
-     */
25
-    public function isValid($url)
26
-    {
27
-        return  esc_url_raw($url) === $url;
28
-    }
19
+	/**
20
+	 * Returns whether or not the URL is valid
21
+	 * @since $VID:$
22
+	 * @param $url
23
+	 * @return boolean
24
+	 */
25
+	public function isValid($url)
26
+	{
27
+		return  esc_url_raw($url) === $url;
28
+	}
29 29
 }
30 30
 // End of file URLValidator.php
31 31
 // Location: ${NAMESPACE}/URLValidator.php
Please login to merge, or discard this patch.
form_sections/strategies/validation/EE_URL_Validation_Strategy.strategy.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -16,75 +16,75 @@
 block discarded – undo
16 16
 class EE_URL_Validation_Strategy extends EE_Validation_Strategy_Base
17 17
 {
18 18
 
19
-    /**
20
-     * @var @boolean whether we should check if the file exists or not
21
-     */
22
-    protected $check_file_exists;
19
+	/**
20
+	 * @var @boolean whether we should check if the file exists or not
21
+	 */
22
+	protected $check_file_exists;
23 23
 
24
-    /**
25
-     * @var URLValidator
26
-     */
27
-    protected $url_validator;
24
+	/**
25
+	 * @var URLValidator
26
+	 */
27
+	protected $url_validator;
28 28
 
29
-    /**
30
-     * @param null $validation_error_message
31
-     * @param boolean $check_file_exists
32
-     * @param URLValidator $url_validator
33
-     * @throws InvalidArgumentException
34
-     * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
35
-     * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
36
-     */
37
-    public function __construct(
38
-        $validation_error_message = null,
39
-        $check_file_exists = false,
40
-        URLValidator $url_validator = null
41
-    ) {
42
-        if (! $url_validator instanceof URLValidator) {
43
-            $url_validator = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\validators\URLValidator');
44
-        }
45
-        $this->url_validator = $url_validator;
46
-        if (! $validation_error_message) {
47
-            $validation_error_message = __("Please enter a valid URL. Eg https://eventespresso.com", "event_espresso");
48
-        }
49
-        $this->check_file_exists = $check_file_exists;
50
-        parent::__construct($validation_error_message);
51
-    }
29
+	/**
30
+	 * @param null $validation_error_message
31
+	 * @param boolean $check_file_exists
32
+	 * @param URLValidator $url_validator
33
+	 * @throws InvalidArgumentException
34
+	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
35
+	 * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
36
+	 */
37
+	public function __construct(
38
+		$validation_error_message = null,
39
+		$check_file_exists = false,
40
+		URLValidator $url_validator = null
41
+	) {
42
+		if (! $url_validator instanceof URLValidator) {
43
+			$url_validator = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\validators\URLValidator');
44
+		}
45
+		$this->url_validator = $url_validator;
46
+		if (! $validation_error_message) {
47
+			$validation_error_message = __("Please enter a valid URL. Eg https://eventespresso.com", "event_espresso");
48
+		}
49
+		$this->check_file_exists = $check_file_exists;
50
+		parent::__construct($validation_error_message);
51
+	}
52 52
 
53 53
 
54 54
 
55
-    /**
56
-     * just checks the field isn't blank
57
-     *
58
-     * @param $normalized_value
59
-     * @return bool
60
-     * @throws \EE_Validation_Error
61
-     */
62
-    public function validate($normalized_value)
63
-    {
64
-        if ($normalized_value) {
65
-            if (! $this->url_validator->isValid($normalized_value)) {
66
-                throw new EE_Validation_Error($this->get_validation_error_message(), 'invalid_url');
67
-            } elseif (apply_filters('FHEE__EE_URL_Validation_Strategy__validate__check_remote_file_exists', $this->check_file_exists, $this->_input)) {
68
-                if (! EEH_URL::remote_file_exists(
69
-                    $normalized_value,
70
-                    array(
71
-                            'sslverify' => false,
72
-                            'limit_response_size' => 4095,// we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
73
-                        )
74
-                )) {
75
-                    throw new EE_Validation_Error(sprintf(__("That URL seems to be broken. Please enter a valid URL", "event_espresso")));
76
-                }
77
-            }
78
-        }
79
-    }
55
+	/**
56
+	 * just checks the field isn't blank
57
+	 *
58
+	 * @param $normalized_value
59
+	 * @return bool
60
+	 * @throws \EE_Validation_Error
61
+	 */
62
+	public function validate($normalized_value)
63
+	{
64
+		if ($normalized_value) {
65
+			if (! $this->url_validator->isValid($normalized_value)) {
66
+				throw new EE_Validation_Error($this->get_validation_error_message(), 'invalid_url');
67
+			} elseif (apply_filters('FHEE__EE_URL_Validation_Strategy__validate__check_remote_file_exists', $this->check_file_exists, $this->_input)) {
68
+				if (! EEH_URL::remote_file_exists(
69
+					$normalized_value,
70
+					array(
71
+							'sslverify' => false,
72
+							'limit_response_size' => 4095,// we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
73
+						)
74
+				)) {
75
+					throw new EE_Validation_Error(sprintf(__("That URL seems to be broken. Please enter a valid URL", "event_espresso")));
76
+				}
77
+			}
78
+		}
79
+	}
80 80
 
81 81
 
82 82
 
83
-    /**
84
-     * @return array
85
-     */
86
-    public function get_jquery_validation_rule_array()
87
-    {
88
-        return array( 'validUrl'=>true, 'messages' => array( 'validUrl' => $this->get_validation_error_message() ) );
89
-    }
83
+	/**
84
+	 * @return array
85
+	 */
86
+	public function get_jquery_validation_rule_array()
87
+	{
88
+		return array( 'validUrl'=>true, 'messages' => array( 'validUrl' => $this->get_validation_error_message() ) );
89
+	}
90 90
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
         $check_file_exists = false,
40 40
         URLValidator $url_validator = null
41 41
     ) {
42
-        if (! $url_validator instanceof URLValidator) {
42
+        if ( ! $url_validator instanceof URLValidator) {
43 43
             $url_validator = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\validators\URLValidator');
44 44
         }
45 45
         $this->url_validator = $url_validator;
46
-        if (! $validation_error_message) {
46
+        if ( ! $validation_error_message) {
47 47
             $validation_error_message = __("Please enter a valid URL. Eg https://eventespresso.com", "event_espresso");
48 48
         }
49 49
         $this->check_file_exists = $check_file_exists;
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
     public function validate($normalized_value)
63 63
     {
64 64
         if ($normalized_value) {
65
-            if (! $this->url_validator->isValid($normalized_value)) {
65
+            if ( ! $this->url_validator->isValid($normalized_value)) {
66 66
                 throw new EE_Validation_Error($this->get_validation_error_message(), 'invalid_url');
67 67
             } elseif (apply_filters('FHEE__EE_URL_Validation_Strategy__validate__check_remote_file_exists', $this->check_file_exists, $this->_input)) {
68
-                if (! EEH_URL::remote_file_exists(
68
+                if ( ! EEH_URL::remote_file_exists(
69 69
                     $normalized_value,
70 70
                     array(
71 71
                             'sslverify' => false,
72
-                            'limit_response_size' => 4095,// we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
72
+                            'limit_response_size' => 4095, // we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
73 73
                         )
74 74
                 )) {
75 75
                     throw new EE_Validation_Error(sprintf(__("That URL seems to be broken. Please enter a valid URL", "event_espresso")));
@@ -85,6 +85,6 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function get_jquery_validation_rule_array()
87 87
     {
88
-        return array( 'validUrl'=>true, 'messages' => array( 'validUrl' => $this->get_validation_error_message() ) );
88
+        return array('validUrl'=>true, 'messages' => array('validUrl' => $this->get_validation_error_message()));
89 89
     }
90 90
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Admin_File_Uploader_Input.input.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -14,27 +14,27 @@
 block discarded – undo
14 14
 class EE_Admin_File_Uploader_Input extends EE_Form_Input_Base
15 15
 {
16 16
 
17
-    /**
18
-     * @param array $input_settings
19
-     * @throws InvalidArgumentException
20
-     * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
21
-     * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
22
-     */
23
-    public function __construct($input_settings = array())
24
-    {
25
-        $this->_set_display_strategy(new EE_Admin_File_Uploader_Display_Strategy());
26
-        $this->_set_normalization_strategy(new EE_Text_Normalization());
27
-        $this->_add_validation_strategy(
28
-            LoaderFactory::getLoader()->getNew(
29
-                'EE_URL_Validation_Strategy',
30
-                array(
31
-                    isset($input_settings['validation_error_message'])
32
-                        ? $input_settings['validation_error_message']
33
-                        : null,
34
-                    true
35
-                )
36
-            )
37
-        );
38
-        parent::__construct($input_settings);
39
-    }
17
+	/**
18
+	 * @param array $input_settings
19
+	 * @throws InvalidArgumentException
20
+	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
21
+	 * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
22
+	 */
23
+	public function __construct($input_settings = array())
24
+	{
25
+		$this->_set_display_strategy(new EE_Admin_File_Uploader_Display_Strategy());
26
+		$this->_set_normalization_strategy(new EE_Text_Normalization());
27
+		$this->_add_validation_strategy(
28
+			LoaderFactory::getLoader()->getNew(
29
+				'EE_URL_Validation_Strategy',
30
+				array(
31
+					isset($input_settings['validation_error_message'])
32
+						? $input_settings['validation_error_message']
33
+						: null,
34
+					true
35
+				)
36
+			)
37
+		);
38
+		parent::__construct($input_settings);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Question.class.php 1 patch
Indentation   +657 added lines, -657 removed lines patch added patch discarded remove patch
@@ -14,661 +14,661 @@
 block discarded – undo
14 14
 class EE_Question extends EE_Soft_Delete_Base_Class implements EEI_Duplicatable
15 15
 {
16 16
 
17
-    /**
18
-     *
19
-     * @param array  $props_n_values          incoming values
20
-     * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
21
-     *                                        used.)
22
-     * @param array  $date_formats            incoming date_formats in an array where the first value is the
23
-     *                                        date_format and the second value is the time format
24
-     * @return EE_Question
25
-     */
26
-    public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
27
-    {
28
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
29
-        return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
30
-    }
31
-
32
-
33
-    /**
34
-     * @param array  $props_n_values  incoming values from the database
35
-     * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
36
-     *                                the website will be used.
37
-     * @return EE_Question
38
-     */
39
-    public static function new_instance_from_db($props_n_values = array(), $timezone = null)
40
-    {
41
-        return new self($props_n_values, true, $timezone);
42
-    }
43
-
44
-
45
-    /**
46
-     *        Set    Question display text
47
-     *
48
-     * @access        public
49
-     * @param string $QST_display_text
50
-     */
51
-    public function set_display_text($QST_display_text = '')
52
-    {
53
-        $this->set('QST_display_text', $QST_display_text);
54
-    }
55
-
56
-
57
-    /**
58
-     *        Set    Question admin text
59
-     *
60
-     * @access        public
61
-     * @param        string $QST_admin_label
62
-     */
63
-    public function set_admin_label($QST_admin_label = '')
64
-    {
65
-        $this->set('QST_admin_label', $QST_admin_label);
66
-    }
67
-
68
-
69
-    /**
70
-     *        Set    system name
71
-     *
72
-     * @access        public
73
-     * @param        mixed $QST_system
74
-     */
75
-    public function set_system_ID($QST_system = '')
76
-    {
77
-        $this->set('QST_system', $QST_system);
78
-    }
79
-
80
-
81
-    /**
82
-     *        Set    question's type
83
-     *
84
-     * @access        public
85
-     * @param        string $QST_type
86
-     */
87
-    public function set_question_type($QST_type = '')
88
-    {
89
-        $this->set('QST_type', $QST_type);
90
-    }
91
-
92
-
93
-    /**
94
-     *        Sets whether this question must be answered when presented in a form
95
-     *
96
-     * @access        public
97
-     * @param        bool $QST_required
98
-     */
99
-    public function set_required($QST_required = false)
100
-    {
101
-        $this->set('QST_required', $QST_required);
102
-    }
103
-
104
-
105
-    /**
106
-     *        Set    Question display text
107
-     *
108
-     * @access        public
109
-     * @param        string $QST_required_text
110
-     */
111
-    public function set_required_text($QST_required_text = '')
112
-    {
113
-        $this->set('QST_required_text', $QST_required_text);
114
-    }
115
-
116
-
117
-    /**
118
-     *        Sets the order of this question when placed in a sequence of questions
119
-     *
120
-     * @access        public
121
-     * @param        int $QST_order
122
-     */
123
-    public function set_order($QST_order = 0)
124
-    {
125
-        $this->set('QST_order', $QST_order);
126
-    }
127
-
128
-
129
-    /**
130
-     *        Sets whether the question is admin-only
131
-     *
132
-     * @access        public
133
-     * @param        bool $QST_admin_only
134
-     */
135
-    public function set_admin_only($QST_admin_only = false)
136
-    {
137
-        $this->set('QST_admin_only', $QST_admin_only);
138
-    }
139
-
140
-
141
-    /**
142
-     *        Sets the wordpress user ID on the question
143
-     *
144
-     * @access        public
145
-     * @param        int $QST_wp_user
146
-     */
147
-    public function set_wp_user($QST_wp_user = 1)
148
-    {
149
-        $this->set('QST_wp_user', $QST_wp_user);
150
-    }
151
-
152
-
153
-    /**
154
-     *        Sets whether the question has been deleted
155
-     *        (we use this boolean instead of actually
156
-     *        deleting it because when users delete this question
157
-     *        they really want to remove the question from future
158
-     *        forms, BUT keep their old answers which depend
159
-     *        on this record actually existing.
160
-     *
161
-     * @access        public
162
-     * @param    bool $QST_deleted
163
-     */
164
-    public function set_deleted($QST_deleted = false)
165
-    {
166
-        $this->set('QST_deleted', $QST_deleted);
167
-    }
168
-
169
-
170
-    /**
171
-     * returns the text for displaying the question to users
172
-     *
173
-     * @access public
174
-     * @return string
175
-     */
176
-    public function display_text()
177
-    {
178
-        return $this->get('QST_display_text');
179
-    }
180
-
181
-
182
-    /**
183
-     * returns the text for the administrative label
184
-     *
185
-     * @access public
186
-     * @return string
187
-     */
188
-    public function admin_label()
189
-    {
190
-        return $this->get('QST_admin_label');
191
-    }
192
-
193
-
194
-    /**
195
-     * returns the attendee column name for this question
196
-     *
197
-     * @access public
198
-     * @return string
199
-     */
200
-    public function system_ID()
201
-    {
202
-        return $this->get('QST_system');
203
-    }
204
-
205
-
206
-    /**
207
-     * returns either a string of 'text', 'textfield', etc.
208
-     *
209
-     * @access public
210
-     * @return boolean
211
-     */
212
-    public function required()
213
-    {
214
-        return $this->get('QST_required');
215
-    }
216
-
217
-
218
-    /**
219
-     * returns the text which should be displayed when a user
220
-     * doesn't answer this question in a form
221
-     *
222
-     * @access public
223
-     * @return string
224
-     */
225
-    public function required_text()
226
-    {
227
-        return $this->get('QST_required_text');
228
-    }
229
-
230
-
231
-    /**
232
-     * returns the type of this question
233
-     *
234
-     * @access public
235
-     * @return string
236
-     */
237
-    public function type()
238
-    {
239
-        return $this->get('QST_type');
240
-    }
241
-
242
-
243
-    /**
244
-     * returns an integer showing where this question should
245
-     * be placed in a sequence of questions
246
-     *
247
-     * @access public
248
-     * @return int
249
-     */
250
-    public function order()
251
-    {
252
-        return $this->get('QST_order');
253
-    }
254
-
255
-
256
-    /**
257
-     * returns whether this question should only appears to admins,
258
-     * or to everyone
259
-     *
260
-     * @access public
261
-     * @return boolean
262
-     */
263
-    public function admin_only()
264
-    {
265
-        return $this->get('QST_admin_only');
266
-    }
267
-
268
-
269
-    /**
270
-     * returns the id the wordpress user who created this question
271
-     *
272
-     * @access public
273
-     * @return int
274
-     */
275
-    public function wp_user()
276
-    {
277
-        return $this->get('QST_wp_user');
278
-    }
279
-
280
-
281
-    /**
282
-     * returns whether this question has been marked as 'deleted'
283
-     *
284
-     * @access public
285
-     * @return boolean
286
-     */
287
-    public function deleted()
288
-    {
289
-        return $this->get('QST_deleted');
290
-    }
291
-
292
-
293
-    /**
294
-     * Gets an array of related EE_Answer  to this EE_Question
295
-     *
296
-     * @return EE_Answer[]
297
-     */
298
-    public function answers()
299
-    {
300
-        return $this->get_many_related('Answer');
301
-    }
302
-
303
-
304
-    /**
305
-     * Boolean check for if there are answers on this question in th db
306
-     *
307
-     * @return boolean true = has answers, false = no answers.
308
-     */
309
-    public function has_answers()
310
-    {
311
-        return $this->count_related('Answer') > 0 ? true : false;
312
-    }
313
-
314
-
315
-    /**
316
-     * gets an array of EE_Question_Group which relate to this question
317
-     *
318
-     * @return EE_Question_Group[]
319
-     */
320
-    public function question_groups()
321
-    {
322
-        return $this->get_many_related('Question_Group');
323
-    }
324
-
325
-
326
-    /**
327
-     * Returns all the options for this question. By default, it returns only the not-yet-deleted ones.
328
-     *
329
-     * @param boolean      $notDeletedOptionsOnly            1
330
-     *                                                       whether to return ALL options, or only the ones which have
331
-     *                                                       not yet been deleleted
332
-     * @param string|array $selected_value_to_always_include , when retrieving options to an ANSWERED question,
333
-     *                                                       we want to usually only show non-deleted options AND the
334
-     *                                                       value that was selected for the answer, whether it was
335
-     *                                                       trashed or not.
336
-     * @return EE_Question_Option[]
337
-     */
338
-    public function options($notDeletedOptionsOnly = true, $selected_value_to_always_include = null)
339
-    {
340
-        if (! $this->ID()) {
341
-            return array();
342
-        }
343
-        $query_params = array();
344
-        if ($selected_value_to_always_include) {
345
-            if (is_array($selected_value_to_always_include)) {
346
-                $query_params[0]['OR*options-query']['QSO_value'] = array('IN', $selected_value_to_always_include);
347
-            } else {
348
-                $query_params[0]['OR*options-query']['QSO_value'] = $selected_value_to_always_include;
349
-            }
350
-        }
351
-        if ($notDeletedOptionsOnly) {
352
-            $query_params[0]['OR*options-query']['QSO_deleted'] = false;
353
-        }
354
-        // order by QSO_order
355
-        $query_params['order_by'] = array('QSO_order' => 'ASC');
356
-        return $this->get_many_related('Question_Option', $query_params);
357
-    }
358
-
359
-
360
-    /**
361
-     * returns an array of EE_Question_Options which relate to this question
362
-     *
363
-     * @return \EE_Question_Option[]
364
-     */
365
-    public function temp_options()
366
-    {
367
-        return $this->_model_relations['Question_Option'];
368
-    }
369
-
370
-
371
-    /**
372
-     * Adds an option for this question. Note: if the option were previously associated with a different
373
-     * Question, that relationship will be overwritten.
374
-     *
375
-     * @param EE_Question_Option $option
376
-     * @return boolean success
377
-     */
378
-    public function add_option(EE_Question_Option $option)
379
-    {
380
-        return $this->_add_relation_to($option, 'Question_Option');
381
-    }
382
-
383
-
384
-    /**
385
-     * Adds an option directly to this question without saving to the db
386
-     *
387
-     * @param EE_Question_Option $option
388
-     * @return boolean success
389
-     */
390
-    public function add_temp_option(EE_Question_Option $option)
391
-    {
392
-        $this->_model_relations['Question_Option'][] = $option;
393
-        return true;
394
-    }
395
-
396
-
397
-    /**
398
-     * Marks the option as deleted.
399
-     *
400
-     * @param EE_Question_Option $option
401
-     * @return boolean success
402
-     */
403
-    public function remove_option(EE_Question_Option $option)
404
-    {
405
-        return $this->_remove_relation_to($option, 'Question_Option');
406
-    }
407
-
408
-
409
-    /**
410
-     * @return bool
411
-     */
412
-    public function is_system_question()
413
-    {
414
-        $system_ID = $this->get('QST_system');
415
-        return ! empty($system_ID) ? true : false;
416
-    }
417
-
418
-
419
-    /**
420
-     * The purpose of this method is set the question order this question order to be the max out of all questions
421
-     *
422
-     * @access public
423
-     * @return void
424
-     */
425
-    public function set_order_to_latest()
426
-    {
427
-        $latest_order = $this->get_model()->get_latest_question_order();
428
-        $latest_order++;
429
-        $this->set('QST_order', $latest_order);
430
-    }
431
-
432
-
433
-    /**
434
-     * Retrieves the list of allowed question types from the model.
435
-     *
436
-     * @return string[]
437
-     */
438
-    private function _allowed_question_types()
439
-    {
440
-        $questionModel = $this->get_model();
441
-        /* @var $questionModel EEM_Question */
442
-        return $questionModel->allowed_question_types();
443
-    }
444
-
445
-    /**
446
-     * Duplicates this question and its question options
447
-     *
448
-     * @return \EE_Question
449
-     */
450
-    public function duplicate($options = array())
451
-    {
452
-        $new_question = clone $this;
453
-        $new_question->set('QST_ID', null);
454
-        $new_question->set_display_text(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->display_text()));
455
-        $new_question->set_admin_label(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->admin_label()));
456
-        $new_question->set_system_ID(null);
457
-        $new_question->set_wp_user(get_current_user_id());
458
-        // if we're duplicating a trashed question, assume we don't want the new one to be trashed
459
-        $new_question->set_deleted(false);
460
-        $success = $new_question->save();
461
-        if ($success) {
462
-            // we don't totally want to duplicate the question options, because we want them to be for the NEW question
463
-            foreach ($this->options() as $question_option) {
464
-                $question_option->duplicate(array('QST_ID' => $new_question->ID()));
465
-            }
466
-            return $new_question;
467
-        } else {
468
-            return null;
469
-        }
470
-    }
471
-
472
-    /**
473
-     * Returns the question's maximum allowed response size
474
-     *
475
-     * @return int|float
476
-     */
477
-    public function max()
478
-    {
479
-        return $this->get('QST_max');
480
-    }
481
-
482
-    /**
483
-     * Sets the question's maximum allowed response size
484
-     *
485
-     * @param int|float $new_max
486
-     * @return void
487
-     */
488
-    public function set_max($new_max)
489
-    {
490
-        $this->set('QST_max', $new_max);
491
-    }
492
-
493
-
494
-    /**
495
-     * Creates a form input from this question which can be used in HTML forms
496
-     *
497
-     * @param EE_Registration $registration
498
-     * @param EE_Answer       $answer
499
-     * @param array           $input_constructor_args
500
-     * @return EE_Form_Input_Base
501
-     */
502
-    public function generate_form_input($registration = null, $answer = null, $input_constructor_args = array())
503
-    {
504
-        $identifier = $this->is_system_question() ? $this->system_ID() : $this->ID();
505
-
506
-        $input_constructor_args = array_merge(
507
-            array(
508
-                'required'                          => $this->required() ? true : false,
509
-                'html_label_text'                   => $this->display_text(),
510
-                'required_validation_error_message' => $this->required_text(),
511
-            ),
512
-            $input_constructor_args
513
-        );
514
-        if (! $answer instanceof EE_Answer && $registration instanceof EE_Registration) {
515
-            $answer = EEM_Answer::instance()->get_registration_question_answer_object($registration, $this->ID());
516
-        }
517
-        // has this question been answered ?
518
-        if ($answer instanceof EE_Answer
519
-            && $answer->value() !== ''
520
-        ) {
521
-            // answer gets htmlspecialchars called on it, undo that please
522
-            // because the form input's display strategy may call esc_attr too
523
-            // which also does html special characters
524
-            $values_with_html_special_chars = $answer->value();
525
-            if (is_array($values_with_html_special_chars)) {
526
-                $default_value = array_map('htmlspecialchars_decode', $values_with_html_special_chars);
527
-            } else {
528
-                $default_value = htmlspecialchars_decode($values_with_html_special_chars);
529
-            }
530
-            $input_constructor_args['default'] = $default_value;
531
-        }
532
-        $max_max_for_question = EEM_Question::instance()->absolute_max_for_system_question($this->system_ID());
533
-        if (in_array(
534
-            $this->type(),
535
-            EEM_Question::instance()->questionTypesWithMaxLength(),
536
-            true
537
-        )) {
538
-            $input_constructor_args['validation_strategies'][] = new EE_Max_Length_Validation_Strategy(
539
-                null,
540
-                min($max_max_for_question, $this->max())
541
-            );
542
-        }
543
-        $input_constructor_args = apply_filters(
544
-            'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__input_constructor_args',
545
-            $input_constructor_args,
546
-            $registration,
547
-            $this,
548
-            $answer
549
-        );
550
-
551
-        $result = null;
552
-        switch ($this->type()) {
553
-            // Text
554
-            case EEM_Question::QST_type_text:
555
-                $result = new EE_Text_Input($input_constructor_args);
556
-                break;
557
-            // Textarea
558
-            case EEM_Question::QST_type_textarea:
559
-                $result = new EE_Text_Area_Input($input_constructor_args);
560
-                break;
561
-            // Radio Buttons
562
-            case EEM_Question::QST_type_radio:
563
-                $result = new EE_Radio_Button_Input($this->options(), $input_constructor_args);
564
-                break;
565
-            // Dropdown
566
-            case EEM_Question::QST_type_dropdown:
567
-                $result = new EE_Select_Input($this->options(), $input_constructor_args);
568
-                break;
569
-            // State Dropdown
570
-            case EEM_Question::QST_type_state:
571
-                $state_options = apply_filters(
572
-                    'FHEE__EE_Question__generate_form_input__state_options',
573
-                    null,
574
-                    $this,
575
-                    $registration,
576
-                    $answer
577
-                );
578
-                $result = new EE_State_Select_Input($state_options, $input_constructor_args);
579
-                break;
580
-            // Country Dropdown
581
-            case EEM_Question::QST_type_country:
582
-                $country_options = apply_filters(
583
-                    'FHEE__EE_Question__generate_form_input__country_options',
584
-                    null,
585
-                    $this,
586
-                    $registration,
587
-                    $answer
588
-                );
589
-                $result = new EE_Country_Select_Input($country_options, $input_constructor_args);
590
-                break;
591
-            // Checkboxes
592
-            case EEM_Question::QST_type_checkbox:
593
-                $result = new EE_Checkbox_Multi_Input($this->options(), $input_constructor_args);
594
-                break;
595
-            // Date
596
-            case EEM_Question::QST_type_date:
597
-                $result = new EE_Datepicker_Input($input_constructor_args);
598
-                break;
599
-            case EEM_Question::QST_type_html_textarea:
600
-                $input_constructor_args['validation_strategies'][] = new EE_Simple_HTML_Validation_Strategy();
601
-                $result = new EE_Text_Area_Input($input_constructor_args);
602
-                $result->remove_validation_strategy('EE_Plaintext_Validation_Strategy');
603
-                break;
604
-            case EEM_Question::QST_type_email:
605
-                $result = new EE_Email_Input($input_constructor_args);
606
-                break;
607
-            case EEM_Question::QST_type_us_phone:
608
-                $result = new EE_Phone_Input($input_constructor_args);
609
-                break;
610
-            case EEM_Question::QST_type_int:
611
-                $result = new EE_Integer_Input($input_constructor_args);
612
-                break;
613
-            case EEM_Question::QST_type_decimal:
614
-                $result = new EE_Float_Input($input_constructor_args);
615
-                break;
616
-            case EEM_Question::QST_type_url:
617
-                $input_constructor_args['validation_strategies'][] = LoaderFactory::getLoader()->getNew('EE_URL_Validation_Strategy');
618
-                $result = new EE_Text_Input($input_constructor_args);
619
-                break;
620
-            case EEM_Question::QST_type_year:
621
-                $result = new EE_Year_Input(
622
-                    $input_constructor_args,
623
-                    apply_filters(
624
-                        'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__four_digit',
625
-                        true,
626
-                        $this
627
-                    ),
628
-                    apply_filters(
629
-                        'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__early_range',
630
-                        100,
631
-                        $this
632
-                    ),
633
-                    apply_filters(
634
-                        'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__end_range',
635
-                        100,
636
-                        $this
637
-                    )
638
-                );
639
-                break;
640
-            case EEM_Question::QST_type_multi_select:
641
-                $result = new EE_Select_Multiple_Input($this->options(), $input_constructor_args);
642
-                break;
643
-            // fallback
644
-            default:
645
-                $default_input = apply_filters(
646
-                    'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__default',
647
-                    null,
648
-                    $this->type(),
649
-                    $this,
650
-                    $input_constructor_args
651
-                );
652
-                if (! $default_input) {
653
-                    $default_input = new EE_Text_Input($input_constructor_args);
654
-                }
655
-                $result = $default_input;
656
-        }
657
-        return apply_filters('FHEE__EE_Question__generate_form_input__return', $result, $registration, $this, $answer);
658
-    }
659
-
660
-
661
-    /**
662
-     * Returns whether or not this question type should have question option entries
663
-     *
664
-     * @return bool
665
-     */
666
-    public function should_have_question_options()
667
-    {
668
-        return in_array(
669
-            $this->type(),
670
-            $this->_model->question_types_with_options(),
671
-            true
672
-        );
673
-    }
17
+	/**
18
+	 *
19
+	 * @param array  $props_n_values          incoming values
20
+	 * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
21
+	 *                                        used.)
22
+	 * @param array  $date_formats            incoming date_formats in an array where the first value is the
23
+	 *                                        date_format and the second value is the time format
24
+	 * @return EE_Question
25
+	 */
26
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
27
+	{
28
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
29
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
30
+	}
31
+
32
+
33
+	/**
34
+	 * @param array  $props_n_values  incoming values from the database
35
+	 * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
36
+	 *                                the website will be used.
37
+	 * @return EE_Question
38
+	 */
39
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null)
40
+	{
41
+		return new self($props_n_values, true, $timezone);
42
+	}
43
+
44
+
45
+	/**
46
+	 *        Set    Question display text
47
+	 *
48
+	 * @access        public
49
+	 * @param string $QST_display_text
50
+	 */
51
+	public function set_display_text($QST_display_text = '')
52
+	{
53
+		$this->set('QST_display_text', $QST_display_text);
54
+	}
55
+
56
+
57
+	/**
58
+	 *        Set    Question admin text
59
+	 *
60
+	 * @access        public
61
+	 * @param        string $QST_admin_label
62
+	 */
63
+	public function set_admin_label($QST_admin_label = '')
64
+	{
65
+		$this->set('QST_admin_label', $QST_admin_label);
66
+	}
67
+
68
+
69
+	/**
70
+	 *        Set    system name
71
+	 *
72
+	 * @access        public
73
+	 * @param        mixed $QST_system
74
+	 */
75
+	public function set_system_ID($QST_system = '')
76
+	{
77
+		$this->set('QST_system', $QST_system);
78
+	}
79
+
80
+
81
+	/**
82
+	 *        Set    question's type
83
+	 *
84
+	 * @access        public
85
+	 * @param        string $QST_type
86
+	 */
87
+	public function set_question_type($QST_type = '')
88
+	{
89
+		$this->set('QST_type', $QST_type);
90
+	}
91
+
92
+
93
+	/**
94
+	 *        Sets whether this question must be answered when presented in a form
95
+	 *
96
+	 * @access        public
97
+	 * @param        bool $QST_required
98
+	 */
99
+	public function set_required($QST_required = false)
100
+	{
101
+		$this->set('QST_required', $QST_required);
102
+	}
103
+
104
+
105
+	/**
106
+	 *        Set    Question display text
107
+	 *
108
+	 * @access        public
109
+	 * @param        string $QST_required_text
110
+	 */
111
+	public function set_required_text($QST_required_text = '')
112
+	{
113
+		$this->set('QST_required_text', $QST_required_text);
114
+	}
115
+
116
+
117
+	/**
118
+	 *        Sets the order of this question when placed in a sequence of questions
119
+	 *
120
+	 * @access        public
121
+	 * @param        int $QST_order
122
+	 */
123
+	public function set_order($QST_order = 0)
124
+	{
125
+		$this->set('QST_order', $QST_order);
126
+	}
127
+
128
+
129
+	/**
130
+	 *        Sets whether the question is admin-only
131
+	 *
132
+	 * @access        public
133
+	 * @param        bool $QST_admin_only
134
+	 */
135
+	public function set_admin_only($QST_admin_only = false)
136
+	{
137
+		$this->set('QST_admin_only', $QST_admin_only);
138
+	}
139
+
140
+
141
+	/**
142
+	 *        Sets the wordpress user ID on the question
143
+	 *
144
+	 * @access        public
145
+	 * @param        int $QST_wp_user
146
+	 */
147
+	public function set_wp_user($QST_wp_user = 1)
148
+	{
149
+		$this->set('QST_wp_user', $QST_wp_user);
150
+	}
151
+
152
+
153
+	/**
154
+	 *        Sets whether the question has been deleted
155
+	 *        (we use this boolean instead of actually
156
+	 *        deleting it because when users delete this question
157
+	 *        they really want to remove the question from future
158
+	 *        forms, BUT keep their old answers which depend
159
+	 *        on this record actually existing.
160
+	 *
161
+	 * @access        public
162
+	 * @param    bool $QST_deleted
163
+	 */
164
+	public function set_deleted($QST_deleted = false)
165
+	{
166
+		$this->set('QST_deleted', $QST_deleted);
167
+	}
168
+
169
+
170
+	/**
171
+	 * returns the text for displaying the question to users
172
+	 *
173
+	 * @access public
174
+	 * @return string
175
+	 */
176
+	public function display_text()
177
+	{
178
+		return $this->get('QST_display_text');
179
+	}
180
+
181
+
182
+	/**
183
+	 * returns the text for the administrative label
184
+	 *
185
+	 * @access public
186
+	 * @return string
187
+	 */
188
+	public function admin_label()
189
+	{
190
+		return $this->get('QST_admin_label');
191
+	}
192
+
193
+
194
+	/**
195
+	 * returns the attendee column name for this question
196
+	 *
197
+	 * @access public
198
+	 * @return string
199
+	 */
200
+	public function system_ID()
201
+	{
202
+		return $this->get('QST_system');
203
+	}
204
+
205
+
206
+	/**
207
+	 * returns either a string of 'text', 'textfield', etc.
208
+	 *
209
+	 * @access public
210
+	 * @return boolean
211
+	 */
212
+	public function required()
213
+	{
214
+		return $this->get('QST_required');
215
+	}
216
+
217
+
218
+	/**
219
+	 * returns the text which should be displayed when a user
220
+	 * doesn't answer this question in a form
221
+	 *
222
+	 * @access public
223
+	 * @return string
224
+	 */
225
+	public function required_text()
226
+	{
227
+		return $this->get('QST_required_text');
228
+	}
229
+
230
+
231
+	/**
232
+	 * returns the type of this question
233
+	 *
234
+	 * @access public
235
+	 * @return string
236
+	 */
237
+	public function type()
238
+	{
239
+		return $this->get('QST_type');
240
+	}
241
+
242
+
243
+	/**
244
+	 * returns an integer showing where this question should
245
+	 * be placed in a sequence of questions
246
+	 *
247
+	 * @access public
248
+	 * @return int
249
+	 */
250
+	public function order()
251
+	{
252
+		return $this->get('QST_order');
253
+	}
254
+
255
+
256
+	/**
257
+	 * returns whether this question should only appears to admins,
258
+	 * or to everyone
259
+	 *
260
+	 * @access public
261
+	 * @return boolean
262
+	 */
263
+	public function admin_only()
264
+	{
265
+		return $this->get('QST_admin_only');
266
+	}
267
+
268
+
269
+	/**
270
+	 * returns the id the wordpress user who created this question
271
+	 *
272
+	 * @access public
273
+	 * @return int
274
+	 */
275
+	public function wp_user()
276
+	{
277
+		return $this->get('QST_wp_user');
278
+	}
279
+
280
+
281
+	/**
282
+	 * returns whether this question has been marked as 'deleted'
283
+	 *
284
+	 * @access public
285
+	 * @return boolean
286
+	 */
287
+	public function deleted()
288
+	{
289
+		return $this->get('QST_deleted');
290
+	}
291
+
292
+
293
+	/**
294
+	 * Gets an array of related EE_Answer  to this EE_Question
295
+	 *
296
+	 * @return EE_Answer[]
297
+	 */
298
+	public function answers()
299
+	{
300
+		return $this->get_many_related('Answer');
301
+	}
302
+
303
+
304
+	/**
305
+	 * Boolean check for if there are answers on this question in th db
306
+	 *
307
+	 * @return boolean true = has answers, false = no answers.
308
+	 */
309
+	public function has_answers()
310
+	{
311
+		return $this->count_related('Answer') > 0 ? true : false;
312
+	}
313
+
314
+
315
+	/**
316
+	 * gets an array of EE_Question_Group which relate to this question
317
+	 *
318
+	 * @return EE_Question_Group[]
319
+	 */
320
+	public function question_groups()
321
+	{
322
+		return $this->get_many_related('Question_Group');
323
+	}
324
+
325
+
326
+	/**
327
+	 * Returns all the options for this question. By default, it returns only the not-yet-deleted ones.
328
+	 *
329
+	 * @param boolean      $notDeletedOptionsOnly            1
330
+	 *                                                       whether to return ALL options, or only the ones which have
331
+	 *                                                       not yet been deleleted
332
+	 * @param string|array $selected_value_to_always_include , when retrieving options to an ANSWERED question,
333
+	 *                                                       we want to usually only show non-deleted options AND the
334
+	 *                                                       value that was selected for the answer, whether it was
335
+	 *                                                       trashed or not.
336
+	 * @return EE_Question_Option[]
337
+	 */
338
+	public function options($notDeletedOptionsOnly = true, $selected_value_to_always_include = null)
339
+	{
340
+		if (! $this->ID()) {
341
+			return array();
342
+		}
343
+		$query_params = array();
344
+		if ($selected_value_to_always_include) {
345
+			if (is_array($selected_value_to_always_include)) {
346
+				$query_params[0]['OR*options-query']['QSO_value'] = array('IN', $selected_value_to_always_include);
347
+			} else {
348
+				$query_params[0]['OR*options-query']['QSO_value'] = $selected_value_to_always_include;
349
+			}
350
+		}
351
+		if ($notDeletedOptionsOnly) {
352
+			$query_params[0]['OR*options-query']['QSO_deleted'] = false;
353
+		}
354
+		// order by QSO_order
355
+		$query_params['order_by'] = array('QSO_order' => 'ASC');
356
+		return $this->get_many_related('Question_Option', $query_params);
357
+	}
358
+
359
+
360
+	/**
361
+	 * returns an array of EE_Question_Options which relate to this question
362
+	 *
363
+	 * @return \EE_Question_Option[]
364
+	 */
365
+	public function temp_options()
366
+	{
367
+		return $this->_model_relations['Question_Option'];
368
+	}
369
+
370
+
371
+	/**
372
+	 * Adds an option for this question. Note: if the option were previously associated with a different
373
+	 * Question, that relationship will be overwritten.
374
+	 *
375
+	 * @param EE_Question_Option $option
376
+	 * @return boolean success
377
+	 */
378
+	public function add_option(EE_Question_Option $option)
379
+	{
380
+		return $this->_add_relation_to($option, 'Question_Option');
381
+	}
382
+
383
+
384
+	/**
385
+	 * Adds an option directly to this question without saving to the db
386
+	 *
387
+	 * @param EE_Question_Option $option
388
+	 * @return boolean success
389
+	 */
390
+	public function add_temp_option(EE_Question_Option $option)
391
+	{
392
+		$this->_model_relations['Question_Option'][] = $option;
393
+		return true;
394
+	}
395
+
396
+
397
+	/**
398
+	 * Marks the option as deleted.
399
+	 *
400
+	 * @param EE_Question_Option $option
401
+	 * @return boolean success
402
+	 */
403
+	public function remove_option(EE_Question_Option $option)
404
+	{
405
+		return $this->_remove_relation_to($option, 'Question_Option');
406
+	}
407
+
408
+
409
+	/**
410
+	 * @return bool
411
+	 */
412
+	public function is_system_question()
413
+	{
414
+		$system_ID = $this->get('QST_system');
415
+		return ! empty($system_ID) ? true : false;
416
+	}
417
+
418
+
419
+	/**
420
+	 * The purpose of this method is set the question order this question order to be the max out of all questions
421
+	 *
422
+	 * @access public
423
+	 * @return void
424
+	 */
425
+	public function set_order_to_latest()
426
+	{
427
+		$latest_order = $this->get_model()->get_latest_question_order();
428
+		$latest_order++;
429
+		$this->set('QST_order', $latest_order);
430
+	}
431
+
432
+
433
+	/**
434
+	 * Retrieves the list of allowed question types from the model.
435
+	 *
436
+	 * @return string[]
437
+	 */
438
+	private function _allowed_question_types()
439
+	{
440
+		$questionModel = $this->get_model();
441
+		/* @var $questionModel EEM_Question */
442
+		return $questionModel->allowed_question_types();
443
+	}
444
+
445
+	/**
446
+	 * Duplicates this question and its question options
447
+	 *
448
+	 * @return \EE_Question
449
+	 */
450
+	public function duplicate($options = array())
451
+	{
452
+		$new_question = clone $this;
453
+		$new_question->set('QST_ID', null);
454
+		$new_question->set_display_text(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->display_text()));
455
+		$new_question->set_admin_label(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->admin_label()));
456
+		$new_question->set_system_ID(null);
457
+		$new_question->set_wp_user(get_current_user_id());
458
+		// if we're duplicating a trashed question, assume we don't want the new one to be trashed
459
+		$new_question->set_deleted(false);
460
+		$success = $new_question->save();
461
+		if ($success) {
462
+			// we don't totally want to duplicate the question options, because we want them to be for the NEW question
463
+			foreach ($this->options() as $question_option) {
464
+				$question_option->duplicate(array('QST_ID' => $new_question->ID()));
465
+			}
466
+			return $new_question;
467
+		} else {
468
+			return null;
469
+		}
470
+	}
471
+
472
+	/**
473
+	 * Returns the question's maximum allowed response size
474
+	 *
475
+	 * @return int|float
476
+	 */
477
+	public function max()
478
+	{
479
+		return $this->get('QST_max');
480
+	}
481
+
482
+	/**
483
+	 * Sets the question's maximum allowed response size
484
+	 *
485
+	 * @param int|float $new_max
486
+	 * @return void
487
+	 */
488
+	public function set_max($new_max)
489
+	{
490
+		$this->set('QST_max', $new_max);
491
+	}
492
+
493
+
494
+	/**
495
+	 * Creates a form input from this question which can be used in HTML forms
496
+	 *
497
+	 * @param EE_Registration $registration
498
+	 * @param EE_Answer       $answer
499
+	 * @param array           $input_constructor_args
500
+	 * @return EE_Form_Input_Base
501
+	 */
502
+	public function generate_form_input($registration = null, $answer = null, $input_constructor_args = array())
503
+	{
504
+		$identifier = $this->is_system_question() ? $this->system_ID() : $this->ID();
505
+
506
+		$input_constructor_args = array_merge(
507
+			array(
508
+				'required'                          => $this->required() ? true : false,
509
+				'html_label_text'                   => $this->display_text(),
510
+				'required_validation_error_message' => $this->required_text(),
511
+			),
512
+			$input_constructor_args
513
+		);
514
+		if (! $answer instanceof EE_Answer && $registration instanceof EE_Registration) {
515
+			$answer = EEM_Answer::instance()->get_registration_question_answer_object($registration, $this->ID());
516
+		}
517
+		// has this question been answered ?
518
+		if ($answer instanceof EE_Answer
519
+			&& $answer->value() !== ''
520
+		) {
521
+			// answer gets htmlspecialchars called on it, undo that please
522
+			// because the form input's display strategy may call esc_attr too
523
+			// which also does html special characters
524
+			$values_with_html_special_chars = $answer->value();
525
+			if (is_array($values_with_html_special_chars)) {
526
+				$default_value = array_map('htmlspecialchars_decode', $values_with_html_special_chars);
527
+			} else {
528
+				$default_value = htmlspecialchars_decode($values_with_html_special_chars);
529
+			}
530
+			$input_constructor_args['default'] = $default_value;
531
+		}
532
+		$max_max_for_question = EEM_Question::instance()->absolute_max_for_system_question($this->system_ID());
533
+		if (in_array(
534
+			$this->type(),
535
+			EEM_Question::instance()->questionTypesWithMaxLength(),
536
+			true
537
+		)) {
538
+			$input_constructor_args['validation_strategies'][] = new EE_Max_Length_Validation_Strategy(
539
+				null,
540
+				min($max_max_for_question, $this->max())
541
+			);
542
+		}
543
+		$input_constructor_args = apply_filters(
544
+			'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__input_constructor_args',
545
+			$input_constructor_args,
546
+			$registration,
547
+			$this,
548
+			$answer
549
+		);
550
+
551
+		$result = null;
552
+		switch ($this->type()) {
553
+			// Text
554
+			case EEM_Question::QST_type_text:
555
+				$result = new EE_Text_Input($input_constructor_args);
556
+				break;
557
+			// Textarea
558
+			case EEM_Question::QST_type_textarea:
559
+				$result = new EE_Text_Area_Input($input_constructor_args);
560
+				break;
561
+			// Radio Buttons
562
+			case EEM_Question::QST_type_radio:
563
+				$result = new EE_Radio_Button_Input($this->options(), $input_constructor_args);
564
+				break;
565
+			// Dropdown
566
+			case EEM_Question::QST_type_dropdown:
567
+				$result = new EE_Select_Input($this->options(), $input_constructor_args);
568
+				break;
569
+			// State Dropdown
570
+			case EEM_Question::QST_type_state:
571
+				$state_options = apply_filters(
572
+					'FHEE__EE_Question__generate_form_input__state_options',
573
+					null,
574
+					$this,
575
+					$registration,
576
+					$answer
577
+				);
578
+				$result = new EE_State_Select_Input($state_options, $input_constructor_args);
579
+				break;
580
+			// Country Dropdown
581
+			case EEM_Question::QST_type_country:
582
+				$country_options = apply_filters(
583
+					'FHEE__EE_Question__generate_form_input__country_options',
584
+					null,
585
+					$this,
586
+					$registration,
587
+					$answer
588
+				);
589
+				$result = new EE_Country_Select_Input($country_options, $input_constructor_args);
590
+				break;
591
+			// Checkboxes
592
+			case EEM_Question::QST_type_checkbox:
593
+				$result = new EE_Checkbox_Multi_Input($this->options(), $input_constructor_args);
594
+				break;
595
+			// Date
596
+			case EEM_Question::QST_type_date:
597
+				$result = new EE_Datepicker_Input($input_constructor_args);
598
+				break;
599
+			case EEM_Question::QST_type_html_textarea:
600
+				$input_constructor_args['validation_strategies'][] = new EE_Simple_HTML_Validation_Strategy();
601
+				$result = new EE_Text_Area_Input($input_constructor_args);
602
+				$result->remove_validation_strategy('EE_Plaintext_Validation_Strategy');
603
+				break;
604
+			case EEM_Question::QST_type_email:
605
+				$result = new EE_Email_Input($input_constructor_args);
606
+				break;
607
+			case EEM_Question::QST_type_us_phone:
608
+				$result = new EE_Phone_Input($input_constructor_args);
609
+				break;
610
+			case EEM_Question::QST_type_int:
611
+				$result = new EE_Integer_Input($input_constructor_args);
612
+				break;
613
+			case EEM_Question::QST_type_decimal:
614
+				$result = new EE_Float_Input($input_constructor_args);
615
+				break;
616
+			case EEM_Question::QST_type_url:
617
+				$input_constructor_args['validation_strategies'][] = LoaderFactory::getLoader()->getNew('EE_URL_Validation_Strategy');
618
+				$result = new EE_Text_Input($input_constructor_args);
619
+				break;
620
+			case EEM_Question::QST_type_year:
621
+				$result = new EE_Year_Input(
622
+					$input_constructor_args,
623
+					apply_filters(
624
+						'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__four_digit',
625
+						true,
626
+						$this
627
+					),
628
+					apply_filters(
629
+						'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__early_range',
630
+						100,
631
+						$this
632
+					),
633
+					apply_filters(
634
+						'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__end_range',
635
+						100,
636
+						$this
637
+					)
638
+				);
639
+				break;
640
+			case EEM_Question::QST_type_multi_select:
641
+				$result = new EE_Select_Multiple_Input($this->options(), $input_constructor_args);
642
+				break;
643
+			// fallback
644
+			default:
645
+				$default_input = apply_filters(
646
+					'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__default',
647
+					null,
648
+					$this->type(),
649
+					$this,
650
+					$input_constructor_args
651
+				);
652
+				if (! $default_input) {
653
+					$default_input = new EE_Text_Input($input_constructor_args);
654
+				}
655
+				$result = $default_input;
656
+		}
657
+		return apply_filters('FHEE__EE_Question__generate_form_input__return', $result, $registration, $this, $answer);
658
+	}
659
+
660
+
661
+	/**
662
+	 * Returns whether or not this question type should have question option entries
663
+	 *
664
+	 * @return bool
665
+	 */
666
+	public function should_have_question_options()
667
+	{
668
+		return in_array(
669
+			$this->type(),
670
+			$this->_model->question_types_with_options(),
671
+			true
672
+		);
673
+	}
674 674
 }
Please login to merge, or discard this patch.
libraries/form_sections/inputs/EE_Select_Ajax_Model_Rest_Input.input.php 1 patch
Indentation   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -17,189 +17,189 @@
 block discarded – undo
17 17
 class EE_Select_Ajax_Model_Rest_Input extends EE_Form_Input_With_Options_Base
18 18
 {
19 19
 
20
-    /**
21
-     * @var string $_model_name
22
-     */
23
-    protected $_model_name;
20
+	/**
21
+	 * @var string $_model_name
22
+	 */
23
+	protected $_model_name;
24 24
 
25
-    /**
26
-     * @var string $_display_field_name
27
-     */
28
-    protected $_display_field_name;
25
+	/**
26
+	 * @var string $_display_field_name
27
+	 */
28
+	protected $_display_field_name;
29 29
 
30
-    /**
31
-     * @var string $_value_field_name
32
-     */
33
-    protected $_value_field_name;
30
+	/**
31
+	 * @var string $_value_field_name
32
+	 */
33
+	protected $_value_field_name;
34 34
 
35
-    /**
36
-     * @var array $_extra_select_columns
37
-     */
38
-    protected $_extra_select_columns = array();
35
+	/**
36
+	 * @var array $_extra_select_columns
37
+	 */
38
+	protected $_extra_select_columns = array();
39 39
 
40 40
 
41
-    /**
42
-     * @param array $input_settings     {
43
-     * @type string $model_name         the name of model to be used for searching, both via the REST API and server-side model queries
44
-     * @type array  $query_params       default query parameters which will apply to both REST API queries and server-side queries. This should be
45
-     *                                  in the exact format that will be used for server-side model usage (eg use index 0 for where conditions, not
46
-     *                                  the string "where")
47
-     * @type string $value_field_name   the name of the model field on this model to
48
-     *                                  be used for the HTML select's option's values
49
-     * @type string $display_field_name the name of the model field on this model
50
-     *                                  to be used for the HTML select's option's display text
51
-     * @type array  $select2_args       arguments to be passed directly into the select2's JS constructor
52
-     *                                  }
53
-     *                                  And the arguments accepted by EE_Form_Input_With_Options_Base
54
-     * }
55
-     * @throws EE_Error
56
-     * @throws InvalidArgumentException
57
-     * @throws InvalidDataTypeException
58
-     * @throws InvalidInterfaceException
59
-     */
60
-    public function __construct($input_settings = array())
61
-    {
62
-        // needed input settings:
63
-        // select2_args
64
-        $this->_model_name = EEH_Array::is_set(
65
-            $input_settings,
66
-            'model_name',
67
-            null
68
-        );
69
-        $model = $this->_get_model();
70
-        $query_params = EEH_Array::is_set(
71
-            $input_settings,
72
-            'query_params',
73
-            array()
74
-        );
75
-        // make sure limit and caps are always set
76
-        $query_params = array_merge(
77
-            array( 'limit' => 10, 'caps' => EEM_Base::caps_read_admin ),
78
-            $query_params
79
-        );
80
-        $this->_value_field_name = EEH_Array::is_set(
81
-            $input_settings,
82
-            'value_field_name',
83
-            $model->primary_key_name()
84
-        );
85
-        $this->_display_field_name = EEH_Array::is_set(
86
-            $input_settings,
87
-            'display_field_name',
88
-            $model->get_a_field_of_type('EE_Text_Field_Base')->get_name()
89
-        );
90
-        $this->_extra_select_columns = EEH_Array::is_set(
91
-            $input_settings,
92
-            'extra_select_columns',
93
-            array()
94
-        );
95
-        $this->_add_validation_strategy(
96
-            new EE_Model_Matching_Query_Validation_Strategy(
97
-                '',
98
-                $this->_model_name,
99
-                $query_params,
100
-                $this->_value_field_name
101
-            )
102
-        );
103
-        // get resource endpoint
104
-        $rest_controller = LoaderFactory::getLoader()->getNew(
105
-            'EventEspresso\core\libraries\rest_api\controllers\model\Read'
106
-        );
107
-        $rest_controller->setRequestedVersion(EED_Core_Rest_Api::latest_rest_api_version());
108
-        $default_select2_args = array(
109
-            'ajax' => array(
110
-                'url' => $rest_controller->getVersionedLinkTo(
111
-                    EEH_Inflector::pluralize_and_lower($this->_model_name)
112
-                ),
113
-                'dataType' => 'json',
114
-                'delay' => '250',
115
-                'data_interface' => 'EE_Select2_REST_API_Interface',
116
-                'data_interface_args' => array(
117
-                    'default_query_params' => (object) ModelDataTranslator::prepareQueryParamsForRestApi(
118
-                        $query_params,
119
-                        $model
120
-                    ),
121
-                    'display_field' => $this->_display_field_name,
122
-                    'value_field' => $this->_value_field_name,
123
-                    'nonce' => wp_create_nonce('wp_rest'),
124
-                    'locale' => str_replace('_', '-', strtolower(get_locale()))
125
-                ),
126
-            ),
127
-            'cache' => true,
128
-            'width' => '100'
129
-        );
130
-        $select2_args = array_replace_recursive(
131
-            $default_select2_args,
132
-            (array) EEH_Array::is_set($input_settings, 'select2_args', array())
133
-        );
134
-        $this->set_display_strategy(new EE_Select2_Display_Strategy($select2_args));
135
-        parent::__construct(array(), $input_settings);
136
-    }
41
+	/**
42
+	 * @param array $input_settings     {
43
+	 * @type string $model_name         the name of model to be used for searching, both via the REST API and server-side model queries
44
+	 * @type array  $query_params       default query parameters which will apply to both REST API queries and server-side queries. This should be
45
+	 *                                  in the exact format that will be used for server-side model usage (eg use index 0 for where conditions, not
46
+	 *                                  the string "where")
47
+	 * @type string $value_field_name   the name of the model field on this model to
48
+	 *                                  be used for the HTML select's option's values
49
+	 * @type string $display_field_name the name of the model field on this model
50
+	 *                                  to be used for the HTML select's option's display text
51
+	 * @type array  $select2_args       arguments to be passed directly into the select2's JS constructor
52
+	 *                                  }
53
+	 *                                  And the arguments accepted by EE_Form_Input_With_Options_Base
54
+	 * }
55
+	 * @throws EE_Error
56
+	 * @throws InvalidArgumentException
57
+	 * @throws InvalidDataTypeException
58
+	 * @throws InvalidInterfaceException
59
+	 */
60
+	public function __construct($input_settings = array())
61
+	{
62
+		// needed input settings:
63
+		// select2_args
64
+		$this->_model_name = EEH_Array::is_set(
65
+			$input_settings,
66
+			'model_name',
67
+			null
68
+		);
69
+		$model = $this->_get_model();
70
+		$query_params = EEH_Array::is_set(
71
+			$input_settings,
72
+			'query_params',
73
+			array()
74
+		);
75
+		// make sure limit and caps are always set
76
+		$query_params = array_merge(
77
+			array( 'limit' => 10, 'caps' => EEM_Base::caps_read_admin ),
78
+			$query_params
79
+		);
80
+		$this->_value_field_name = EEH_Array::is_set(
81
+			$input_settings,
82
+			'value_field_name',
83
+			$model->primary_key_name()
84
+		);
85
+		$this->_display_field_name = EEH_Array::is_set(
86
+			$input_settings,
87
+			'display_field_name',
88
+			$model->get_a_field_of_type('EE_Text_Field_Base')->get_name()
89
+		);
90
+		$this->_extra_select_columns = EEH_Array::is_set(
91
+			$input_settings,
92
+			'extra_select_columns',
93
+			array()
94
+		);
95
+		$this->_add_validation_strategy(
96
+			new EE_Model_Matching_Query_Validation_Strategy(
97
+				'',
98
+				$this->_model_name,
99
+				$query_params,
100
+				$this->_value_field_name
101
+			)
102
+		);
103
+		// get resource endpoint
104
+		$rest_controller = LoaderFactory::getLoader()->getNew(
105
+			'EventEspresso\core\libraries\rest_api\controllers\model\Read'
106
+		);
107
+		$rest_controller->setRequestedVersion(EED_Core_Rest_Api::latest_rest_api_version());
108
+		$default_select2_args = array(
109
+			'ajax' => array(
110
+				'url' => $rest_controller->getVersionedLinkTo(
111
+					EEH_Inflector::pluralize_and_lower($this->_model_name)
112
+				),
113
+				'dataType' => 'json',
114
+				'delay' => '250',
115
+				'data_interface' => 'EE_Select2_REST_API_Interface',
116
+				'data_interface_args' => array(
117
+					'default_query_params' => (object) ModelDataTranslator::prepareQueryParamsForRestApi(
118
+						$query_params,
119
+						$model
120
+					),
121
+					'display_field' => $this->_display_field_name,
122
+					'value_field' => $this->_value_field_name,
123
+					'nonce' => wp_create_nonce('wp_rest'),
124
+					'locale' => str_replace('_', '-', strtolower(get_locale()))
125
+				),
126
+			),
127
+			'cache' => true,
128
+			'width' => '100'
129
+		);
130
+		$select2_args = array_replace_recursive(
131
+			$default_select2_args,
132
+			(array) EEH_Array::is_set($input_settings, 'select2_args', array())
133
+		);
134
+		$this->set_display_strategy(new EE_Select2_Display_Strategy($select2_args));
135
+		parent::__construct(array(), $input_settings);
136
+	}
137 137
 
138 138
 
139 139
 
140
-    /**
141
-     * Before setting the raw value (usually because we're setting the default,
142
-     * or we've received a form submission and this might be re-displayed to the user),
143
-     * sets the options so that the current selections appear on initial display.
144
-     *
145
-     * Note: because this input uses EE_Model_Matching_Query_Validation_Strategy
146
-     * for validation, this input's options only affect DISPLAY and NOT validation,
147
-     * which is why its ok to just assume the provided $value to be in the list of acceptable values
148
-     *
149
-     * @param mixed $value
150
-     * @return void
151
-     * @throws \EE_Error
152
-     */
153
-    public function _set_raw_value($value)
154
-    {
155
-        $values_for_options = (array) $value;
156
-        $value_field = $this->_get_model()->field_settings_for($this->_value_field_name);
157
-        $display_field = $this->_get_model()->field_settings_for($this->_display_field_name);
158
-        $this->_extra_select_columns[] = $value_field->get_qualified_column() . ' AS ' . $this->_value_field_name;
159
-        $this->_extra_select_columns[] = $display_field->get_qualified_column() . ' AS ' . $this->_display_field_name;
160
-        $display_values = $this->_get_model()->get_all_wpdb_results(
161
-            array(
162
-                array(
163
-                    $this->_value_field_name => array( 'IN', $values_for_options )
164
-                )
165
-            ),
166
-            ARRAY_A,
167
-            implode(',', $this->_extra_select_columns)
168
-        );
169
-        $select_options = array();
170
-        if (is_array($select_options)) {
171
-            foreach ($display_values as $db_rows) {
172
-                $db_rows = (array) $db_rows;
173
-                $select_options[ $db_rows[ $this->_value_field_name ] ] = apply_filters(
174
-                    'FHEE__EE_Select_Ajax_Model_Rest_Input___set_raw_value__select_option_value',
175
-                    $db_rows[ $this->_display_field_name ],
176
-                    $db_rows
177
-                );
178
-            }
179
-        }
180
-        $this->set_select_options($select_options);
181
-        parent::_set_raw_value($value);
182
-    }
140
+	/**
141
+	 * Before setting the raw value (usually because we're setting the default,
142
+	 * or we've received a form submission and this might be re-displayed to the user),
143
+	 * sets the options so that the current selections appear on initial display.
144
+	 *
145
+	 * Note: because this input uses EE_Model_Matching_Query_Validation_Strategy
146
+	 * for validation, this input's options only affect DISPLAY and NOT validation,
147
+	 * which is why its ok to just assume the provided $value to be in the list of acceptable values
148
+	 *
149
+	 * @param mixed $value
150
+	 * @return void
151
+	 * @throws \EE_Error
152
+	 */
153
+	public function _set_raw_value($value)
154
+	{
155
+		$values_for_options = (array) $value;
156
+		$value_field = $this->_get_model()->field_settings_for($this->_value_field_name);
157
+		$display_field = $this->_get_model()->field_settings_for($this->_display_field_name);
158
+		$this->_extra_select_columns[] = $value_field->get_qualified_column() . ' AS ' . $this->_value_field_name;
159
+		$this->_extra_select_columns[] = $display_field->get_qualified_column() . ' AS ' . $this->_display_field_name;
160
+		$display_values = $this->_get_model()->get_all_wpdb_results(
161
+			array(
162
+				array(
163
+					$this->_value_field_name => array( 'IN', $values_for_options )
164
+				)
165
+			),
166
+			ARRAY_A,
167
+			implode(',', $this->_extra_select_columns)
168
+		);
169
+		$select_options = array();
170
+		if (is_array($select_options)) {
171
+			foreach ($display_values as $db_rows) {
172
+				$db_rows = (array) $db_rows;
173
+				$select_options[ $db_rows[ $this->_value_field_name ] ] = apply_filters(
174
+					'FHEE__EE_Select_Ajax_Model_Rest_Input___set_raw_value__select_option_value',
175
+					$db_rows[ $this->_display_field_name ],
176
+					$db_rows
177
+				);
178
+			}
179
+		}
180
+		$this->set_select_options($select_options);
181
+		parent::_set_raw_value($value);
182
+	}
183 183
 
184
-    /**
185
-     * Returns the model, or throws an exception if the model name provided in constructor doesn't exist
186
-     * @return EEM_Base
187
-     * @throws EE_Error
188
-     */
189
-    protected function _get_model()
190
-    {
191
-        if (! EE_Registry::instance()->is_model_name($this->_model_name)) {
192
-            throw new EE_Error(
193
-                sprintf(
194
-                    __(
195
-                        '%1$s is not a proper model name. Please provide a model name in the "model_name" form input argument',
196
-                        'event_espresso'
197
-                    ),
198
-                    $this->_model_name
199
-                )
200
-            );
201
-        } else {
202
-            return EE_Registry::instance()->load_model($this->_model_name);
203
-        }
204
-    }
184
+	/**
185
+	 * Returns the model, or throws an exception if the model name provided in constructor doesn't exist
186
+	 * @return EEM_Base
187
+	 * @throws EE_Error
188
+	 */
189
+	protected function _get_model()
190
+	{
191
+		if (! EE_Registry::instance()->is_model_name($this->_model_name)) {
192
+			throw new EE_Error(
193
+				sprintf(
194
+					__(
195
+						'%1$s is not a proper model name. Please provide a model name in the "model_name" form input argument',
196
+						'event_espresso'
197
+					),
198
+					$this->_model_name
199
+				)
200
+			);
201
+		} else {
202
+			return EE_Registry::instance()->load_model($this->_model_name);
203
+		}
204
+	}
205 205
 }
Please login to merge, or discard this patch.
espresso.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -38,103 +38,103 @@
 block discarded – undo
38 38
  * @since           4.0
39 39
  */
40 40
 if (function_exists('espresso_version')) {
41
-    if (! function_exists('espresso_duplicate_plugin_error')) {
42
-        /**
43
-         *    espresso_duplicate_plugin_error
44
-         *    displays if more than one version of EE is activated at the same time
45
-         */
46
-        function espresso_duplicate_plugin_error()
47
-        {
48
-            ?>
41
+	if (! function_exists('espresso_duplicate_plugin_error')) {
42
+		/**
43
+		 *    espresso_duplicate_plugin_error
44
+		 *    displays if more than one version of EE is activated at the same time
45
+		 */
46
+		function espresso_duplicate_plugin_error()
47
+		{
48
+			?>
49 49
             <div class="error">
50 50
                 <p>
51 51
                     <?php
52
-                    echo esc_html__(
53
-                        'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
-                        'event_espresso'
55
-                    ); ?>
52
+					echo esc_html__(
53
+						'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
+						'event_espresso'
55
+					); ?>
56 56
                 </p>
57 57
             </div>
58 58
             <?php
59
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
60
-        }
61
-    }
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
59
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+		}
61
+	}
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.4.0');
65
-    if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
-        /**
67
-         * espresso_minimum_php_version_error
68
-         *
69
-         * @return void
70
-         */
71
-        function espresso_minimum_php_version_error()
72
-        {
73
-            ?>
64
+	define('EE_MIN_PHP_VER_REQUIRED', '5.4.0');
65
+	if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
+		/**
67
+		 * espresso_minimum_php_version_error
68
+		 *
69
+		 * @return void
70
+		 */
71
+		function espresso_minimum_php_version_error()
72
+		{
73
+			?>
74 74
             <div class="error">
75 75
                 <p>
76 76
                     <?php
77
-                    printf(
78
-                        esc_html__(
79
-                            'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
-                            'event_espresso'
81
-                        ),
82
-                        EE_MIN_PHP_VER_REQUIRED,
83
-                        PHP_VERSION,
84
-                        '<br/>',
85
-                        '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
-                    );
87
-                    ?>
77
+					printf(
78
+						esc_html__(
79
+							'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
+							'event_espresso'
81
+						),
82
+						EE_MIN_PHP_VER_REQUIRED,
83
+						PHP_VERSION,
84
+						'<br/>',
85
+						'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
+					);
87
+					?>
88 88
                 </p>
89 89
             </div>
90 90
             <?php
91
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
92
-        }
91
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
92
+		}
93 93
 
94
-        add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
-    } else {
96
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
-        /**
98
-         * espresso_version
99
-         * Returns the plugin version
100
-         *
101
-         * @return string
102
-         */
103
-        function espresso_version()
104
-        {
105
-            return apply_filters('FHEE__espresso__espresso_version', '4.9.68.rc.012');
106
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
+		/**
98
+		 * espresso_version
99
+		 * Returns the plugin version
100
+		 *
101
+		 * @return string
102
+		 */
103
+		function espresso_version()
104
+		{
105
+			return apply_filters('FHEE__espresso__espresso_version', '4.9.68.rc.012');
106
+		}
107 107
 
108
-        /**
109
-         * espresso_plugin_activation
110
-         * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
-         */
112
-        function espresso_plugin_activation()
113
-        {
114
-            update_option('ee_espresso_activation', true);
115
-        }
108
+		/**
109
+		 * espresso_plugin_activation
110
+		 * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
+		 */
112
+		function espresso_plugin_activation()
113
+		{
114
+			update_option('ee_espresso_activation', true);
115
+		}
116 116
 
117
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
117
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
118 118
 
119
-        require_once __DIR__ . '/core/bootstrap_espresso.php';
120
-        bootstrap_espresso();
121
-    }
119
+		require_once __DIR__ . '/core/bootstrap_espresso.php';
120
+		bootstrap_espresso();
121
+	}
122 122
 }
123 123
 if (! function_exists('espresso_deactivate_plugin')) {
124
-    /**
125
-     *    deactivate_plugin
126
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
-     *
128
-     * @access public
129
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
-     * @return    void
131
-     */
132
-    function espresso_deactivate_plugin($plugin_basename = '')
133
-    {
134
-        if (! function_exists('deactivate_plugins')) {
135
-            require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
-        }
137
-        unset($_GET['activate'], $_REQUEST['activate']);
138
-        deactivate_plugins($plugin_basename);
139
-    }
124
+	/**
125
+	 *    deactivate_plugin
126
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
+	 *
128
+	 * @access public
129
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
+	 * @return    void
131
+	 */
132
+	function espresso_deactivate_plugin($plugin_basename = '')
133
+	{
134
+		if (! function_exists('deactivate_plugins')) {
135
+			require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
+		}
137
+		unset($_GET['activate'], $_REQUEST['activate']);
138
+		deactivate_plugins($plugin_basename);
139
+	}
140 140
 }
Please login to merge, or discard this patch.
core/EE_Dependency_Map.core.php 1 patch
Indentation   +1044 added lines, -1044 removed lines patch added patch discarded remove patch
@@ -20,1048 +20,1048 @@
 block discarded – undo
20 20
 class EE_Dependency_Map
21 21
 {
22 22
 
23
-    /**
24
-     * This means that the requested class dependency is not present in the dependency map
25
-     */
26
-    const not_registered = 0;
27
-
28
-    /**
29
-     * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
30
-     */
31
-    const load_new_object = 1;
32
-
33
-    /**
34
-     * This instructs class loaders to return a previously instantiated and cached object for the requested class.
35
-     * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
36
-     */
37
-    const load_from_cache = 2;
38
-
39
-    /**
40
-     * When registering a dependency,
41
-     * this indicates to keep any existing dependencies that already exist,
42
-     * and simply discard any new dependencies declared in the incoming data
43
-     */
44
-    const KEEP_EXISTING_DEPENDENCIES = 0;
45
-
46
-    /**
47
-     * When registering a dependency,
48
-     * this indicates to overwrite any existing dependencies that already exist using the incoming data
49
-     */
50
-    const OVERWRITE_DEPENDENCIES = 1;
51
-
52
-
53
-    /**
54
-     * @type EE_Dependency_Map $_instance
55
-     */
56
-    protected static $_instance;
57
-
58
-    /**
59
-     * @var ClassInterfaceCache $class_cache
60
-     */
61
-    private $class_cache;
62
-
63
-    /**
64
-     * @type RequestInterface $request
65
-     */
66
-    protected $request;
67
-
68
-    /**
69
-     * @type LegacyRequestInterface $legacy_request
70
-     */
71
-    protected $legacy_request;
72
-
73
-    /**
74
-     * @type ResponseInterface $response
75
-     */
76
-    protected $response;
77
-
78
-    /**
79
-     * @type LoaderInterface $loader
80
-     */
81
-    protected $loader;
82
-
83
-    /**
84
-     * @type array $_dependency_map
85
-     */
86
-    protected $_dependency_map = array();
87
-
88
-    /**
89
-     * @type array $_class_loaders
90
-     */
91
-    protected $_class_loaders = array();
92
-
93
-
94
-    /**
95
-     * EE_Dependency_Map constructor.
96
-     *
97
-     * @param ClassInterfaceCache $class_cache
98
-     */
99
-    protected function __construct(ClassInterfaceCache $class_cache)
100
-    {
101
-        $this->class_cache = $class_cache;
102
-        do_action('EE_Dependency_Map____construct', $this);
103
-    }
104
-
105
-
106
-    /**
107
-     * @return void
108
-     */
109
-    public function initialize()
110
-    {
111
-        $this->_register_core_dependencies();
112
-        $this->_register_core_class_loaders();
113
-        $this->_register_core_aliases();
114
-    }
115
-
116
-
117
-    /**
118
-     * @singleton method used to instantiate class object
119
-     * @param ClassInterfaceCache|null $class_cache
120
-     * @return EE_Dependency_Map
121
-     */
122
-    public static function instance(ClassInterfaceCache $class_cache = null)
123
-    {
124
-        // check if class object is instantiated, and instantiated properly
125
-        if (! self::$_instance instanceof EE_Dependency_Map
126
-            && $class_cache instanceof ClassInterfaceCache
127
-        ) {
128
-            self::$_instance = new EE_Dependency_Map($class_cache);
129
-        }
130
-        return self::$_instance;
131
-    }
132
-
133
-
134
-    /**
135
-     * @param RequestInterface $request
136
-     */
137
-    public function setRequest(RequestInterface $request)
138
-    {
139
-        $this->request = $request;
140
-    }
141
-
142
-
143
-    /**
144
-     * @param LegacyRequestInterface $legacy_request
145
-     */
146
-    public function setLegacyRequest(LegacyRequestInterface $legacy_request)
147
-    {
148
-        $this->legacy_request = $legacy_request;
149
-    }
150
-
151
-
152
-    /**
153
-     * @param ResponseInterface $response
154
-     */
155
-    public function setResponse(ResponseInterface $response)
156
-    {
157
-        $this->response = $response;
158
-    }
159
-
160
-
161
-    /**
162
-     * @param LoaderInterface $loader
163
-     */
164
-    public function setLoader(LoaderInterface $loader)
165
-    {
166
-        $this->loader = $loader;
167
-    }
168
-
169
-
170
-    /**
171
-     * @param string $class
172
-     * @param array  $dependencies
173
-     * @param int    $overwrite
174
-     * @return bool
175
-     */
176
-    public static function register_dependencies(
177
-        $class,
178
-        array $dependencies,
179
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
180
-    ) {
181
-        return self::$_instance->registerDependencies($class, $dependencies, $overwrite);
182
-    }
183
-
184
-
185
-    /**
186
-     * Assigns an array of class names and corresponding load sources (new or cached)
187
-     * to the class specified by the first parameter.
188
-     * IMPORTANT !!!
189
-     * The order of elements in the incoming $dependencies array MUST match
190
-     * the order of the constructor parameters for the class in question.
191
-     * This is especially important when overriding any existing dependencies that are registered.
192
-     * the third parameter controls whether any duplicate dependencies are overwritten or not.
193
-     *
194
-     * @param string $class
195
-     * @param array  $dependencies
196
-     * @param int    $overwrite
197
-     * @return bool
198
-     */
199
-    public function registerDependencies(
200
-        $class,
201
-        array $dependencies,
202
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
203
-    ) {
204
-        $class = trim($class, '\\');
205
-        $registered = false;
206
-        if (empty(self::$_instance->_dependency_map[ $class ])) {
207
-            self::$_instance->_dependency_map[ $class ] = array();
208
-        }
209
-        // we need to make sure that any aliases used when registering a dependency
210
-        // get resolved to the correct class name
211
-        foreach ($dependencies as $dependency => $load_source) {
212
-            $alias = self::$_instance->getFqnForAlias($dependency);
213
-            if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
214
-                || ! isset(self::$_instance->_dependency_map[ $class ][ $alias ])
215
-            ) {
216
-                unset($dependencies[ $dependency ]);
217
-                $dependencies[ $alias ] = $load_source;
218
-                $registered = true;
219
-            }
220
-        }
221
-        // now add our two lists of dependencies together.
222
-        // using Union (+=) favours the arrays in precedence from left to right,
223
-        // so $dependencies is NOT overwritten because it is listed first
224
-        // ie: with A = B + C, entries in B take precedence over duplicate entries in C
225
-        // Union is way faster than array_merge() but should be used with caution...
226
-        // especially with numerically indexed arrays
227
-        $dependencies += self::$_instance->_dependency_map[ $class ];
228
-        // now we need to ensure that the resulting dependencies
229
-        // array only has the entries that are required for the class
230
-        // so first count how many dependencies were originally registered for the class
231
-        $dependency_count = count(self::$_instance->_dependency_map[ $class ]);
232
-        // if that count is non-zero (meaning dependencies were already registered)
233
-        self::$_instance->_dependency_map[ $class ] = $dependency_count
234
-            // then truncate the  final array to match that count
235
-            ? array_slice($dependencies, 0, $dependency_count)
236
-            // otherwise just take the incoming array because nothing previously existed
237
-            : $dependencies;
238
-        return $registered;
239
-    }
240
-
241
-
242
-    /**
243
-     * @param string $class_name
244
-     * @param string $loader
245
-     * @return bool
246
-     * @throws DomainException
247
-     */
248
-    public static function register_class_loader($class_name, $loader = 'load_core')
249
-    {
250
-        if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
251
-            throw new DomainException(
252
-                esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
253
-            );
254
-        }
255
-        // check that loader is callable or method starts with "load_" and exists in EE_Registry
256
-        if (! is_callable($loader)
257
-            && (
258
-                strpos($loader, 'load_') !== 0
259
-                || ! method_exists('EE_Registry', $loader)
260
-            )
261
-        ) {
262
-            throw new DomainException(
263
-                sprintf(
264
-                    esc_html__(
265
-                        '"%1$s" is not a valid loader method on EE_Registry.',
266
-                        'event_espresso'
267
-                    ),
268
-                    $loader
269
-                )
270
-            );
271
-        }
272
-        $class_name = self::$_instance->getFqnForAlias($class_name);
273
-        if (! isset(self::$_instance->_class_loaders[ $class_name ])) {
274
-            self::$_instance->_class_loaders[ $class_name ] = $loader;
275
-            return true;
276
-        }
277
-        return false;
278
-    }
279
-
280
-
281
-    /**
282
-     * @return array
283
-     */
284
-    public function dependency_map()
285
-    {
286
-        return $this->_dependency_map;
287
-    }
288
-
289
-
290
-    /**
291
-     * returns TRUE if dependency map contains a listing for the provided class name
292
-     *
293
-     * @param string $class_name
294
-     * @return boolean
295
-     */
296
-    public function has($class_name = '')
297
-    {
298
-        // all legacy models have the same dependencies
299
-        if (strpos($class_name, 'EEM_') === 0) {
300
-            $class_name = 'LEGACY_MODELS';
301
-        }
302
-        return isset($this->_dependency_map[ $class_name ]) ? true : false;
303
-    }
304
-
305
-
306
-    /**
307
-     * returns TRUE if dependency map contains a listing for the provided class name AND dependency
308
-     *
309
-     * @param string $class_name
310
-     * @param string $dependency
311
-     * @return bool
312
-     */
313
-    public function has_dependency_for_class($class_name = '', $dependency = '')
314
-    {
315
-        // all legacy models have the same dependencies
316
-        if (strpos($class_name, 'EEM_') === 0) {
317
-            $class_name = 'LEGACY_MODELS';
318
-        }
319
-        $dependency = $this->getFqnForAlias($dependency, $class_name);
320
-        return isset($this->_dependency_map[ $class_name ][ $dependency ])
321
-            ? true
322
-            : false;
323
-    }
324
-
325
-
326
-    /**
327
-     * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
328
-     *
329
-     * @param string $class_name
330
-     * @param string $dependency
331
-     * @return int
332
-     */
333
-    public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
334
-    {
335
-        // all legacy models have the same dependencies
336
-        if (strpos($class_name, 'EEM_') === 0) {
337
-            $class_name = 'LEGACY_MODELS';
338
-        }
339
-        $dependency = $this->getFqnForAlias($dependency);
340
-        return $this->has_dependency_for_class($class_name, $dependency)
341
-            ? $this->_dependency_map[ $class_name ][ $dependency ]
342
-            : EE_Dependency_Map::not_registered;
343
-    }
344
-
345
-
346
-    /**
347
-     * @param string $class_name
348
-     * @return string | Closure
349
-     */
350
-    public function class_loader($class_name)
351
-    {
352
-        // all legacy models use load_model()
353
-        if (strpos($class_name, 'EEM_') === 0) {
354
-            return 'load_model';
355
-        }
356
-        // EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
357
-        // perform strpos() first to avoid loading regex every time we load a class
358
-        if (strpos($class_name, 'EE_CPT_') === 0
359
-            && preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
360
-        ) {
361
-            return 'load_core';
362
-        }
363
-        $class_name = $this->getFqnForAlias($class_name);
364
-        return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
365
-    }
366
-
367
-
368
-    /**
369
-     * @return array
370
-     */
371
-    public function class_loaders()
372
-    {
373
-        return $this->_class_loaders;
374
-    }
375
-
376
-
377
-    /**
378
-     * adds an alias for a classname
379
-     *
380
-     * @param string $fqcn      the class name that should be used (concrete class to replace interface)
381
-     * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
382
-     * @param string $for_class the class that has the dependency (is type hinting for the interface)
383
-     */
384
-    public function add_alias($fqcn, $alias, $for_class = '')
385
-    {
386
-        $this->class_cache->addAlias($fqcn, $alias, $for_class);
387
-    }
388
-
389
-
390
-    /**
391
-     * Returns TRUE if the provided fully qualified name IS an alias
392
-     * WHY?
393
-     * Because if a class is type hinting for a concretion,
394
-     * then why would we need to find another class to supply it?
395
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
396
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
397
-     * Don't go looking for some substitute.
398
-     * Whereas if a class is type hinting for an interface...
399
-     * then we need to find an actual class to use.
400
-     * So the interface IS the alias for some other FQN,
401
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
402
-     * represents some other class.
403
-     *
404
-     * @param string $fqn
405
-     * @param string $for_class
406
-     * @return bool
407
-     */
408
-    public function isAlias($fqn = '', $for_class = '')
409
-    {
410
-        return $this->class_cache->isAlias($fqn, $for_class);
411
-    }
412
-
413
-
414
-    /**
415
-     * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
416
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
417
-     *  for example:
418
-     *      if the following two entries were added to the _aliases array:
419
-     *          array(
420
-     *              'interface_alias'           => 'some\namespace\interface'
421
-     *              'some\namespace\interface'  => 'some\namespace\classname'
422
-     *          )
423
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
424
-     *      to load an instance of 'some\namespace\classname'
425
-     *
426
-     * @param string $alias
427
-     * @param string $for_class
428
-     * @return string
429
-     */
430
-    public function getFqnForAlias($alias = '', $for_class = '')
431
-    {
432
-        return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
433
-    }
434
-
435
-
436
-    /**
437
-     * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
438
-     * if one exists, or whether a new object should be generated every time the requested class is loaded.
439
-     * This is done by using the following class constants:
440
-     *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
441
-     *        EE_Dependency_Map::load_new_object - generates a new object every time
442
-     */
443
-    protected function _register_core_dependencies()
444
-    {
445
-        $this->_dependency_map = array(
446
-            'EE_Request_Handler'                                                                                          => array(
447
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
448
-            ),
449
-            'EE_System'                                                                                                   => array(
450
-                'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
451
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
452
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
453
-                'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
454
-            ),
455
-            'EE_Session'                                                                                                  => array(
456
-                'EventEspresso\core\services\cache\TransientCacheStorage'  => EE_Dependency_Map::load_from_cache,
457
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
458
-                'EventEspresso\core\services\request\Request'              => EE_Dependency_Map::load_from_cache,
459
-                'EE_Encryption'                                            => EE_Dependency_Map::load_from_cache,
460
-            ),
461
-            'EE_Cart'                                                                                                     => array(
462
-                'EE_Session' => EE_Dependency_Map::load_from_cache,
463
-            ),
464
-            'EE_Front_Controller'                                                                                         => array(
465
-                'EE_Registry'              => EE_Dependency_Map::load_from_cache,
466
-                'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
467
-                'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
468
-            ),
469
-            'EE_Messenger_Collection_Loader'                                                                              => array(
470
-                'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
471
-            ),
472
-            'EE_Message_Type_Collection_Loader'                                                                           => array(
473
-                'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
474
-            ),
475
-            'EE_Message_Resource_Manager'                                                                                 => array(
476
-                'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
477
-                'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
478
-                'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
479
-            ),
480
-            'EE_Message_Factory'                                                                                          => array(
481
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
482
-            ),
483
-            'EE_messages'                                                                                                 => array(
484
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
485
-            ),
486
-            'EE_Messages_Generator'                                                                                       => array(
487
-                'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
488
-                'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
489
-                'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
490
-                'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
491
-            ),
492
-            'EE_Messages_Processor'                                                                                       => array(
493
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
494
-            ),
495
-            'EE_Messages_Queue'                                                                                           => array(
496
-                'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
497
-            ),
498
-            'EE_Messages_Template_Defaults'                                                                               => array(
499
-                'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
500
-                'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
501
-            ),
502
-            'EE_Message_To_Generate_From_Request'                                                                         => array(
503
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
504
-                'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
505
-            ),
506
-            'EventEspresso\core\services\commands\CommandBus'                                                             => array(
507
-                'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
508
-            ),
509
-            'EventEspresso\services\commands\CommandHandler'                                                              => array(
510
-                'EE_Registry'         => EE_Dependency_Map::load_from_cache,
511
-                'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
512
-            ),
513
-            'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => array(
514
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
515
-            ),
516
-            'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => array(
517
-                'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
518
-                'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
519
-            ),
520
-            'EventEspresso\core\services\commands\CommandFactory'                                                         => array(
521
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
522
-            ),
523
-            'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => array(
524
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
525
-            ),
526
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => array(
527
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
528
-            ),
529
-            'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => array(
530
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
531
-            ),
532
-            'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => array(
533
-                'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
534
-            ),
535
-            'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => array(
536
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
537
-            ),
538
-            'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => array(
539
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
540
-            ),
541
-            'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => array(
542
-                'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
543
-            ),
544
-            'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => array(
545
-                'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
546
-            ),
547
-            'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => array(
548
-                'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
549
-            ),
550
-            'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => array(
551
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
552
-            ),
553
-            'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => array(
554
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
555
-            ),
556
-            'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => array(
557
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
558
-            ),
559
-            'EventEspresso\core\services\database\TableManager'                                                           => array(
560
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
561
-            ),
562
-            'EE_Data_Migration_Class_Base'                                                                                => array(
563
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
564
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
565
-            ),
566
-            'EE_DMS_Core_4_1_0'                                                                                           => array(
567
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
568
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
569
-            ),
570
-            'EE_DMS_Core_4_2_0'                                                                                           => array(
571
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
572
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
573
-            ),
574
-            'EE_DMS_Core_4_3_0'                                                                                           => array(
575
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
576
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
577
-            ),
578
-            'EE_DMS_Core_4_4_0'                                                                                           => array(
579
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
580
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
581
-            ),
582
-            'EE_DMS_Core_4_5_0'                                                                                           => array(
583
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
584
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
585
-            ),
586
-            'EE_DMS_Core_4_6_0'                                                                                           => array(
587
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
588
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
589
-            ),
590
-            'EE_DMS_Core_4_7_0'                                                                                           => array(
591
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
592
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
593
-            ),
594
-            'EE_DMS_Core_4_8_0'                                                                                           => array(
595
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
596
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
597
-            ),
598
-            'EE_DMS_Core_4_9_0'                                                                                           => array(
599
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
600
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
601
-            ),
602
-            'EventEspresso\core\services\assets\I18nRegistry'                                                             => array(
603
-                array(),
604
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
605
-            ),
606
-            'EventEspresso\core\services\assets\Registry'                                                                 => array(
607
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
608
-                'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
609
-            ),
610
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled'                                             => array(
611
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
612
-            ),
613
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout'                                              => array(
614
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
615
-            ),
616
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees'                                        => array(
617
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
618
-            ),
619
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEvents'                                                => array(
620
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
621
-            ),
622
-            'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou'                                              => array(
623
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
624
-            ),
625
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector'                                        => array(
626
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
627
-            ),
628
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage'                                               => array(
629
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
630
-            ),
631
-            'EventEspresso\core\services\cache\BasicCacheManager'                                                         => array(
632
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
633
-            ),
634
-            'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => array(
635
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
636
-            ),
637
-            'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => array(
638
-                'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
639
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
640
-            ),
641
-            'EventEspresso\core\domain\values\EmailAddress'                                                               => array(
642
-                null,
643
-                'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
644
-            ),
645
-            'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => array(
646
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
647
-            ),
648
-            'LEGACY_MODELS'                                                                                               => array(
649
-                null,
650
-                'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
651
-            ),
652
-            'EE_Module_Request_Router'                                                                                    => array(
653
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
654
-            ),
655
-            'EE_Registration_Processor'                                                                                   => array(
656
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
657
-            ),
658
-            'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => array(
659
-                null,
660
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
661
-                'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
662
-            ),
663
-            'EventEspresso\core\services\licensing\LicenseService'                                                        => array(
664
-                'EventEspresso\core\domain\services\pue\Stats'  => EE_Dependency_Map::load_from_cache,
665
-                'EventEspresso\core\domain\services\pue\Config' => EE_Dependency_Map::load_from_cache,
666
-            ),
667
-            'EE_Admin_Transactions_List_Table'                                                                            => array(
668
-                null,
669
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
670
-            ),
671
-            'EventEspresso\core\domain\services\pue\Stats'                                                                => array(
672
-                'EventEspresso\core\domain\services\pue\Config'        => EE_Dependency_Map::load_from_cache,
673
-                'EE_Maintenance_Mode'                                  => EE_Dependency_Map::load_from_cache,
674
-                'EventEspresso\core\domain\services\pue\StatsGatherer' => EE_Dependency_Map::load_from_cache,
675
-            ),
676
-            'EventEspresso\core\domain\services\pue\Config'                                                               => array(
677
-                'EE_Network_Config' => EE_Dependency_Map::load_from_cache,
678
-                'EE_Config'         => EE_Dependency_Map::load_from_cache,
679
-            ),
680
-            'EventEspresso\core\domain\services\pue\StatsGatherer'                                                        => array(
681
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
682
-                'EEM_Event'          => EE_Dependency_Map::load_from_cache,
683
-                'EEM_Datetime'       => EE_Dependency_Map::load_from_cache,
684
-                'EEM_Ticket'         => EE_Dependency_Map::load_from_cache,
685
-                'EEM_Registration'   => EE_Dependency_Map::load_from_cache,
686
-                'EEM_Transaction'    => EE_Dependency_Map::load_from_cache,
687
-                'EE_Config'          => EE_Dependency_Map::load_from_cache,
688
-            ),
689
-            'EventEspresso\core\domain\services\admin\ExitModal'                                                          => array(
690
-                'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
691
-            ),
692
-            'EventEspresso\core\domain\services\admin\PluginUpsells'                                                      => array(
693
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
694
-            ),
695
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => array(
696
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
697
-                'EE_Session'             => EE_Dependency_Map::load_from_cache,
698
-            ),
699
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings'                                => array(
700
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
701
-            ),
702
-            'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => array(
703
-                'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
704
-                'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
705
-                'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
706
-                'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
707
-                'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
708
-            ),
709
-            'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => array(
710
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
711
-            ),
712
-            'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => array(
713
-                'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
714
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
715
-            ),
716
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => array(
717
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
718
-            ),
719
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => array(
720
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
721
-            ),
722
-            'EE_CPT_Strategy'                                                                                             => array(
723
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
724
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
725
-            ),
726
-            'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => array(
727
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
728
-            ),
729
-            'EventEspresso\core\domain\services\assets\CoreAssetManager'                                                  => array(
730
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
731
-                'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
732
-                'EE_Template_Config'                                 => EE_Dependency_Map::load_from_cache,
733
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
734
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
735
-            ),
736
-            'EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy' => array(
737
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
738
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache
739
-            ),
740
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendee' => array(
741
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
742
-            ),
743
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendeeBillingData' => array(
744
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
745
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache
746
-            ),
747
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportCheckins' => array(
748
-                'EEM_Checkin' => EE_Dependency_Map::load_from_cache,
749
-            ),
750
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportRegistration' => array(
751
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache,
752
-            ),
753
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportTransaction' => array(
754
-                'EEM_Transaction' => EE_Dependency_Map::load_from_cache,
755
-            ),
756
-            'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAttendeeData' => array(
757
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
758
-            ),
759
-            'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAnswers' => array(
760
-                'EEM_Answer' => EE_Dependency_Map::load_from_cache,
761
-                'EEM_Question' => EE_Dependency_Map::load_from_cache,
762
-            ),
763
-            'EventEspresso\core\CPTs\CptQueryModifier' => array(
764
-                null,
765
-                null,
766
-                null,
767
-                'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
768
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
769
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
770
-            ),
771
-            'EventEspresso\core\domain\services\admin\privacy\forms\PrivacySettingsFormHandler' => array(
772
-                'EE_Registry' => EE_Dependency_Map::load_from_cache,
773
-                'EE_Config' => EE_Dependency_Map::load_from_cache
774
-            ),
775
-            'EventEspresso\core\services\editor\BlockRegistrationManager'                                                 => array(
776
-                'EventEspresso\core\services\assets\BlockAssetManagerCollection' => EE_Dependency_Map::load_from_cache,
777
-                'EventEspresso\core\domain\entities\editor\BlockCollection'      => EE_Dependency_Map::load_from_cache,
778
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => EE_Dependency_Map::load_from_cache,
779
-                'EventEspresso\core\services\request\Request'                    => EE_Dependency_Map::load_from_cache,
780
-            ),
781
-            'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => array(
782
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
783
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
784
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
785
-            ),
786
-            'EventEspresso\core\domain\entities\editor\blocks\EventAttendees' => array(
787
-                'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => self::load_from_cache,
788
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
789
-                'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees' => self::load_from_cache,
790
-            ),
791
-            'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => array(
792
-                'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache,
793
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
794
-                'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache,
795
-            ),
796
-            'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => array(
797
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
798
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
799
-            ),
800
-            'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => array(
801
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
802
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => EE_Dependency_Map::load_from_cache,
803
-            ),
804
-            'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => array(
805
-                'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache
806
-            ),
807
-            'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => array(
808
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
809
-            ),
810
-            'EventEspresso\core\libraries\rest_api\controllers\model\Read' => array(
811
-                'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache
812
-            ),
813
-            'EventEspresso\core\libraries\rest_api\calculations\Datetime' => array(
814
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
815
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
816
-            ),
817
-            'EventEspresso\core\libraries\rest_api\calculations\Event' => array(
818
-                'EEM_Event' => EE_Dependency_Map::load_from_cache,
819
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
820
-            ),
821
-            'EventEspresso\core\libraries\rest_api\calculations\Registration' => array(
822
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
823
-            ),
824
-            'EE_URL_Validation_Strategy' => array(
825
-                null,
826
-                null,
827
-                'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache
828
-            ),
829
-        );
830
-    }
831
-
832
-
833
-    /**
834
-     * Registers how core classes are loaded.
835
-     * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
836
-     *        'EE_Request_Handler' => 'load_core'
837
-     *        'EE_Messages_Queue'  => 'load_lib'
838
-     *        'EEH_Debug_Tools'    => 'load_helper'
839
-     * or, if greater control is required, by providing a custom closure. For example:
840
-     *        'Some_Class' => function () {
841
-     *            return new Some_Class();
842
-     *        },
843
-     * This is required for instantiating dependencies
844
-     * where an interface has been type hinted in a class constructor. For example:
845
-     *        'Required_Interface' => function () {
846
-     *            return new A_Class_That_Implements_Required_Interface();
847
-     *        },
848
-     */
849
-    protected function _register_core_class_loaders()
850
-    {
851
-        $this->_class_loaders = array(
852
-            // load_core
853
-            'EE_Dependency_Map'                            => function () {
854
-                return $this;
855
-            },
856
-            'EE_Capabilities'                              => 'load_core',
857
-            'EE_Encryption'                                => 'load_core',
858
-            'EE_Front_Controller'                          => 'load_core',
859
-            'EE_Module_Request_Router'                     => 'load_core',
860
-            'EE_Registry'                                  => 'load_core',
861
-            'EE_Request'                                   => function () {
862
-                return $this->legacy_request;
863
-            },
864
-            'EventEspresso\core\services\request\Request'  => function () {
865
-                return $this->request;
866
-            },
867
-            'EventEspresso\core\services\request\Response' => function () {
868
-                return $this->response;
869
-            },
870
-            'EE_Base'                                      => 'load_core',
871
-            'EE_Request_Handler'                           => 'load_core',
872
-            'EE_Session'                                   => 'load_core',
873
-            'EE_Cron_Tasks'                                => 'load_core',
874
-            'EE_System'                                    => 'load_core',
875
-            'EE_Maintenance_Mode'                          => 'load_core',
876
-            'EE_Register_CPTs'                             => 'load_core',
877
-            'EE_Admin'                                     => 'load_core',
878
-            'EE_CPT_Strategy'                              => 'load_core',
879
-            // load_lib
880
-            'EE_Message_Resource_Manager'                  => 'load_lib',
881
-            'EE_Message_Type_Collection'                   => 'load_lib',
882
-            'EE_Message_Type_Collection_Loader'            => 'load_lib',
883
-            'EE_Messenger_Collection'                      => 'load_lib',
884
-            'EE_Messenger_Collection_Loader'               => 'load_lib',
885
-            'EE_Messages_Processor'                        => 'load_lib',
886
-            'EE_Message_Repository'                        => 'load_lib',
887
-            'EE_Messages_Queue'                            => 'load_lib',
888
-            'EE_Messages_Data_Handler_Collection'          => 'load_lib',
889
-            'EE_Message_Template_Group_Collection'         => 'load_lib',
890
-            'EE_Payment_Method_Manager'                    => 'load_lib',
891
-            'EE_Messages_Generator'                        => function () {
892
-                return EE_Registry::instance()->load_lib(
893
-                    'Messages_Generator',
894
-                    array(),
895
-                    false,
896
-                    false
897
-                );
898
-            },
899
-            'EE_Messages_Template_Defaults'                => function ($arguments = array()) {
900
-                return EE_Registry::instance()->load_lib(
901
-                    'Messages_Template_Defaults',
902
-                    $arguments,
903
-                    false,
904
-                    false
905
-                );
906
-            },
907
-            // load_helper
908
-            'EEH_Parse_Shortcodes'                         => function () {
909
-                if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
910
-                    return new EEH_Parse_Shortcodes();
911
-                }
912
-                return null;
913
-            },
914
-            'EE_Template_Config'                           => function () {
915
-                return EE_Config::instance()->template_settings;
916
-            },
917
-            'EE_Currency_Config'                           => function () {
918
-                return EE_Config::instance()->currency;
919
-            },
920
-            'EE_Registration_Config'                       => function () {
921
-                return EE_Config::instance()->registration;
922
-            },
923
-            'EE_Core_Config'                               => function () {
924
-                return EE_Config::instance()->core;
925
-            },
926
-            'EventEspresso\core\services\loaders\Loader'   => function () {
927
-                return LoaderFactory::getLoader();
928
-            },
929
-            'EE_Network_Config'                            => function () {
930
-                return EE_Network_Config::instance();
931
-            },
932
-            'EE_Config'                                    => function () {
933
-                return EE_Config::instance();
934
-            },
935
-            'EventEspresso\core\domain\Domain'             => function () {
936
-                return DomainFactory::getEventEspressoCoreDomain();
937
-            },
938
-            'EE_Admin_Config'                              => function () {
939
-                return EE_Config::instance()->admin;
940
-            },
941
-        );
942
-    }
943
-
944
-
945
-    /**
946
-     * can be used for supplying alternate names for classes,
947
-     * or for connecting interface names to instantiable classes
948
-     */
949
-    protected function _register_core_aliases()
950
-    {
951
-        $aliases = array(
952
-            'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
953
-            'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
954
-            'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
955
-            'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
956
-            'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
957
-            'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
958
-            'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
959
-            'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
960
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
961
-            'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
962
-            'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
963
-            'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
964
-            'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
965
-            'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
966
-            'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
967
-            'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
968
-            'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
969
-            'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
970
-            'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
971
-            'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
972
-            'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
973
-            'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
974
-            'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
975
-            'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
976
-            'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
977
-            'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
978
-            'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
979
-            'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
980
-            'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
981
-            'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
982
-            'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
983
-            'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
984
-            'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
985
-            'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
986
-            'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
987
-            'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
988
-            'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
989
-        );
990
-        foreach ($aliases as $alias => $fqn) {
991
-            if (is_array($fqn)) {
992
-                foreach ($fqn as $class => $for_class) {
993
-                    $this->class_cache->addAlias($class, $alias, $for_class);
994
-                }
995
-                continue;
996
-            }
997
-            $this->class_cache->addAlias($fqn, $alias);
998
-        }
999
-        if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
1000
-            $this->class_cache->addAlias(
1001
-                'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
1002
-                'EventEspresso\core\services\notices\NoticeConverterInterface'
1003
-            );
1004
-        }
1005
-    }
1006
-
1007
-
1008
-    /**
1009
-     * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
1010
-     * request Primarily used by unit tests.
1011
-     */
1012
-    public function reset()
1013
-    {
1014
-        $this->_register_core_class_loaders();
1015
-        $this->_register_core_dependencies();
1016
-    }
1017
-
1018
-
1019
-    /**
1020
-     * PLZ NOTE: a better name for this method would be is_alias()
1021
-     * because it returns TRUE if the provided fully qualified name IS an alias
1022
-     * WHY?
1023
-     * Because if a class is type hinting for a concretion,
1024
-     * then why would we need to find another class to supply it?
1025
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
1026
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
1027
-     * Don't go looking for some substitute.
1028
-     * Whereas if a class is type hinting for an interface...
1029
-     * then we need to find an actual class to use.
1030
-     * So the interface IS the alias for some other FQN,
1031
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
1032
-     * represents some other class.
1033
-     *
1034
-     * @deprecated 4.9.62.p
1035
-     * @param string $fqn
1036
-     * @param string $for_class
1037
-     * @return bool
1038
-     */
1039
-    public function has_alias($fqn = '', $for_class = '')
1040
-    {
1041
-        return $this->isAlias($fqn, $for_class);
1042
-    }
1043
-
1044
-
1045
-    /**
1046
-     * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
1047
-     * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
1048
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
1049
-     *  for example:
1050
-     *      if the following two entries were added to the _aliases array:
1051
-     *          array(
1052
-     *              'interface_alias'           => 'some\namespace\interface'
1053
-     *              'some\namespace\interface'  => 'some\namespace\classname'
1054
-     *          )
1055
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1056
-     *      to load an instance of 'some\namespace\classname'
1057
-     *
1058
-     * @deprecated 4.9.62.p
1059
-     * @param string $alias
1060
-     * @param string $for_class
1061
-     * @return string
1062
-     */
1063
-    public function get_alias($alias = '', $for_class = '')
1064
-    {
1065
-        return $this->getFqnForAlias($alias, $for_class);
1066
-    }
23
+	/**
24
+	 * This means that the requested class dependency is not present in the dependency map
25
+	 */
26
+	const not_registered = 0;
27
+
28
+	/**
29
+	 * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
30
+	 */
31
+	const load_new_object = 1;
32
+
33
+	/**
34
+	 * This instructs class loaders to return a previously instantiated and cached object for the requested class.
35
+	 * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
36
+	 */
37
+	const load_from_cache = 2;
38
+
39
+	/**
40
+	 * When registering a dependency,
41
+	 * this indicates to keep any existing dependencies that already exist,
42
+	 * and simply discard any new dependencies declared in the incoming data
43
+	 */
44
+	const KEEP_EXISTING_DEPENDENCIES = 0;
45
+
46
+	/**
47
+	 * When registering a dependency,
48
+	 * this indicates to overwrite any existing dependencies that already exist using the incoming data
49
+	 */
50
+	const OVERWRITE_DEPENDENCIES = 1;
51
+
52
+
53
+	/**
54
+	 * @type EE_Dependency_Map $_instance
55
+	 */
56
+	protected static $_instance;
57
+
58
+	/**
59
+	 * @var ClassInterfaceCache $class_cache
60
+	 */
61
+	private $class_cache;
62
+
63
+	/**
64
+	 * @type RequestInterface $request
65
+	 */
66
+	protected $request;
67
+
68
+	/**
69
+	 * @type LegacyRequestInterface $legacy_request
70
+	 */
71
+	protected $legacy_request;
72
+
73
+	/**
74
+	 * @type ResponseInterface $response
75
+	 */
76
+	protected $response;
77
+
78
+	/**
79
+	 * @type LoaderInterface $loader
80
+	 */
81
+	protected $loader;
82
+
83
+	/**
84
+	 * @type array $_dependency_map
85
+	 */
86
+	protected $_dependency_map = array();
87
+
88
+	/**
89
+	 * @type array $_class_loaders
90
+	 */
91
+	protected $_class_loaders = array();
92
+
93
+
94
+	/**
95
+	 * EE_Dependency_Map constructor.
96
+	 *
97
+	 * @param ClassInterfaceCache $class_cache
98
+	 */
99
+	protected function __construct(ClassInterfaceCache $class_cache)
100
+	{
101
+		$this->class_cache = $class_cache;
102
+		do_action('EE_Dependency_Map____construct', $this);
103
+	}
104
+
105
+
106
+	/**
107
+	 * @return void
108
+	 */
109
+	public function initialize()
110
+	{
111
+		$this->_register_core_dependencies();
112
+		$this->_register_core_class_loaders();
113
+		$this->_register_core_aliases();
114
+	}
115
+
116
+
117
+	/**
118
+	 * @singleton method used to instantiate class object
119
+	 * @param ClassInterfaceCache|null $class_cache
120
+	 * @return EE_Dependency_Map
121
+	 */
122
+	public static function instance(ClassInterfaceCache $class_cache = null)
123
+	{
124
+		// check if class object is instantiated, and instantiated properly
125
+		if (! self::$_instance instanceof EE_Dependency_Map
126
+			&& $class_cache instanceof ClassInterfaceCache
127
+		) {
128
+			self::$_instance = new EE_Dependency_Map($class_cache);
129
+		}
130
+		return self::$_instance;
131
+	}
132
+
133
+
134
+	/**
135
+	 * @param RequestInterface $request
136
+	 */
137
+	public function setRequest(RequestInterface $request)
138
+	{
139
+		$this->request = $request;
140
+	}
141
+
142
+
143
+	/**
144
+	 * @param LegacyRequestInterface $legacy_request
145
+	 */
146
+	public function setLegacyRequest(LegacyRequestInterface $legacy_request)
147
+	{
148
+		$this->legacy_request = $legacy_request;
149
+	}
150
+
151
+
152
+	/**
153
+	 * @param ResponseInterface $response
154
+	 */
155
+	public function setResponse(ResponseInterface $response)
156
+	{
157
+		$this->response = $response;
158
+	}
159
+
160
+
161
+	/**
162
+	 * @param LoaderInterface $loader
163
+	 */
164
+	public function setLoader(LoaderInterface $loader)
165
+	{
166
+		$this->loader = $loader;
167
+	}
168
+
169
+
170
+	/**
171
+	 * @param string $class
172
+	 * @param array  $dependencies
173
+	 * @param int    $overwrite
174
+	 * @return bool
175
+	 */
176
+	public static function register_dependencies(
177
+		$class,
178
+		array $dependencies,
179
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
180
+	) {
181
+		return self::$_instance->registerDependencies($class, $dependencies, $overwrite);
182
+	}
183
+
184
+
185
+	/**
186
+	 * Assigns an array of class names and corresponding load sources (new or cached)
187
+	 * to the class specified by the first parameter.
188
+	 * IMPORTANT !!!
189
+	 * The order of elements in the incoming $dependencies array MUST match
190
+	 * the order of the constructor parameters for the class in question.
191
+	 * This is especially important when overriding any existing dependencies that are registered.
192
+	 * the third parameter controls whether any duplicate dependencies are overwritten or not.
193
+	 *
194
+	 * @param string $class
195
+	 * @param array  $dependencies
196
+	 * @param int    $overwrite
197
+	 * @return bool
198
+	 */
199
+	public function registerDependencies(
200
+		$class,
201
+		array $dependencies,
202
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
203
+	) {
204
+		$class = trim($class, '\\');
205
+		$registered = false;
206
+		if (empty(self::$_instance->_dependency_map[ $class ])) {
207
+			self::$_instance->_dependency_map[ $class ] = array();
208
+		}
209
+		// we need to make sure that any aliases used when registering a dependency
210
+		// get resolved to the correct class name
211
+		foreach ($dependencies as $dependency => $load_source) {
212
+			$alias = self::$_instance->getFqnForAlias($dependency);
213
+			if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
214
+				|| ! isset(self::$_instance->_dependency_map[ $class ][ $alias ])
215
+			) {
216
+				unset($dependencies[ $dependency ]);
217
+				$dependencies[ $alias ] = $load_source;
218
+				$registered = true;
219
+			}
220
+		}
221
+		// now add our two lists of dependencies together.
222
+		// using Union (+=) favours the arrays in precedence from left to right,
223
+		// so $dependencies is NOT overwritten because it is listed first
224
+		// ie: with A = B + C, entries in B take precedence over duplicate entries in C
225
+		// Union is way faster than array_merge() but should be used with caution...
226
+		// especially with numerically indexed arrays
227
+		$dependencies += self::$_instance->_dependency_map[ $class ];
228
+		// now we need to ensure that the resulting dependencies
229
+		// array only has the entries that are required for the class
230
+		// so first count how many dependencies were originally registered for the class
231
+		$dependency_count = count(self::$_instance->_dependency_map[ $class ]);
232
+		// if that count is non-zero (meaning dependencies were already registered)
233
+		self::$_instance->_dependency_map[ $class ] = $dependency_count
234
+			// then truncate the  final array to match that count
235
+			? array_slice($dependencies, 0, $dependency_count)
236
+			// otherwise just take the incoming array because nothing previously existed
237
+			: $dependencies;
238
+		return $registered;
239
+	}
240
+
241
+
242
+	/**
243
+	 * @param string $class_name
244
+	 * @param string $loader
245
+	 * @return bool
246
+	 * @throws DomainException
247
+	 */
248
+	public static function register_class_loader($class_name, $loader = 'load_core')
249
+	{
250
+		if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
251
+			throw new DomainException(
252
+				esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
253
+			);
254
+		}
255
+		// check that loader is callable or method starts with "load_" and exists in EE_Registry
256
+		if (! is_callable($loader)
257
+			&& (
258
+				strpos($loader, 'load_') !== 0
259
+				|| ! method_exists('EE_Registry', $loader)
260
+			)
261
+		) {
262
+			throw new DomainException(
263
+				sprintf(
264
+					esc_html__(
265
+						'"%1$s" is not a valid loader method on EE_Registry.',
266
+						'event_espresso'
267
+					),
268
+					$loader
269
+				)
270
+			);
271
+		}
272
+		$class_name = self::$_instance->getFqnForAlias($class_name);
273
+		if (! isset(self::$_instance->_class_loaders[ $class_name ])) {
274
+			self::$_instance->_class_loaders[ $class_name ] = $loader;
275
+			return true;
276
+		}
277
+		return false;
278
+	}
279
+
280
+
281
+	/**
282
+	 * @return array
283
+	 */
284
+	public function dependency_map()
285
+	{
286
+		return $this->_dependency_map;
287
+	}
288
+
289
+
290
+	/**
291
+	 * returns TRUE if dependency map contains a listing for the provided class name
292
+	 *
293
+	 * @param string $class_name
294
+	 * @return boolean
295
+	 */
296
+	public function has($class_name = '')
297
+	{
298
+		// all legacy models have the same dependencies
299
+		if (strpos($class_name, 'EEM_') === 0) {
300
+			$class_name = 'LEGACY_MODELS';
301
+		}
302
+		return isset($this->_dependency_map[ $class_name ]) ? true : false;
303
+	}
304
+
305
+
306
+	/**
307
+	 * returns TRUE if dependency map contains a listing for the provided class name AND dependency
308
+	 *
309
+	 * @param string $class_name
310
+	 * @param string $dependency
311
+	 * @return bool
312
+	 */
313
+	public function has_dependency_for_class($class_name = '', $dependency = '')
314
+	{
315
+		// all legacy models have the same dependencies
316
+		if (strpos($class_name, 'EEM_') === 0) {
317
+			$class_name = 'LEGACY_MODELS';
318
+		}
319
+		$dependency = $this->getFqnForAlias($dependency, $class_name);
320
+		return isset($this->_dependency_map[ $class_name ][ $dependency ])
321
+			? true
322
+			: false;
323
+	}
324
+
325
+
326
+	/**
327
+	 * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
328
+	 *
329
+	 * @param string $class_name
330
+	 * @param string $dependency
331
+	 * @return int
332
+	 */
333
+	public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
334
+	{
335
+		// all legacy models have the same dependencies
336
+		if (strpos($class_name, 'EEM_') === 0) {
337
+			$class_name = 'LEGACY_MODELS';
338
+		}
339
+		$dependency = $this->getFqnForAlias($dependency);
340
+		return $this->has_dependency_for_class($class_name, $dependency)
341
+			? $this->_dependency_map[ $class_name ][ $dependency ]
342
+			: EE_Dependency_Map::not_registered;
343
+	}
344
+
345
+
346
+	/**
347
+	 * @param string $class_name
348
+	 * @return string | Closure
349
+	 */
350
+	public function class_loader($class_name)
351
+	{
352
+		// all legacy models use load_model()
353
+		if (strpos($class_name, 'EEM_') === 0) {
354
+			return 'load_model';
355
+		}
356
+		// EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
357
+		// perform strpos() first to avoid loading regex every time we load a class
358
+		if (strpos($class_name, 'EE_CPT_') === 0
359
+			&& preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
360
+		) {
361
+			return 'load_core';
362
+		}
363
+		$class_name = $this->getFqnForAlias($class_name);
364
+		return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
365
+	}
366
+
367
+
368
+	/**
369
+	 * @return array
370
+	 */
371
+	public function class_loaders()
372
+	{
373
+		return $this->_class_loaders;
374
+	}
375
+
376
+
377
+	/**
378
+	 * adds an alias for a classname
379
+	 *
380
+	 * @param string $fqcn      the class name that should be used (concrete class to replace interface)
381
+	 * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
382
+	 * @param string $for_class the class that has the dependency (is type hinting for the interface)
383
+	 */
384
+	public function add_alias($fqcn, $alias, $for_class = '')
385
+	{
386
+		$this->class_cache->addAlias($fqcn, $alias, $for_class);
387
+	}
388
+
389
+
390
+	/**
391
+	 * Returns TRUE if the provided fully qualified name IS an alias
392
+	 * WHY?
393
+	 * Because if a class is type hinting for a concretion,
394
+	 * then why would we need to find another class to supply it?
395
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
396
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
397
+	 * Don't go looking for some substitute.
398
+	 * Whereas if a class is type hinting for an interface...
399
+	 * then we need to find an actual class to use.
400
+	 * So the interface IS the alias for some other FQN,
401
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
402
+	 * represents some other class.
403
+	 *
404
+	 * @param string $fqn
405
+	 * @param string $for_class
406
+	 * @return bool
407
+	 */
408
+	public function isAlias($fqn = '', $for_class = '')
409
+	{
410
+		return $this->class_cache->isAlias($fqn, $for_class);
411
+	}
412
+
413
+
414
+	/**
415
+	 * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
416
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
417
+	 *  for example:
418
+	 *      if the following two entries were added to the _aliases array:
419
+	 *          array(
420
+	 *              'interface_alias'           => 'some\namespace\interface'
421
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
422
+	 *          )
423
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
424
+	 *      to load an instance of 'some\namespace\classname'
425
+	 *
426
+	 * @param string $alias
427
+	 * @param string $for_class
428
+	 * @return string
429
+	 */
430
+	public function getFqnForAlias($alias = '', $for_class = '')
431
+	{
432
+		return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
433
+	}
434
+
435
+
436
+	/**
437
+	 * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
438
+	 * if one exists, or whether a new object should be generated every time the requested class is loaded.
439
+	 * This is done by using the following class constants:
440
+	 *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
441
+	 *        EE_Dependency_Map::load_new_object - generates a new object every time
442
+	 */
443
+	protected function _register_core_dependencies()
444
+	{
445
+		$this->_dependency_map = array(
446
+			'EE_Request_Handler'                                                                                          => array(
447
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
448
+			),
449
+			'EE_System'                                                                                                   => array(
450
+				'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
451
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
452
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
453
+				'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
454
+			),
455
+			'EE_Session'                                                                                                  => array(
456
+				'EventEspresso\core\services\cache\TransientCacheStorage'  => EE_Dependency_Map::load_from_cache,
457
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
458
+				'EventEspresso\core\services\request\Request'              => EE_Dependency_Map::load_from_cache,
459
+				'EE_Encryption'                                            => EE_Dependency_Map::load_from_cache,
460
+			),
461
+			'EE_Cart'                                                                                                     => array(
462
+				'EE_Session' => EE_Dependency_Map::load_from_cache,
463
+			),
464
+			'EE_Front_Controller'                                                                                         => array(
465
+				'EE_Registry'              => EE_Dependency_Map::load_from_cache,
466
+				'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
467
+				'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
468
+			),
469
+			'EE_Messenger_Collection_Loader'                                                                              => array(
470
+				'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
471
+			),
472
+			'EE_Message_Type_Collection_Loader'                                                                           => array(
473
+				'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
474
+			),
475
+			'EE_Message_Resource_Manager'                                                                                 => array(
476
+				'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
477
+				'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
478
+				'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
479
+			),
480
+			'EE_Message_Factory'                                                                                          => array(
481
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
482
+			),
483
+			'EE_messages'                                                                                                 => array(
484
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
485
+			),
486
+			'EE_Messages_Generator'                                                                                       => array(
487
+				'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
488
+				'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
489
+				'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
490
+				'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
491
+			),
492
+			'EE_Messages_Processor'                                                                                       => array(
493
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
494
+			),
495
+			'EE_Messages_Queue'                                                                                           => array(
496
+				'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
497
+			),
498
+			'EE_Messages_Template_Defaults'                                                                               => array(
499
+				'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
500
+				'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
501
+			),
502
+			'EE_Message_To_Generate_From_Request'                                                                         => array(
503
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
504
+				'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
505
+			),
506
+			'EventEspresso\core\services\commands\CommandBus'                                                             => array(
507
+				'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
508
+			),
509
+			'EventEspresso\services\commands\CommandHandler'                                                              => array(
510
+				'EE_Registry'         => EE_Dependency_Map::load_from_cache,
511
+				'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
512
+			),
513
+			'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => array(
514
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
515
+			),
516
+			'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => array(
517
+				'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
518
+				'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
519
+			),
520
+			'EventEspresso\core\services\commands\CommandFactory'                                                         => array(
521
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
522
+			),
523
+			'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => array(
524
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
525
+			),
526
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => array(
527
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
528
+			),
529
+			'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => array(
530
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
531
+			),
532
+			'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => array(
533
+				'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
534
+			),
535
+			'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => array(
536
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
537
+			),
538
+			'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => array(
539
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
540
+			),
541
+			'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => array(
542
+				'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
543
+			),
544
+			'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => array(
545
+				'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
546
+			),
547
+			'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => array(
548
+				'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
549
+			),
550
+			'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => array(
551
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
552
+			),
553
+			'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => array(
554
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
555
+			),
556
+			'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => array(
557
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
558
+			),
559
+			'EventEspresso\core\services\database\TableManager'                                                           => array(
560
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
561
+			),
562
+			'EE_Data_Migration_Class_Base'                                                                                => array(
563
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
564
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
565
+			),
566
+			'EE_DMS_Core_4_1_0'                                                                                           => array(
567
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
568
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
569
+			),
570
+			'EE_DMS_Core_4_2_0'                                                                                           => array(
571
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
572
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
573
+			),
574
+			'EE_DMS_Core_4_3_0'                                                                                           => array(
575
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
576
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
577
+			),
578
+			'EE_DMS_Core_4_4_0'                                                                                           => array(
579
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
580
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
581
+			),
582
+			'EE_DMS_Core_4_5_0'                                                                                           => array(
583
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
584
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
585
+			),
586
+			'EE_DMS_Core_4_6_0'                                                                                           => array(
587
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
588
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
589
+			),
590
+			'EE_DMS_Core_4_7_0'                                                                                           => array(
591
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
592
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
593
+			),
594
+			'EE_DMS_Core_4_8_0'                                                                                           => array(
595
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
596
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
597
+			),
598
+			'EE_DMS_Core_4_9_0'                                                                                           => array(
599
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
600
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
601
+			),
602
+			'EventEspresso\core\services\assets\I18nRegistry'                                                             => array(
603
+				array(),
604
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
605
+			),
606
+			'EventEspresso\core\services\assets\Registry'                                                                 => array(
607
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
608
+				'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
609
+			),
610
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled'                                             => array(
611
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
612
+			),
613
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout'                                              => array(
614
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
615
+			),
616
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees'                                        => array(
617
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
618
+			),
619
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEvents'                                                => array(
620
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
621
+			),
622
+			'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou'                                              => array(
623
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
624
+			),
625
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector'                                        => array(
626
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
627
+			),
628
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage'                                               => array(
629
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
630
+			),
631
+			'EventEspresso\core\services\cache\BasicCacheManager'                                                         => array(
632
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
633
+			),
634
+			'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => array(
635
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
636
+			),
637
+			'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => array(
638
+				'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
639
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
640
+			),
641
+			'EventEspresso\core\domain\values\EmailAddress'                                                               => array(
642
+				null,
643
+				'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
644
+			),
645
+			'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => array(
646
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
647
+			),
648
+			'LEGACY_MODELS'                                                                                               => array(
649
+				null,
650
+				'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
651
+			),
652
+			'EE_Module_Request_Router'                                                                                    => array(
653
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
654
+			),
655
+			'EE_Registration_Processor'                                                                                   => array(
656
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
657
+			),
658
+			'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => array(
659
+				null,
660
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
661
+				'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
662
+			),
663
+			'EventEspresso\core\services\licensing\LicenseService'                                                        => array(
664
+				'EventEspresso\core\domain\services\pue\Stats'  => EE_Dependency_Map::load_from_cache,
665
+				'EventEspresso\core\domain\services\pue\Config' => EE_Dependency_Map::load_from_cache,
666
+			),
667
+			'EE_Admin_Transactions_List_Table'                                                                            => array(
668
+				null,
669
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
670
+			),
671
+			'EventEspresso\core\domain\services\pue\Stats'                                                                => array(
672
+				'EventEspresso\core\domain\services\pue\Config'        => EE_Dependency_Map::load_from_cache,
673
+				'EE_Maintenance_Mode'                                  => EE_Dependency_Map::load_from_cache,
674
+				'EventEspresso\core\domain\services\pue\StatsGatherer' => EE_Dependency_Map::load_from_cache,
675
+			),
676
+			'EventEspresso\core\domain\services\pue\Config'                                                               => array(
677
+				'EE_Network_Config' => EE_Dependency_Map::load_from_cache,
678
+				'EE_Config'         => EE_Dependency_Map::load_from_cache,
679
+			),
680
+			'EventEspresso\core\domain\services\pue\StatsGatherer'                                                        => array(
681
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
682
+				'EEM_Event'          => EE_Dependency_Map::load_from_cache,
683
+				'EEM_Datetime'       => EE_Dependency_Map::load_from_cache,
684
+				'EEM_Ticket'         => EE_Dependency_Map::load_from_cache,
685
+				'EEM_Registration'   => EE_Dependency_Map::load_from_cache,
686
+				'EEM_Transaction'    => EE_Dependency_Map::load_from_cache,
687
+				'EE_Config'          => EE_Dependency_Map::load_from_cache,
688
+			),
689
+			'EventEspresso\core\domain\services\admin\ExitModal'                                                          => array(
690
+				'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
691
+			),
692
+			'EventEspresso\core\domain\services\admin\PluginUpsells'                                                      => array(
693
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
694
+			),
695
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => array(
696
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
697
+				'EE_Session'             => EE_Dependency_Map::load_from_cache,
698
+			),
699
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings'                                => array(
700
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
701
+			),
702
+			'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => array(
703
+				'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
704
+				'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
705
+				'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
706
+				'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
707
+				'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
708
+			),
709
+			'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => array(
710
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
711
+			),
712
+			'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => array(
713
+				'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
714
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
715
+			),
716
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => array(
717
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
718
+			),
719
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => array(
720
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
721
+			),
722
+			'EE_CPT_Strategy'                                                                                             => array(
723
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
724
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
725
+			),
726
+			'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => array(
727
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
728
+			),
729
+			'EventEspresso\core\domain\services\assets\CoreAssetManager'                                                  => array(
730
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
731
+				'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
732
+				'EE_Template_Config'                                 => EE_Dependency_Map::load_from_cache,
733
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
734
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
735
+			),
736
+			'EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy' => array(
737
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
738
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache
739
+			),
740
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendee' => array(
741
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
742
+			),
743
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendeeBillingData' => array(
744
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
745
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache
746
+			),
747
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportCheckins' => array(
748
+				'EEM_Checkin' => EE_Dependency_Map::load_from_cache,
749
+			),
750
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportRegistration' => array(
751
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache,
752
+			),
753
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportTransaction' => array(
754
+				'EEM_Transaction' => EE_Dependency_Map::load_from_cache,
755
+			),
756
+			'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAttendeeData' => array(
757
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
758
+			),
759
+			'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAnswers' => array(
760
+				'EEM_Answer' => EE_Dependency_Map::load_from_cache,
761
+				'EEM_Question' => EE_Dependency_Map::load_from_cache,
762
+			),
763
+			'EventEspresso\core\CPTs\CptQueryModifier' => array(
764
+				null,
765
+				null,
766
+				null,
767
+				'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
768
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
769
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
770
+			),
771
+			'EventEspresso\core\domain\services\admin\privacy\forms\PrivacySettingsFormHandler' => array(
772
+				'EE_Registry' => EE_Dependency_Map::load_from_cache,
773
+				'EE_Config' => EE_Dependency_Map::load_from_cache
774
+			),
775
+			'EventEspresso\core\services\editor\BlockRegistrationManager'                                                 => array(
776
+				'EventEspresso\core\services\assets\BlockAssetManagerCollection' => EE_Dependency_Map::load_from_cache,
777
+				'EventEspresso\core\domain\entities\editor\BlockCollection'      => EE_Dependency_Map::load_from_cache,
778
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => EE_Dependency_Map::load_from_cache,
779
+				'EventEspresso\core\services\request\Request'                    => EE_Dependency_Map::load_from_cache,
780
+			),
781
+			'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => array(
782
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
783
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
784
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
785
+			),
786
+			'EventEspresso\core\domain\entities\editor\blocks\EventAttendees' => array(
787
+				'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => self::load_from_cache,
788
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
789
+				'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees' => self::load_from_cache,
790
+			),
791
+			'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => array(
792
+				'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache,
793
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
794
+				'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache,
795
+			),
796
+			'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => array(
797
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
798
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
799
+			),
800
+			'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => array(
801
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
802
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => EE_Dependency_Map::load_from_cache,
803
+			),
804
+			'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => array(
805
+				'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache
806
+			),
807
+			'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => array(
808
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
809
+			),
810
+			'EventEspresso\core\libraries\rest_api\controllers\model\Read' => array(
811
+				'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache
812
+			),
813
+			'EventEspresso\core\libraries\rest_api\calculations\Datetime' => array(
814
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
815
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
816
+			),
817
+			'EventEspresso\core\libraries\rest_api\calculations\Event' => array(
818
+				'EEM_Event' => EE_Dependency_Map::load_from_cache,
819
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
820
+			),
821
+			'EventEspresso\core\libraries\rest_api\calculations\Registration' => array(
822
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
823
+			),
824
+			'EE_URL_Validation_Strategy' => array(
825
+				null,
826
+				null,
827
+				'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache
828
+			),
829
+		);
830
+	}
831
+
832
+
833
+	/**
834
+	 * Registers how core classes are loaded.
835
+	 * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
836
+	 *        'EE_Request_Handler' => 'load_core'
837
+	 *        'EE_Messages_Queue'  => 'load_lib'
838
+	 *        'EEH_Debug_Tools'    => 'load_helper'
839
+	 * or, if greater control is required, by providing a custom closure. For example:
840
+	 *        'Some_Class' => function () {
841
+	 *            return new Some_Class();
842
+	 *        },
843
+	 * This is required for instantiating dependencies
844
+	 * where an interface has been type hinted in a class constructor. For example:
845
+	 *        'Required_Interface' => function () {
846
+	 *            return new A_Class_That_Implements_Required_Interface();
847
+	 *        },
848
+	 */
849
+	protected function _register_core_class_loaders()
850
+	{
851
+		$this->_class_loaders = array(
852
+			// load_core
853
+			'EE_Dependency_Map'                            => function () {
854
+				return $this;
855
+			},
856
+			'EE_Capabilities'                              => 'load_core',
857
+			'EE_Encryption'                                => 'load_core',
858
+			'EE_Front_Controller'                          => 'load_core',
859
+			'EE_Module_Request_Router'                     => 'load_core',
860
+			'EE_Registry'                                  => 'load_core',
861
+			'EE_Request'                                   => function () {
862
+				return $this->legacy_request;
863
+			},
864
+			'EventEspresso\core\services\request\Request'  => function () {
865
+				return $this->request;
866
+			},
867
+			'EventEspresso\core\services\request\Response' => function () {
868
+				return $this->response;
869
+			},
870
+			'EE_Base'                                      => 'load_core',
871
+			'EE_Request_Handler'                           => 'load_core',
872
+			'EE_Session'                                   => 'load_core',
873
+			'EE_Cron_Tasks'                                => 'load_core',
874
+			'EE_System'                                    => 'load_core',
875
+			'EE_Maintenance_Mode'                          => 'load_core',
876
+			'EE_Register_CPTs'                             => 'load_core',
877
+			'EE_Admin'                                     => 'load_core',
878
+			'EE_CPT_Strategy'                              => 'load_core',
879
+			// load_lib
880
+			'EE_Message_Resource_Manager'                  => 'load_lib',
881
+			'EE_Message_Type_Collection'                   => 'load_lib',
882
+			'EE_Message_Type_Collection_Loader'            => 'load_lib',
883
+			'EE_Messenger_Collection'                      => 'load_lib',
884
+			'EE_Messenger_Collection_Loader'               => 'load_lib',
885
+			'EE_Messages_Processor'                        => 'load_lib',
886
+			'EE_Message_Repository'                        => 'load_lib',
887
+			'EE_Messages_Queue'                            => 'load_lib',
888
+			'EE_Messages_Data_Handler_Collection'          => 'load_lib',
889
+			'EE_Message_Template_Group_Collection'         => 'load_lib',
890
+			'EE_Payment_Method_Manager'                    => 'load_lib',
891
+			'EE_Messages_Generator'                        => function () {
892
+				return EE_Registry::instance()->load_lib(
893
+					'Messages_Generator',
894
+					array(),
895
+					false,
896
+					false
897
+				);
898
+			},
899
+			'EE_Messages_Template_Defaults'                => function ($arguments = array()) {
900
+				return EE_Registry::instance()->load_lib(
901
+					'Messages_Template_Defaults',
902
+					$arguments,
903
+					false,
904
+					false
905
+				);
906
+			},
907
+			// load_helper
908
+			'EEH_Parse_Shortcodes'                         => function () {
909
+				if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
910
+					return new EEH_Parse_Shortcodes();
911
+				}
912
+				return null;
913
+			},
914
+			'EE_Template_Config'                           => function () {
915
+				return EE_Config::instance()->template_settings;
916
+			},
917
+			'EE_Currency_Config'                           => function () {
918
+				return EE_Config::instance()->currency;
919
+			},
920
+			'EE_Registration_Config'                       => function () {
921
+				return EE_Config::instance()->registration;
922
+			},
923
+			'EE_Core_Config'                               => function () {
924
+				return EE_Config::instance()->core;
925
+			},
926
+			'EventEspresso\core\services\loaders\Loader'   => function () {
927
+				return LoaderFactory::getLoader();
928
+			},
929
+			'EE_Network_Config'                            => function () {
930
+				return EE_Network_Config::instance();
931
+			},
932
+			'EE_Config'                                    => function () {
933
+				return EE_Config::instance();
934
+			},
935
+			'EventEspresso\core\domain\Domain'             => function () {
936
+				return DomainFactory::getEventEspressoCoreDomain();
937
+			},
938
+			'EE_Admin_Config'                              => function () {
939
+				return EE_Config::instance()->admin;
940
+			},
941
+		);
942
+	}
943
+
944
+
945
+	/**
946
+	 * can be used for supplying alternate names for classes,
947
+	 * or for connecting interface names to instantiable classes
948
+	 */
949
+	protected function _register_core_aliases()
950
+	{
951
+		$aliases = array(
952
+			'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
953
+			'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
954
+			'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
955
+			'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
956
+			'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
957
+			'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
958
+			'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
959
+			'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
960
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
961
+			'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
962
+			'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
963
+			'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
964
+			'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
965
+			'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
966
+			'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
967
+			'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
968
+			'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
969
+			'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
970
+			'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
971
+			'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
972
+			'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
973
+			'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
974
+			'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
975
+			'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
976
+			'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
977
+			'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
978
+			'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
979
+			'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
980
+			'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
981
+			'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
982
+			'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
983
+			'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
984
+			'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
985
+			'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
986
+			'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
987
+			'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
988
+			'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
989
+		);
990
+		foreach ($aliases as $alias => $fqn) {
991
+			if (is_array($fqn)) {
992
+				foreach ($fqn as $class => $for_class) {
993
+					$this->class_cache->addAlias($class, $alias, $for_class);
994
+				}
995
+				continue;
996
+			}
997
+			$this->class_cache->addAlias($fqn, $alias);
998
+		}
999
+		if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
1000
+			$this->class_cache->addAlias(
1001
+				'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
1002
+				'EventEspresso\core\services\notices\NoticeConverterInterface'
1003
+			);
1004
+		}
1005
+	}
1006
+
1007
+
1008
+	/**
1009
+	 * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
1010
+	 * request Primarily used by unit tests.
1011
+	 */
1012
+	public function reset()
1013
+	{
1014
+		$this->_register_core_class_loaders();
1015
+		$this->_register_core_dependencies();
1016
+	}
1017
+
1018
+
1019
+	/**
1020
+	 * PLZ NOTE: a better name for this method would be is_alias()
1021
+	 * because it returns TRUE if the provided fully qualified name IS an alias
1022
+	 * WHY?
1023
+	 * Because if a class is type hinting for a concretion,
1024
+	 * then why would we need to find another class to supply it?
1025
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
1026
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
1027
+	 * Don't go looking for some substitute.
1028
+	 * Whereas if a class is type hinting for an interface...
1029
+	 * then we need to find an actual class to use.
1030
+	 * So the interface IS the alias for some other FQN,
1031
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
1032
+	 * represents some other class.
1033
+	 *
1034
+	 * @deprecated 4.9.62.p
1035
+	 * @param string $fqn
1036
+	 * @param string $for_class
1037
+	 * @return bool
1038
+	 */
1039
+	public function has_alias($fqn = '', $for_class = '')
1040
+	{
1041
+		return $this->isAlias($fqn, $for_class);
1042
+	}
1043
+
1044
+
1045
+	/**
1046
+	 * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
1047
+	 * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
1048
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
1049
+	 *  for example:
1050
+	 *      if the following two entries were added to the _aliases array:
1051
+	 *          array(
1052
+	 *              'interface_alias'           => 'some\namespace\interface'
1053
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
1054
+	 *          )
1055
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1056
+	 *      to load an instance of 'some\namespace\classname'
1057
+	 *
1058
+	 * @deprecated 4.9.62.p
1059
+	 * @param string $alias
1060
+	 * @param string $for_class
1061
+	 * @return string
1062
+	 */
1063
+	public function get_alias($alias = '', $for_class = '')
1064
+	{
1065
+		return $this->getFqnForAlias($alias, $for_class);
1066
+	}
1067 1067
 }
Please login to merge, or discard this patch.