Completed
Branch EDTR/master (da70c7)
by
unknown
33:49 queued 25:01
created
core/domain/services/admin/events/editor/AdvancedEditorData.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use EEM_Price;
11 11
 use EEM_Price_Type;
12 12
 use EEM_Ticket;
13
-use EEM_Venue;
14 13
 use EventEspresso\core\domain\services\assets\EspressoEditorAssetManager;
15 14
 use EventEspresso\core\exceptions\InvalidDataTypeException;
16 15
 use EventEspresso\core\exceptions\InvalidInterfaceException;
Please login to merge, or discard this patch.
Indentation   +395 added lines, -395 removed lines patch added patch discarded remove patch
@@ -33,163 +33,163 @@  discard block
 block discarded – undo
33 33
 class AdvancedEditorData
34 34
 {
35 35
 
36
-    /**
37
-     * @var string $namespace The graphql namespace/prefix.
38
-     */
39
-    protected $namespace = 'Espresso';
40
-
41
-    /**
42
-     * @var EE_Event
43
-     */
44
-    protected $event;
45
-
46
-    /**
47
-     * @var EE_Admin_Config
48
-     */
49
-    protected $admin_config;
50
-
51
-
52
-    /**
53
-     * AdvancedEditorAdminForm constructor.
54
-     *
55
-     * @param EE_Event        $event
56
-     * @param EE_Admin_Config $admin_config
57
-     */
58
-    public function __construct(
59
-        EE_Event $event,
60
-        EE_Admin_Config $admin_config
61
-    ) {
62
-        $this->event = $event;
63
-        $this->admin_config = $admin_config;
64
-        add_action('admin_enqueue_scripts', [$this, 'loadScriptsStyles']);
65
-    }
66
-
67
-
68
-    /**
69
-     * @throws EE_Error
70
-     * @throws InvalidArgumentException
71
-     * @throws InvalidDataTypeException
72
-     * @throws InvalidInterfaceException
73
-     * @throws ModelConfigurationException
74
-     * @throws ReflectionException
75
-     * @throws UnexpectedEntityException
76
-     * @throws DomainException
77
-     * @since $VID:$
78
-     */
79
-    public function loadScriptsStyles()
80
-    {
81
-        if ($this->admin_config->useAdvancedEditor()) {
82
-            $eventId = $this->event instanceof EE_Event ? $this->event->ID() : 0;
83
-            if (! $eventId) {
84
-                global $post;
85
-                $eventId = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : 0;
86
-                $eventId = $eventId === 0 && $post instanceof WP_Post && $post->post_type === 'espresso_events'
87
-                    ? $post->ID
88
-                    : $eventId;
89
-            }
90
-            if ($eventId) {
91
-                $data = $this->getEditorData($eventId);
92
-                $data = wp_json_encode($data);
93
-                add_action(
94
-                    'admin_footer',
95
-                    static function () use ($data) {
96
-                        wp_add_inline_script(
97
-                            EspressoEditorAssetManager::JS_HANDLE_EDITOR,
98
-                            "
36
+	/**
37
+	 * @var string $namespace The graphql namespace/prefix.
38
+	 */
39
+	protected $namespace = 'Espresso';
40
+
41
+	/**
42
+	 * @var EE_Event
43
+	 */
44
+	protected $event;
45
+
46
+	/**
47
+	 * @var EE_Admin_Config
48
+	 */
49
+	protected $admin_config;
50
+
51
+
52
+	/**
53
+	 * AdvancedEditorAdminForm constructor.
54
+	 *
55
+	 * @param EE_Event        $event
56
+	 * @param EE_Admin_Config $admin_config
57
+	 */
58
+	public function __construct(
59
+		EE_Event $event,
60
+		EE_Admin_Config $admin_config
61
+	) {
62
+		$this->event = $event;
63
+		$this->admin_config = $admin_config;
64
+		add_action('admin_enqueue_scripts', [$this, 'loadScriptsStyles']);
65
+	}
66
+
67
+
68
+	/**
69
+	 * @throws EE_Error
70
+	 * @throws InvalidArgumentException
71
+	 * @throws InvalidDataTypeException
72
+	 * @throws InvalidInterfaceException
73
+	 * @throws ModelConfigurationException
74
+	 * @throws ReflectionException
75
+	 * @throws UnexpectedEntityException
76
+	 * @throws DomainException
77
+	 * @since $VID:$
78
+	 */
79
+	public function loadScriptsStyles()
80
+	{
81
+		if ($this->admin_config->useAdvancedEditor()) {
82
+			$eventId = $this->event instanceof EE_Event ? $this->event->ID() : 0;
83
+			if (! $eventId) {
84
+				global $post;
85
+				$eventId = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : 0;
86
+				$eventId = $eventId === 0 && $post instanceof WP_Post && $post->post_type === 'espresso_events'
87
+					? $post->ID
88
+					: $eventId;
89
+			}
90
+			if ($eventId) {
91
+				$data = $this->getEditorData($eventId);
92
+				$data = wp_json_encode($data);
93
+				add_action(
94
+					'admin_footer',
95
+					static function () use ($data) {
96
+						wp_add_inline_script(
97
+							EspressoEditorAssetManager::JS_HANDLE_EDITOR,
98
+							"
99 99
 var eeEditorData={$data};
100 100
 ",
101
-                            'before'
102
-                        );
103
-                    }
104
-                );
105
-                add_action(
106
-                    'admin_footer',
107
-                    static function () use ($data) {
108
-                        wp_add_inline_script(
109
-                            EspressoEditorAssetManager::JS_HANDLE_EDITOR_PROTOTYPE,
110
-                            "
101
+							'before'
102
+						);
103
+					}
104
+				);
105
+				add_action(
106
+					'admin_footer',
107
+					static function () use ($data) {
108
+						wp_add_inline_script(
109
+							EspressoEditorAssetManager::JS_HANDLE_EDITOR_PROTOTYPE,
110
+							"
111 111
 var eeEditorData={$data};
112 112
 ",
113
-                            'before'
114
-                        );
115
-                    }
116
-                );
117
-            }
118
-        }
119
-    }
120
-
121
-
122
-    /**
123
-     * @param int $eventId
124
-     * @return array
125
-     * @throws EE_Error
126
-     * @throws InvalidDataTypeException
127
-     * @throws InvalidInterfaceException
128
-     * @throws ModelConfigurationException
129
-     * @throws UnexpectedEntityException
130
-     * @throws InvalidArgumentException
131
-     * @throws ReflectionException
132
-     * @throws DomainException
133
-     * @since $VID:$
134
-     */
135
-    protected function getEditorData($eventId)
136
-    {
137
-        $event = $this->getEventGraphQLData($eventId);
138
-        $event['dbId'] = $eventId;
139
-
140
-        $graphqlEndpoint = class_exists('WPGraphQL') ? trailingslashit(site_url()) . Router::$route : '';
141
-        $graphqlEndpoint = esc_url($graphqlEndpoint);
142
-
143
-        $currentUser = $this->getGraphQLCurrentUser();
144
-
145
-        $generalSettings = $this->getGraphQLGeneralSettings();
146
-
147
-        return compact('event', 'graphqlEndpoint', 'currentUser', 'generalSettings');
148
-    }
149
-
150
-
151
-    /**
152
-     * @param int $eventId
153
-     * @return array
154
-     * @since $VID:$
155
-     */
156
-    protected function getEventGraphQLData($eventId)
157
-    {
158
-        $datetimes = $this->getGraphQLDatetimes($eventId);
159
-
160
-        if (! empty($datetimes['nodes'])) {
161
-            $datetimeIn = wp_list_pluck($datetimes['nodes'], 'id');
162
-
163
-            if (! empty($datetimeIn)) {
164
-                $tickets = $this->getGraphQLTickets($datetimeIn);
165
-            }
166
-        }
167
-
168
-        if (! empty($tickets['nodes'])) {
169
-            $ticketIn = wp_list_pluck($tickets['nodes'], 'id');
170
-
171
-            if (! empty($ticketIn)) {
172
-                $prices = $this->getGraphQLPrices($ticketIn);
173
-            }
174
-        }
175
-
176
-        $priceTypes = $this->getGraphQLPriceTypes();
177
-
178
-        $relations = $this->getRelationalData($eventId);
179
-
180
-        return compact('datetimes', 'tickets', 'prices', 'priceTypes', 'relations');
181
-    }
182
-
183
-
184
-    /**
185
-     * @param int $eventId
186
-     * @return array|null
187
-     * @since $VID:$
188
-     */
189
-    protected function getGraphQLDatetimes($eventId)
190
-    {
191
-        $field_key = lcfirst($this->namespace) . 'Datetimes';
192
-        $query = <<<QUERY
113
+							'before'
114
+						);
115
+					}
116
+				);
117
+			}
118
+		}
119
+	}
120
+
121
+
122
+	/**
123
+	 * @param int $eventId
124
+	 * @return array
125
+	 * @throws EE_Error
126
+	 * @throws InvalidDataTypeException
127
+	 * @throws InvalidInterfaceException
128
+	 * @throws ModelConfigurationException
129
+	 * @throws UnexpectedEntityException
130
+	 * @throws InvalidArgumentException
131
+	 * @throws ReflectionException
132
+	 * @throws DomainException
133
+	 * @since $VID:$
134
+	 */
135
+	protected function getEditorData($eventId)
136
+	{
137
+		$event = $this->getEventGraphQLData($eventId);
138
+		$event['dbId'] = $eventId;
139
+
140
+		$graphqlEndpoint = class_exists('WPGraphQL') ? trailingslashit(site_url()) . Router::$route : '';
141
+		$graphqlEndpoint = esc_url($graphqlEndpoint);
142
+
143
+		$currentUser = $this->getGraphQLCurrentUser();
144
+
145
+		$generalSettings = $this->getGraphQLGeneralSettings();
146
+
147
+		return compact('event', 'graphqlEndpoint', 'currentUser', 'generalSettings');
148
+	}
149
+
150
+
151
+	/**
152
+	 * @param int $eventId
153
+	 * @return array
154
+	 * @since $VID:$
155
+	 */
156
+	protected function getEventGraphQLData($eventId)
157
+	{
158
+		$datetimes = $this->getGraphQLDatetimes($eventId);
159
+
160
+		if (! empty($datetimes['nodes'])) {
161
+			$datetimeIn = wp_list_pluck($datetimes['nodes'], 'id');
162
+
163
+			if (! empty($datetimeIn)) {
164
+				$tickets = $this->getGraphQLTickets($datetimeIn);
165
+			}
166
+		}
167
+
168
+		if (! empty($tickets['nodes'])) {
169
+			$ticketIn = wp_list_pluck($tickets['nodes'], 'id');
170
+
171
+			if (! empty($ticketIn)) {
172
+				$prices = $this->getGraphQLPrices($ticketIn);
173
+			}
174
+		}
175
+
176
+		$priceTypes = $this->getGraphQLPriceTypes();
177
+
178
+		$relations = $this->getRelationalData($eventId);
179
+
180
+		return compact('datetimes', 'tickets', 'prices', 'priceTypes', 'relations');
181
+	}
182
+
183
+
184
+	/**
185
+	 * @param int $eventId
186
+	 * @return array|null
187
+	 * @since $VID:$
188
+	 */
189
+	protected function getGraphQLDatetimes($eventId)
190
+	{
191
+		$field_key = lcfirst($this->namespace) . 'Datetimes';
192
+		$query = <<<QUERY
193 193
         query GET_DATETIMES(\$where: {$this->namespace}RootQueryDatetimesConnectionWhereArgs) {
194 194
             {$field_key}(where: \$where) {
195 195
                 nodes {
@@ -215,31 +215,31 @@  discard block
 block discarded – undo
215 215
             }
216 216
         }
217 217
 QUERY;
218
-            $data = [
219
-                'operation_name' => 'GET_DATETIMES',
220
-                'variables' => [
221
-                    'first' => 50,
222
-                    'where' => [
223
-                        'eventId' => $eventId,
224
-                    ],
225
-                ],
226
-                'query' => $query,
227
-            ];
228
-
229
-            $responseData = $this->makeGraphQLRequest($data);
230
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
231
-    }
232
-
233
-
234
-    /**
235
-     * @param array $datetimeIn
236
-     * @return array|null
237
-     * @since $VID:$
238
-     */
239
-    protected function getGraphQLTickets(array $datetimeIn)
240
-    {
241
-        $field_key = lcfirst($this->namespace) . 'Tickets';
242
-        $query = <<<QUERY
218
+			$data = [
219
+				'operation_name' => 'GET_DATETIMES',
220
+				'variables' => [
221
+					'first' => 50,
222
+					'where' => [
223
+						'eventId' => $eventId,
224
+					],
225
+				],
226
+				'query' => $query,
227
+			];
228
+
229
+			$responseData = $this->makeGraphQLRequest($data);
230
+			return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
231
+	}
232
+
233
+
234
+	/**
235
+	 * @param array $datetimeIn
236
+	 * @return array|null
237
+	 * @since $VID:$
238
+	 */
239
+	protected function getGraphQLTickets(array $datetimeIn)
240
+	{
241
+		$field_key = lcfirst($this->namespace) . 'Tickets';
242
+		$query = <<<QUERY
243 243
         query GET_TICKETS(\$where: {$this->namespace}RootQueryTicketsConnectionWhereArgs) {
244 244
             {$field_key}(where: \$where) {
245 245
                 nodes {
@@ -268,30 +268,30 @@  discard block
 block discarded – undo
268 268
             }
269 269
         }
270 270
 QUERY;
271
-            $data = [
272
-                'operation_name' => 'GET_TICKETS',
273
-                'variables' => [
274
-                    'where' => [
275
-                        'datetimeIn' => $datetimeIn,
276
-                    ],
277
-                ],
278
-                'query' => $query,
279
-            ];
280
-
281
-            $responseData = $this->makeGraphQLRequest($data);
282
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
283
-    }
284
-
285
-
286
-    /**
287
-     * @param array $ticketIn
288
-     * @return array|null
289
-     * @since $VID:$
290
-     */
291
-    protected function getGraphQLPrices(array $ticketIn)
292
-    {
293
-        $field_key = lcfirst($this->namespace) . 'Prices';
294
-        $query = <<<QUERY
271
+			$data = [
272
+				'operation_name' => 'GET_TICKETS',
273
+				'variables' => [
274
+					'where' => [
275
+						'datetimeIn' => $datetimeIn,
276
+					],
277
+				],
278
+				'query' => $query,
279
+			];
280
+
281
+			$responseData = $this->makeGraphQLRequest($data);
282
+			return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
283
+	}
284
+
285
+
286
+	/**
287
+	 * @param array $ticketIn
288
+	 * @return array|null
289
+	 * @since $VID:$
290
+	 */
291
+	protected function getGraphQLPrices(array $ticketIn)
292
+	{
293
+		$field_key = lcfirst($this->namespace) . 'Prices';
294
+		$query = <<<QUERY
295 295
         query GET_PRICES(\$where: {$this->namespace}RootQueryPricesConnectionWhereArgs) {
296 296
             {$field_key}(where: \$where) {
297 297
                 nodes {
@@ -315,29 +315,29 @@  discard block
 block discarded – undo
315 315
             }
316 316
         }
317 317
 QUERY;
318
-            $data = [
319
-                'operation_name' => 'GET_PRICES',
320
-                'variables' => [
321
-                    'where' => [
322
-                        'ticketIn' => $ticketIn,
323
-                    ],
324
-                ],
325
-                'query' => $query,
326
-            ];
327
-
328
-            $responseData = $this->makeGraphQLRequest($data);
329
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
330
-    }
331
-
332
-
333
-    /**
334
-     * @return array|null
335
-     * @since $VID:$
336
-     */
337
-    protected function getGraphQLPriceTypes()
338
-    {
339
-        $field_key = lcfirst($this->namespace) . 'PriceTypes';
340
-        $query = <<<QUERY
318
+			$data = [
319
+				'operation_name' => 'GET_PRICES',
320
+				'variables' => [
321
+					'where' => [
322
+						'ticketIn' => $ticketIn,
323
+					],
324
+				],
325
+				'query' => $query,
326
+			];
327
+
328
+			$responseData = $this->makeGraphQLRequest($data);
329
+			return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
330
+	}
331
+
332
+
333
+	/**
334
+	 * @return array|null
335
+	 * @since $VID:$
336
+	 */
337
+	protected function getGraphQLPriceTypes()
338
+	{
339
+		$field_key = lcfirst($this->namespace) . 'PriceTypes';
340
+		$query = <<<QUERY
341 341
         query GET_PRICES {
342 342
             {$field_key} {
343 343
                 nodes {
@@ -357,24 +357,24 @@  discard block
 block discarded – undo
357 357
             }
358 358
         }
359 359
 QUERY;
360
-            $data = [
361
-                'operation_name' => 'GET_PRICES',
362
-                'query' => $query,
363
-            ];
364
-
365
-            $responseData = $this->makeGraphQLRequest($data);
366
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
367
-    }
368
-
369
-
370
-    /**
371
-     * @return array|null
372
-     * @since $VID:$
373
-     */
374
-    protected function getGraphQLCurrentUser()
375
-    {
376
-        $field_key = 'viewer';
377
-        $query = <<<QUERY
360
+			$data = [
361
+				'operation_name' => 'GET_PRICES',
362
+				'query' => $query,
363
+			];
364
+
365
+			$responseData = $this->makeGraphQLRequest($data);
366
+			return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
367
+	}
368
+
369
+
370
+	/**
371
+	 * @return array|null
372
+	 * @since $VID:$
373
+	 */
374
+	protected function getGraphQLCurrentUser()
375
+	{
376
+		$field_key = 'viewer';
377
+		$query = <<<QUERY
378 378
         query GET_CURRENT_USER {
379 379
             {$field_key} {
380 380
                 description
@@ -392,24 +392,24 @@  discard block
 block discarded – undo
392 392
             }
393 393
         }
394 394
 QUERY;
395
-            $data = [
396
-                'operation_name' => 'GET_CURRENT_USER',
397
-                'query' => $query,
398
-            ];
399
-
400
-            $responseData = $this->makeGraphQLRequest($data);
401
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
402
-    }
403
-
404
-
405
-    /**
406
-     * @return array|null
407
-     * @since $VID:$
408
-     */
409
-    protected function getGraphQLGeneralSettings()
410
-    {
411
-        $field_key = 'generalSettings';
412
-        $query = <<<QUERY
395
+			$data = [
396
+				'operation_name' => 'GET_CURRENT_USER',
397
+				'query' => $query,
398
+			];
399
+
400
+			$responseData = $this->makeGraphQLRequest($data);
401
+			return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
402
+	}
403
+
404
+
405
+	/**
406
+	 * @return array|null
407
+	 * @since $VID:$
408
+	 */
409
+	protected function getGraphQLGeneralSettings()
410
+	{
411
+		$field_key = 'generalSettings';
412
+		$query = <<<QUERY
413 413
         query GET_GENERAL_SETTINGS {
414 414
             {$field_key} {
415 415
                 dateFormat
@@ -419,138 +419,138 @@  discard block
 block discarded – undo
419 419
             }
420 420
         }
421 421
 QUERY;
422
-            $data = [
423
-                'operation_name' => 'GET_CURRENT_USER',
424
-                'query' => $query,
425
-            ];
426
-
427
-            $responseData = $this->makeGraphQLRequest($data);
428
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
429
-    }
430
-
431
-
432
-    /**
433
-     * @param array $data
434
-     * @return array
435
-     * @since $VID:$
436
-     */
437
-    protected function makeGraphQLRequest($data)
438
-    {
439
-        try {
440
-            $response = graphql($data);
441
-            if (!empty($response['data'])) {
442
-                return $response['data'];
443
-            }
444
-            return null;
445
-        } catch (\Exception $e) {
446
-            // do something with the errors thrown
447
-            return null;
448
-        }
449
-    }
450
-
451
-
452
-    /**
453
-     * @param mixed       $source  The source that's passed down the GraphQL queries
454
-     * @param array       $args    The inputArgs on the field
455
-     * @param AppContext  $context The AppContext passed down the GraphQL tree
456
-     * @param ResolveInfo $info    The ResolveInfo passed down the GraphQL tree
457
-     * @return string
458
-     * @throws EE_Error
459
-     * @throws Exception
460
-     * @throws InvalidArgumentException
461
-     * @throws InvalidDataTypeException
462
-     * @throws InvalidInterfaceException
463
-     * @throws ReflectionException
464
-     * @throws UserError
465
-     * @throws UnexpectedEntityException
466
-     * @since $VID:$
467
-     */
468
-    public static function getRelationalData($eventId)
469
-    {
470
-
471
-        $data = [
472
-            'datetimes'  => [],
473
-            'tickets'    => [],
474
-            'prices'     => [],
475
-        ];
476
-
477
-        $eem_datetime   = EEM_Datetime::instance();
478
-        $eem_ticket     = EEM_Ticket::instance();
479
-        $eem_price      = EEM_Price::instance();
480
-        $eem_price_type = EEM_Price_Type::instance();
481
-
482
-        // PROCESS DATETIMES
483
-        $related_models = [
484
-            'tickets' => $eem_ticket,
485
-        ];
486
-        // Get the IDs of event datetimes.
487
-        $datetimeIds = $eem_datetime->get_col([['EVT_ID' => $eventId]]);
488
-        foreach ($datetimeIds as $datetimeId) {
489
-            $GID = self::convertToGlobalId($eem_datetime->item_name(), $datetimeId);
490
-            foreach ($related_models as $key => $model) {
491
-                // Get the IDs of related entities for the datetime ID.
492
-                $Ids = $model->get_col([['Datetime.DTT_ID' => $datetimeId]]);
493
-                if (! empty($Ids)) {
494
-                    $data['datetimes'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
495
-                }
496
-            }
497
-        }
498
-
499
-        // PROCESS TICKETS
500
-        $related_models = [
501
-            'datetimes' => $eem_datetime,
502
-            'prices'    => $eem_price,
503
-        ];
504
-        // Get the IDs of all datetime tickets.
505
-        $ticketIds = $eem_ticket->get_col([['Datetime.DTT_ID' => ['in', $datetimeIds]]]);
506
-        foreach ($ticketIds as $ticketId) {
507
-            $GID = self::convertToGlobalId($eem_ticket->item_name(), $ticketId);
508
-
509
-            foreach ($related_models as $key => $model) {
510
-                // Get the IDs of related entities for the ticket ID.
511
-                $Ids = $model->get_col([['Ticket.TKT_ID' => $ticketId]]);
512
-                if (! empty($Ids)) {
513
-                    $data['tickets'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
514
-                }
515
-            }
516
-        }
517
-
518
-        // PROCESS PRICES
519
-        $related_models = [
520
-            'tickets'    => $eem_ticket,
521
-            'priceTypes' => $eem_price_type,
522
-        ];
523
-        // Get the IDs of all ticket prices.
524
-        $priceIds = $eem_price->get_col([['Ticket.TKT_ID' => ['in', $ticketIds]]]);
525
-        foreach ($priceIds as $priceId) {
526
-            $GID = self::convertToGlobalId($eem_price->item_name(), $priceId);
527
-
528
-            foreach ($related_models as $key => $model) {
529
-                // Get the IDs of related entities for the price ID.
530
-                $Ids = $model->get_col([['Price.PRC_ID' => $priceId]]);
531
-                if (! empty($Ids)) {
532
-                    $data['prices'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
533
-                }
534
-            }
535
-        }
536
-
537
-        return $data;
538
-    }
539
-
540
-    /**
541
-     * Convert the DB ID into GID
542
-     *
543
-     * @param string    $type
544
-     * @param int|int[] $ID
545
-     * @return mixed
546
-     */
547
-    public static function convertToGlobalId($type, $ID)
548
-    {
549
-        if (is_array($ID)) {
550
-            return array_map(function ($id) use ($type) {
551
-                return self::convertToGlobalId($type, $id);
552
-            }, $ID);
553
-        }
554
-        return Relay::toGlobalId($type, $ID);
555
-    }
422
+			$data = [
423
+				'operation_name' => 'GET_CURRENT_USER',
424
+				'query' => $query,
425
+			];
426
+
427
+			$responseData = $this->makeGraphQLRequest($data);
428
+			return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
429
+	}
430
+
431
+
432
+	/**
433
+	 * @param array $data
434
+	 * @return array
435
+	 * @since $VID:$
436
+	 */
437
+	protected function makeGraphQLRequest($data)
438
+	{
439
+		try {
440
+			$response = graphql($data);
441
+			if (!empty($response['data'])) {
442
+				return $response['data'];
443
+			}
444
+			return null;
445
+		} catch (\Exception $e) {
446
+			// do something with the errors thrown
447
+			return null;
448
+		}
449
+	}
450
+
451
+
452
+	/**
453
+	 * @param mixed       $source  The source that's passed down the GraphQL queries
454
+	 * @param array       $args    The inputArgs on the field
455
+	 * @param AppContext  $context The AppContext passed down the GraphQL tree
456
+	 * @param ResolveInfo $info    The ResolveInfo passed down the GraphQL tree
457
+	 * @return string
458
+	 * @throws EE_Error
459
+	 * @throws Exception
460
+	 * @throws InvalidArgumentException
461
+	 * @throws InvalidDataTypeException
462
+	 * @throws InvalidInterfaceException
463
+	 * @throws ReflectionException
464
+	 * @throws UserError
465
+	 * @throws UnexpectedEntityException
466
+	 * @since $VID:$
467
+	 */
468
+	public static function getRelationalData($eventId)
469
+	{
470
+
471
+		$data = [
472
+			'datetimes'  => [],
473
+			'tickets'    => [],
474
+			'prices'     => [],
475
+		];
476
+
477
+		$eem_datetime   = EEM_Datetime::instance();
478
+		$eem_ticket     = EEM_Ticket::instance();
479
+		$eem_price      = EEM_Price::instance();
480
+		$eem_price_type = EEM_Price_Type::instance();
481
+
482
+		// PROCESS DATETIMES
483
+		$related_models = [
484
+			'tickets' => $eem_ticket,
485
+		];
486
+		// Get the IDs of event datetimes.
487
+		$datetimeIds = $eem_datetime->get_col([['EVT_ID' => $eventId]]);
488
+		foreach ($datetimeIds as $datetimeId) {
489
+			$GID = self::convertToGlobalId($eem_datetime->item_name(), $datetimeId);
490
+			foreach ($related_models as $key => $model) {
491
+				// Get the IDs of related entities for the datetime ID.
492
+				$Ids = $model->get_col([['Datetime.DTT_ID' => $datetimeId]]);
493
+				if (! empty($Ids)) {
494
+					$data['datetimes'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
495
+				}
496
+			}
497
+		}
498
+
499
+		// PROCESS TICKETS
500
+		$related_models = [
501
+			'datetimes' => $eem_datetime,
502
+			'prices'    => $eem_price,
503
+		];
504
+		// Get the IDs of all datetime tickets.
505
+		$ticketIds = $eem_ticket->get_col([['Datetime.DTT_ID' => ['in', $datetimeIds]]]);
506
+		foreach ($ticketIds as $ticketId) {
507
+			$GID = self::convertToGlobalId($eem_ticket->item_name(), $ticketId);
508
+
509
+			foreach ($related_models as $key => $model) {
510
+				// Get the IDs of related entities for the ticket ID.
511
+				$Ids = $model->get_col([['Ticket.TKT_ID' => $ticketId]]);
512
+				if (! empty($Ids)) {
513
+					$data['tickets'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
514
+				}
515
+			}
516
+		}
517
+
518
+		// PROCESS PRICES
519
+		$related_models = [
520
+			'tickets'    => $eem_ticket,
521
+			'priceTypes' => $eem_price_type,
522
+		];
523
+		// Get the IDs of all ticket prices.
524
+		$priceIds = $eem_price->get_col([['Ticket.TKT_ID' => ['in', $ticketIds]]]);
525
+		foreach ($priceIds as $priceId) {
526
+			$GID = self::convertToGlobalId($eem_price->item_name(), $priceId);
527
+
528
+			foreach ($related_models as $key => $model) {
529
+				// Get the IDs of related entities for the price ID.
530
+				$Ids = $model->get_col([['Price.PRC_ID' => $priceId]]);
531
+				if (! empty($Ids)) {
532
+					$data['prices'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
533
+				}
534
+			}
535
+		}
536
+
537
+		return $data;
538
+	}
539
+
540
+	/**
541
+	 * Convert the DB ID into GID
542
+	 *
543
+	 * @param string    $type
544
+	 * @param int|int[] $ID
545
+	 * @return mixed
546
+	 */
547
+	public static function convertToGlobalId($type, $ID)
548
+	{
549
+		if (is_array($ID)) {
550
+			return array_map(function ($id) use ($type) {
551
+				return self::convertToGlobalId($type, $id);
552
+			}, $ID);
553
+		}
554
+		return Relay::toGlobalId($type, $ID);
555
+	}
556 556
 }
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     {
81 81
         if ($this->admin_config->useAdvancedEditor()) {
82 82
             $eventId = $this->event instanceof EE_Event ? $this->event->ID() : 0;
83
-            if (! $eventId) {
83
+            if ( ! $eventId) {
84 84
                 global $post;
85 85
                 $eventId = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : 0;
86 86
                 $eventId = $eventId === 0 && $post instanceof WP_Post && $post->post_type === 'espresso_events'
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 $data = wp_json_encode($data);
93 93
                 add_action(
94 94
                     'admin_footer',
95
-                    static function () use ($data) {
95
+                    static function() use ($data) {
96 96
                         wp_add_inline_script(
97 97
                             EspressoEditorAssetManager::JS_HANDLE_EDITOR,
98 98
                             "
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                 );
105 105
                 add_action(
106 106
                     'admin_footer',
107
-                    static function () use ($data) {
107
+                    static function() use ($data) {
108 108
                         wp_add_inline_script(
109 109
                             EspressoEditorAssetManager::JS_HANDLE_EDITOR_PROTOTYPE,
110 110
                             "
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $event = $this->getEventGraphQLData($eventId);
138 138
         $event['dbId'] = $eventId;
139 139
 
140
-        $graphqlEndpoint = class_exists('WPGraphQL') ? trailingslashit(site_url()) . Router::$route : '';
140
+        $graphqlEndpoint = class_exists('WPGraphQL') ? trailingslashit(site_url()).Router::$route : '';
141 141
         $graphqlEndpoint = esc_url($graphqlEndpoint);
142 142
 
143 143
         $currentUser = $this->getGraphQLCurrentUser();
@@ -157,18 +157,18 @@  discard block
 block discarded – undo
157 157
     {
158 158
         $datetimes = $this->getGraphQLDatetimes($eventId);
159 159
 
160
-        if (! empty($datetimes['nodes'])) {
160
+        if ( ! empty($datetimes['nodes'])) {
161 161
             $datetimeIn = wp_list_pluck($datetimes['nodes'], 'id');
162 162
 
163
-            if (! empty($datetimeIn)) {
163
+            if ( ! empty($datetimeIn)) {
164 164
                 $tickets = $this->getGraphQLTickets($datetimeIn);
165 165
             }
166 166
         }
167 167
 
168
-        if (! empty($tickets['nodes'])) {
168
+        if ( ! empty($tickets['nodes'])) {
169 169
             $ticketIn = wp_list_pluck($tickets['nodes'], 'id');
170 170
 
171
-            if (! empty($ticketIn)) {
171
+            if ( ! empty($ticketIn)) {
172 172
                 $prices = $this->getGraphQLPrices($ticketIn);
173 173
             }
174 174
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     protected function getGraphQLDatetimes($eventId)
190 190
     {
191
-        $field_key = lcfirst($this->namespace) . 'Datetimes';
191
+        $field_key = lcfirst($this->namespace).'Datetimes';
192 192
         $query = <<<QUERY
193 193
         query GET_DATETIMES(\$where: {$this->namespace}RootQueryDatetimesConnectionWhereArgs) {
194 194
             {$field_key}(where: \$where) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             ];
228 228
 
229 229
             $responseData = $this->makeGraphQLRequest($data);
230
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
230
+            return ! empty($responseData[$field_key]) ? $responseData[$field_key] : null;
231 231
     }
232 232
 
233 233
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     protected function getGraphQLTickets(array $datetimeIn)
240 240
     {
241
-        $field_key = lcfirst($this->namespace) . 'Tickets';
241
+        $field_key = lcfirst($this->namespace).'Tickets';
242 242
         $query = <<<QUERY
243 243
         query GET_TICKETS(\$where: {$this->namespace}RootQueryTicketsConnectionWhereArgs) {
244 244
             {$field_key}(where: \$where) {
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             ];
280 280
 
281 281
             $responseData = $this->makeGraphQLRequest($data);
282
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
282
+            return ! empty($responseData[$field_key]) ? $responseData[$field_key] : null;
283 283
     }
284 284
 
285 285
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      */
291 291
     protected function getGraphQLPrices(array $ticketIn)
292 292
     {
293
-        $field_key = lcfirst($this->namespace) . 'Prices';
293
+        $field_key = lcfirst($this->namespace).'Prices';
294 294
         $query = <<<QUERY
295 295
         query GET_PRICES(\$where: {$this->namespace}RootQueryPricesConnectionWhereArgs) {
296 296
             {$field_key}(where: \$where) {
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             ];
327 327
 
328 328
             $responseData = $this->makeGraphQLRequest($data);
329
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
329
+            return ! empty($responseData[$field_key]) ? $responseData[$field_key] : null;
330 330
     }
331 331
 
332 332
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      */
337 337
     protected function getGraphQLPriceTypes()
338 338
     {
339
-        $field_key = lcfirst($this->namespace) . 'PriceTypes';
339
+        $field_key = lcfirst($this->namespace).'PriceTypes';
340 340
         $query = <<<QUERY
341 341
         query GET_PRICES {
342 342
             {$field_key} {
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             ];
364 364
 
365 365
             $responseData = $this->makeGraphQLRequest($data);
366
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
366
+            return ! empty($responseData[$field_key]) ? $responseData[$field_key] : null;
367 367
     }
368 368
 
369 369
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             ];
399 399
 
400 400
             $responseData = $this->makeGraphQLRequest($data);
401
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
401
+            return ! empty($responseData[$field_key]) ? $responseData[$field_key] : null;
402 402
     }
403 403
 
404 404
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
             ];
426 426
 
427 427
             $responseData = $this->makeGraphQLRequest($data);
428
-            return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
428
+            return ! empty($responseData[$field_key]) ? $responseData[$field_key] : null;
429 429
     }
430 430
 
431 431
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
     {
439 439
         try {
440 440
             $response = graphql($data);
441
-            if (!empty($response['data'])) {
441
+            if ( ! empty($response['data'])) {
442 442
                 return $response['data'];
443 443
             }
444 444
             return null;
@@ -490,8 +490,8 @@  discard block
 block discarded – undo
490 490
             foreach ($related_models as $key => $model) {
491 491
                 // Get the IDs of related entities for the datetime ID.
492 492
                 $Ids = $model->get_col([['Datetime.DTT_ID' => $datetimeId]]);
493
-                if (! empty($Ids)) {
494
-                    $data['datetimes'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
493
+                if ( ! empty($Ids)) {
494
+                    $data['datetimes'][$GID][$key] = self::convertToGlobalId($model->item_name(), $Ids);
495 495
                 }
496 496
             }
497 497
         }
@@ -509,8 +509,8 @@  discard block
 block discarded – undo
509 509
             foreach ($related_models as $key => $model) {
510 510
                 // Get the IDs of related entities for the ticket ID.
511 511
                 $Ids = $model->get_col([['Ticket.TKT_ID' => $ticketId]]);
512
-                if (! empty($Ids)) {
513
-                    $data['tickets'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
512
+                if ( ! empty($Ids)) {
513
+                    $data['tickets'][$GID][$key] = self::convertToGlobalId($model->item_name(), $Ids);
514 514
                 }
515 515
             }
516 516
         }
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
             foreach ($related_models as $key => $model) {
529 529
                 // Get the IDs of related entities for the price ID.
530 530
                 $Ids = $model->get_col([['Price.PRC_ID' => $priceId]]);
531
-                if (! empty($Ids)) {
532
-                    $data['prices'][ $GID ][ $key ] = self::convertToGlobalId($model->item_name(), $Ids);
531
+                if ( ! empty($Ids)) {
532
+                    $data['prices'][$GID][$key] = self::convertToGlobalId($model->item_name(), $Ids);
533 533
                 }
534 534
             }
535 535
         }
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
     public static function convertToGlobalId($type, $ID)
548 548
     {
549 549
         if (is_array($ID)) {
550
-            return array_map(function ($id) use ($type) {
550
+            return array_map(function($id) use ($type) {
551 551
                 return self::convertToGlobalId($type, $id);
552 552
             }, $ID);
553 553
         }
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 1 patch
Indentation   +1417 added lines, -1417 removed lines patch added patch discarded remove patch
@@ -18,1421 +18,1421 @@
 block discarded – undo
18 18
 class Extend_Events_Admin_Page extends Events_Admin_Page
19 19
 {
20 20
 
21
-    /**
22
-     * @var AdvancedEditorAdminFormSection
23
-     */
24
-    protected $advanced_editor_admin_form;
25
-
26
-    /**
27
-     * @var AdvancedEditorData
28
-     */
29
-    protected $advanced_editor_data;
30
-
31
-
32
-    /**
33
-     * Extend_Events_Admin_Page constructor.
34
-     *
35
-     * @param bool $routing
36
-     * @throws EE_Error
37
-     * @throws InvalidArgumentException
38
-     * @throws InvalidDataTypeException
39
-     * @throws InvalidInterfaceException
40
-     * @throws ReflectionException
41
-     */
42
-    public function __construct($routing = true)
43
-    {
44
-        if (! defined('EVENTS_CAF_TEMPLATE_PATH')) {
45
-            define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/');
46
-            define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/');
47
-            define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/');
48
-        }
49
-        parent::__construct($routing);
50
-    }
51
-
52
-
53
-    /**
54
-     * Sets routes.
55
-     *
56
-     * @throws EE_Error
57
-     * @throws InvalidArgumentException
58
-     * @throws InvalidDataTypeException
59
-     * @throws InvalidInterfaceException
60
-     * @throws Exception
61
-     */
62
-    protected function _extend_page_config()
63
-    {
64
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events';
65
-        // is there a evt_id in the request?
66
-        $evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
67
-            ? $this->_req_data['EVT_ID']
68
-            : 0;
69
-        $evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
70
-        // tkt_id?
71
-        $tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID'])
72
-            ? $this->_req_data['TKT_ID']
73
-            : 0;
74
-        $new_page_routes = array(
75
-            'duplicate_event'          => array(
76
-                'func'       => '_duplicate_event',
77
-                'capability' => 'ee_edit_event',
78
-                'obj_id'     => $evt_id,
79
-                'noheader'   => true,
80
-            ),
81
-            'ticket_list_table'        => array(
82
-                'func'       => '_tickets_overview_list_table',
83
-                'capability' => 'ee_read_default_tickets',
84
-            ),
85
-            'trash_ticket'             => array(
86
-                'func'       => '_trash_or_restore_ticket',
87
-                'capability' => 'ee_delete_default_ticket',
88
-                'obj_id'     => $tkt_id,
89
-                'noheader'   => true,
90
-                'args'       => array('trash' => true),
91
-            ),
92
-            'trash_tickets'            => array(
93
-                'func'       => '_trash_or_restore_ticket',
94
-                'capability' => 'ee_delete_default_tickets',
95
-                'noheader'   => true,
96
-                'args'       => array('trash' => true),
97
-            ),
98
-            'restore_ticket'           => array(
99
-                'func'       => '_trash_or_restore_ticket',
100
-                'capability' => 'ee_delete_default_ticket',
101
-                'obj_id'     => $tkt_id,
102
-                'noheader'   => true,
103
-            ),
104
-            'restore_tickets'          => array(
105
-                'func'       => '_trash_or_restore_ticket',
106
-                'capability' => 'ee_delete_default_tickets',
107
-                'noheader'   => true,
108
-            ),
109
-            'delete_ticket'            => array(
110
-                'func'       => '_delete_ticket',
111
-                'capability' => 'ee_delete_default_ticket',
112
-                'obj_id'     => $tkt_id,
113
-                'noheader'   => true,
114
-            ),
115
-            'delete_tickets'           => array(
116
-                'func'       => '_delete_ticket',
117
-                'capability' => 'ee_delete_default_tickets',
118
-                'noheader'   => true,
119
-            ),
120
-            'import_page'              => array(
121
-                'func'       => '_import_page',
122
-                'capability' => 'import',
123
-            ),
124
-            'import'                   => array(
125
-                'func'       => '_import_events',
126
-                'capability' => 'import',
127
-                'noheader'   => true,
128
-            ),
129
-            'import_events'            => array(
130
-                'func'       => '_import_events',
131
-                'capability' => 'import',
132
-                'noheader'   => true,
133
-            ),
134
-            'export_events'            => array(
135
-                'func'       => '_events_export',
136
-                'capability' => 'export',
137
-                'noheader'   => true,
138
-            ),
139
-            'export_categories'        => array(
140
-                'func'       => '_categories_export',
141
-                'capability' => 'export',
142
-                'noheader'   => true,
143
-            ),
144
-            'sample_export_file'       => array(
145
-                'func'       => '_sample_export_file',
146
-                'capability' => 'export',
147
-                'noheader'   => true,
148
-            ),
149
-            'update_template_settings' => array(
150
-                'func'       => '_update_template_settings',
151
-                'capability' => 'manage_options',
152
-                'noheader'   => true,
153
-            ),
154
-        );
155
-        $this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
156
-        // partial route/config override
157
-        $this->_page_config['import_events']['metaboxes'] = $this->_default_espresso_metaboxes;
158
-        $this->_page_config['create_new']['metaboxes'][] = '_premium_event_editor_meta_boxes';
159
-        $this->_page_config['create_new']['qtips'][] = 'EE_Event_Editor_Tips';
160
-        $this->_page_config['edit']['qtips'][] = 'EE_Event_Editor_Tips';
161
-        $this->_page_config['edit']['metaboxes'][] = '_premium_event_editor_meta_boxes';
162
-        $this->_page_config['default']['list_table'] = 'Extend_Events_Admin_List_Table';
163
-        // add tickets tab but only if there are more than one default ticket!
164
-        $tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(
165
-            array(array('TKT_is_default' => 1)),
166
-            'TKT_ID',
167
-            true
168
-        );
169
-        if ($tkt_count > 1) {
170
-            $new_page_config = array(
171
-                'ticket_list_table' => array(
172
-                    'nav'           => array(
173
-                        'label' => esc_html__('Default Tickets', 'event_espresso'),
174
-                        'order' => 60,
175
-                    ),
176
-                    'list_table'    => 'Tickets_List_Table',
177
-                    'require_nonce' => false,
178
-                ),
179
-            );
180
-        }
181
-        // template settings
182
-        $new_page_config['template_settings'] = array(
183
-            'nav'           => array(
184
-                'label' => esc_html__('Templates', 'event_espresso'),
185
-                'order' => 30,
186
-            ),
187
-            'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
188
-            'help_tabs'     => array(
189
-                'general_settings_templates_help_tab' => array(
190
-                    'title'    => esc_html__('Templates', 'event_espresso'),
191
-                    'filename' => 'general_settings_templates',
192
-                ),
193
-            ),
194
-            'help_tour'     => array('Templates_Help_Tour'),
195
-            'require_nonce' => false,
196
-        );
197
-        $this->_page_config = array_merge($this->_page_config, $new_page_config);
198
-        // add filters and actions
199
-        // modifying _views
200
-        add_filter(
201
-            'FHEE_event_datetime_metabox_add_additional_date_time_template',
202
-            array($this, 'add_additional_datetime_button'),
203
-            10,
204
-            2
205
-        );
206
-        add_filter(
207
-            'FHEE_event_datetime_metabox_clone_button_template',
208
-            array($this, 'add_datetime_clone_button'),
209
-            10,
210
-            2
211
-        );
212
-        add_filter(
213
-            'FHEE_event_datetime_metabox_timezones_template',
214
-            array($this, 'datetime_timezones_template'),
215
-            10,
216
-            2
217
-        );
218
-        // filters for event list table
219
-        add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array($this, 'list_table_filters'), 10, 2);
220
-        add_filter(
221
-            'FHEE__Events_Admin_List_Table__column_actions__action_links',
222
-            array($this, 'extra_list_table_actions'),
223
-            10,
224
-            2
225
-        );
226
-        // legend item
227
-        add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array($this, 'additional_legend_items'));
228
-        add_action('admin_init', array($this, 'admin_init'));
229
-       // load additional handlers
230
-        $this->handleActionRequest();
231
-    }
232
-
233
-
234
-    private function getRequestAction()
235
-    {
236
-        return isset($this->_req_data['action']) ? sanitize_key($this->_req_data['action']) : null;
237
-    }
238
-
239
-
240
-    /**
241
-     * @throws EE_Error
242
-     * @throws InvalidArgumentException
243
-     * @throws InvalidDataTypeException
244
-     * @throws InvalidInterfaceException
245
-     * @throws Exception
246
-     */
247
-    private function handleActionRequest()
248
-    {
249
-        $action = $this->getRequestAction();
250
-        if ($action) {
251
-            // setup Advanced Editor ???
252
-            if ($action === 'default_event_settings' || $action === 'update_default_event_settings') {
253
-                $this->advanced_editor_admin_form = $this->loader->getShared(
254
-                    'EventEspresso\core\domain\services\admin\events\default_settings\AdvancedEditorAdminFormSection'
255
-                );
256
-            }
257
-            $admin_config = $this->loader->getShared('EE_Admin_Config');
258
-            // load handler for GraphQL requests and AdvancedEditorData
259
-            if (($action === 'edit' || $action === 'create_new')
260
-                && $admin_config instanceof EE_Admin_Config
261
-                && class_exists('WPGraphQL')
262
-                && $admin_config->useAdvancedEditor()
263
-            ) {
264
-                try {
265
-                    /** @var EventEspresso\core\services\graphql\GraphQLManager $graphQL_manager */
266
-                    $graphQL_manager = $this->loader->getShared(
267
-                        'EventEspresso\core\services\graphql\GraphQLManager'
268
-                    );
269
-                    $graphQL_manager->init();
270
-                    $this->advanced_editor_data = $this->loader->getShared(
271
-                        'EventEspresso\core\domain\services\admin\events\editor\AdvancedEditorData',
272
-                        [$this->_cpt_model_obj]
273
-                    );
274
-                } catch (Exception $exception) {
275
-                    new ExceptionStackTraceDisplay($exception);
276
-                }
277
-            }
278
-        }
279
-    }
280
-
281
-
282
-    /**
283
-     * admin_init
284
-     */
285
-    public function admin_init()
286
-    {
287
-        EE_Registry::$i18n_js_strings = array_merge(
288
-            EE_Registry::$i18n_js_strings,
289
-            array(
290
-                'image_confirm'          => esc_html__(
291
-                    'Do you really want to delete this image? Please remember to update your event to complete the removal.',
292
-                    'event_espresso'
293
-                ),
294
-                'event_starts_on'        => esc_html__('Event Starts on', 'event_espresso'),
295
-                'event_ends_on'          => esc_html__('Event Ends on', 'event_espresso'),
296
-                'event_datetime_actions' => esc_html__('Actions', 'event_espresso'),
297
-                'event_clone_dt_msg'     => esc_html__('Clone this Event Date and Time', 'event_espresso'),
298
-                'remove_event_dt_msg'    => esc_html__('Remove this Event Time', 'event_espresso'),
299
-            )
300
-        );
301
-    }
302
-
303
-
304
-    /**
305
-     * Add per page screen options to the default ticket list table view.
306
-     *
307
-     * @throws InvalidArgumentException
308
-     * @throws InvalidDataTypeException
309
-     * @throws InvalidInterfaceException
310
-     */
311
-    protected function _add_screen_options_ticket_list_table()
312
-    {
313
-        $this->_per_page_screen_option();
314
-    }
315
-
316
-
317
-    /**
318
-     * @param string $return
319
-     * @param int    $id
320
-     * @param string $new_title
321
-     * @param string $new_slug
322
-     * @return string
323
-     */
324
-    public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
325
-    {
326
-        $return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug);
327
-        // make sure this is only when editing
328
-        if (! empty($id)) {
329
-            $href = EE_Admin_Page::add_query_args_and_nonce(
330
-                array('action' => 'duplicate_event', 'EVT_ID' => $id),
331
-                $this->_admin_base_url
332
-            );
333
-            $title = esc_attr__('Duplicate Event', 'event_espresso');
334
-            $return .= '<a href="'
335
-                       . $href
336
-                       . '" title="'
337
-                       . $title
338
-                       . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
339
-                       . $title
340
-                       . '</a>';
341
-        }
342
-        return $return;
343
-    }
344
-
345
-
346
-    /**
347
-     * Set the list table views for the default ticket list table view.
348
-     */
349
-    public function _set_list_table_views_ticket_list_table()
350
-    {
351
-        $this->_views = array(
352
-            'all'     => array(
353
-                'slug'        => 'all',
354
-                'label'       => esc_html__('All', 'event_espresso'),
355
-                'count'       => 0,
356
-                'bulk_action' => array(
357
-                    'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'),
358
-                ),
359
-            ),
360
-            'trashed' => array(
361
-                'slug'        => 'trashed',
362
-                'label'       => esc_html__('Trash', 'event_espresso'),
363
-                'count'       => 0,
364
-                'bulk_action' => array(
365
-                    'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'),
366
-                    'delete_tickets'  => esc_html__('Delete Permanently', 'event_espresso'),
367
-                ),
368
-            ),
369
-        );
370
-    }
371
-
372
-
373
-    /**
374
-     * Enqueue scripts and styles for the event editor.
375
-     */
376
-    public function load_scripts_styles_edit()
377
-    {
378
-        wp_register_script(
379
-            'ee-event-editor-heartbeat',
380
-            EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js',
381
-            array('ee_admin_js', 'heartbeat'),
382
-            EVENT_ESPRESSO_VERSION,
383
-            true
384
-        );
385
-        wp_enqueue_script('ee-accounting');
386
-        // styles
387
-        wp_enqueue_style('espresso-ui-theme');
388
-        wp_enqueue_script('event_editor_js');
389
-        wp_enqueue_script('ee-event-editor-heartbeat');
390
-    }
391
-
392
-
393
-    /**
394
-     * Returns template for the additional datetime.
395
-     *
396
-     * @param $template
397
-     * @param $template_args
398
-     * @return mixed
399
-     * @throws DomainException
400
-     */
401
-    public function add_additional_datetime_button($template, $template_args)
402
-    {
403
-        return EEH_Template::display_template(
404
-            EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php',
405
-            $template_args,
406
-            true
407
-        );
408
-    }
409
-
410
-
411
-    /**
412
-     * Returns the template for cloning a datetime.
413
-     *
414
-     * @param $template
415
-     * @param $template_args
416
-     * @return mixed
417
-     * @throws DomainException
418
-     */
419
-    public function add_datetime_clone_button($template, $template_args)
420
-    {
421
-        return EEH_Template::display_template(
422
-            EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php',
423
-            $template_args,
424
-            true
425
-        );
426
-    }
427
-
428
-
429
-    /**
430
-     * Returns the template for datetime timezones.
431
-     *
432
-     * @param $template
433
-     * @param $template_args
434
-     * @return mixed
435
-     * @throws DomainException
436
-     */
437
-    public function datetime_timezones_template($template, $template_args)
438
-    {
439
-        return EEH_Template::display_template(
440
-            EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php',
441
-            $template_args,
442
-            true
443
-        );
444
-    }
445
-
446
-
447
-    /**
448
-     * Sets the views for the default list table view.
449
-     */
450
-    protected function _set_list_table_views_default()
451
-    {
452
-        parent::_set_list_table_views_default();
453
-        $new_views = array(
454
-            'today' => array(
455
-                'slug'        => 'today',
456
-                'label'       => esc_html__('Today', 'event_espresso'),
457
-                'count'       => $this->total_events_today(),
458
-                'bulk_action' => array(
459
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
460
-                ),
461
-            ),
462
-            'month' => array(
463
-                'slug'        => 'month',
464
-                'label'       => esc_html__('This Month', 'event_espresso'),
465
-                'count'       => $this->total_events_this_month(),
466
-                'bulk_action' => array(
467
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
468
-                ),
469
-            ),
470
-        );
471
-        $this->_views = array_merge($this->_views, $new_views);
472
-    }
473
-
474
-
475
-    /**
476
-     * Returns the extra action links for the default list table view.
477
-     *
478
-     * @param array    $action_links
479
-     * @param EE_Event $event
480
-     * @return array
481
-     * @throws EE_Error
482
-     * @throws InvalidArgumentException
483
-     * @throws InvalidDataTypeException
484
-     * @throws InvalidInterfaceException
485
-     * @throws ReflectionException
486
-     */
487
-    public function extra_list_table_actions(array $action_links, EE_Event $event)
488
-    {
489
-        if (EE_Registry::instance()->CAP->current_user_can(
490
-            'ee_read_registrations',
491
-            'espresso_registrations_reports',
492
-            $event->ID()
493
-        )
494
-        ) {
495
-            $reports_query_args = array(
496
-                'action' => 'reports',
497
-                'EVT_ID' => $event->ID(),
498
-            );
499
-            $reports_link = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL);
500
-            $action_links[] = '<a href="'
501
-                              . $reports_link
502
-                              . '" title="'
503
-                              . esc_attr__('View Report', 'event_espresso')
504
-                              . '"><div class="dashicons dashicons-chart-bar"></div></a>'
505
-                              . "\n\t";
506
-        }
507
-        if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
508
-            EE_Registry::instance()->load_helper('MSG_Template');
509
-            $action_links[] = EEH_MSG_Template::get_message_action_link(
510
-                'see_notifications_for',
511
-                null,
512
-                array('EVT_ID' => $event->ID())
513
-            );
514
-        }
515
-        return $action_links;
516
-    }
517
-
518
-
519
-    /**
520
-     * @param $items
521
-     * @return mixed
522
-     */
523
-    public function additional_legend_items($items)
524
-    {
525
-        if (EE_Registry::instance()->CAP->current_user_can(
526
-            'ee_read_registrations',
527
-            'espresso_registrations_reports'
528
-        )
529
-        ) {
530
-            $items['reports'] = array(
531
-                'class' => 'dashicons dashicons-chart-bar',
532
-                'desc'  => esc_html__('Event Reports', 'event_espresso'),
533
-            );
534
-        }
535
-        if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
536
-            $related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
537
-            // $related_for_icon can sometimes be a string so 'css_class' would be an illegal offset
538
-            // (can only use numeric offsets when treating strings as arrays)
539
-            if (is_array($related_for_icon) && isset($related_for_icon['css_class'], $related_for_icon['label'])) {
540
-                $items['view_related_messages'] = array(
541
-                    'class' => $related_for_icon['css_class'],
542
-                    'desc'  => $related_for_icon['label'],
543
-                );
544
-            }
545
-        }
546
-        return $items;
547
-    }
548
-
549
-
550
-    /**
551
-     * This is the callback method for the duplicate event route
552
-     * Method looks for 'EVT_ID' in the request and retrieves that event and its details and duplicates them
553
-     * into a new event.  We add a hook so that any plugins that add extra event details can hook into this
554
-     * action.  Note that the dupe will have **DUPLICATE** as its title and slug.
555
-     * After duplication the redirect is to the new event edit page.
556
-     *
557
-     * @return void
558
-     * @throws EE_Error If EE_Event is not available with given ID
559
-     * @throws InvalidArgumentException
560
-     * @throws InvalidDataTypeException
561
-     * @throws InvalidInterfaceException
562
-     * @throws ReflectionException
563
-     * @access protected
564
-     */
565
-    protected function _duplicate_event()
566
-    {
567
-        // first make sure the ID for the event is in the request.
568
-        //  If it isn't then we need to bail and redirect back to overview list table (cause how did we get here?)
569
-        if (! isset($this->_req_data['EVT_ID'])) {
570
-            EE_Error::add_error(
571
-                esc_html__(
572
-                    'In order to duplicate an event an Event ID is required.  None was given.',
573
-                    'event_espresso'
574
-                ),
575
-                __FILE__,
576
-                __FUNCTION__,
577
-                __LINE__
578
-            );
579
-            $this->_redirect_after_action(false, '', '', array(), true);
580
-            return;
581
-        }
582
-        // k we've got EVT_ID so let's use that to get the event we'll duplicate
583
-        $orig_event = EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']);
584
-        if (! $orig_event instanceof EE_Event) {
585
-            throw new EE_Error(
586
-                sprintf(
587
-                    esc_html__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'),
588
-                    $this->_req_data['EVT_ID']
589
-                )
590
-            );
591
-        }
592
-        // k now let's clone the $orig_event before getting relations
593
-        $new_event = clone $orig_event;
594
-        // original datetimes
595
-        $orig_datetimes = $orig_event->get_many_related('Datetime');
596
-        // other original relations
597
-        $orig_ven = $orig_event->get_many_related('Venue');
598
-        // reset the ID and modify other details to make it clear this is a dupe
599
-        $new_event->set('EVT_ID', 0);
600
-        $new_name = $new_event->name() . ' ' . esc_html__('**DUPLICATE**', 'event_espresso');
601
-        $new_event->set('EVT_name', $new_name);
602
-        $new_event->set(
603
-            'EVT_slug',
604
-            wp_unique_post_slug(
605
-                sanitize_title($orig_event->name()),
606
-                0,
607
-                'publish',
608
-                'espresso_events',
609
-                0
610
-            )
611
-        );
612
-        $new_event->set('status', 'draft');
613
-        // duplicate discussion settings
614
-        $new_event->set('comment_status', $orig_event->get('comment_status'));
615
-        $new_event->set('ping_status', $orig_event->get('ping_status'));
616
-        // save the new event
617
-        $new_event->save();
618
-        // venues
619
-        foreach ($orig_ven as $ven) {
620
-            $new_event->_add_relation_to($ven, 'Venue');
621
-        }
622
-        $new_event->save();
623
-        // now we need to get the question group relations and handle that
624
-        // first primary question groups
625
-        $orig_primary_qgs = $orig_event->get_many_related(
626
-            'Question_Group',
627
-            [['Event_Question_Group.EQG_primary' => true]]
628
-        );
629
-        if (! empty($orig_primary_qgs)) {
630
-            foreach ($orig_primary_qgs as $id => $obj) {
631
-                if ($obj instanceof EE_Question_Group) {
632
-                    $new_event->_add_relation_to($obj, 'Question_Group', ['EQG_primary' => true]);
633
-                }
634
-            }
635
-        }
636
-        // next additional attendee question groups
637
-        $orig_additional_qgs = $orig_event->get_many_related(
638
-            'Question_Group',
639
-            [['Event_Question_Group.EQG_additional' => true]]
640
-        );
641
-        if (! empty($orig_additional_qgs)) {
642
-            foreach ($orig_additional_qgs as $id => $obj) {
643
-                if ($obj instanceof EE_Question_Group) {
644
-                    $new_event->_add_relation_to($obj, 'Question_Group', ['EQG_additional' => true]);
645
-                }
646
-            }
647
-        }
648
-
649
-        $new_event->save();
650
-
651
-        // k now that we have the new event saved we can loop through the datetimes and start adding relations.
652
-        $cloned_tickets = array();
653
-        foreach ($orig_datetimes as $orig_dtt) {
654
-            if (! $orig_dtt instanceof EE_Datetime) {
655
-                continue;
656
-            }
657
-            $new_dtt = clone $orig_dtt;
658
-            $orig_tkts = $orig_dtt->tickets();
659
-            // save new dtt then add to event
660
-            $new_dtt->set('DTT_ID', 0);
661
-            $new_dtt->set('DTT_sold', 0);
662
-            $new_dtt->set_reserved(0);
663
-            $new_dtt->save();
664
-            $new_event->_add_relation_to($new_dtt, 'Datetime');
665
-            $new_event->save();
666
-            // now let's get the ticket relations setup.
667
-            foreach ((array) $orig_tkts as $orig_tkt) {
668
-                // it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
669
-                if (! $orig_tkt instanceof EE_Ticket) {
670
-                    continue;
671
-                }
672
-                // is this ticket archived?  If it is then let's skip
673
-                if ($orig_tkt->get('TKT_deleted')) {
674
-                    continue;
675
-                }
676
-                // does this original ticket already exist in the clone_tickets cache?
677
-                //  If so we'll just use the new ticket from it.
678
-                if (isset($cloned_tickets[ $orig_tkt->ID() ])) {
679
-                    $new_tkt = $cloned_tickets[ $orig_tkt->ID() ];
680
-                } else {
681
-                    $new_tkt = clone $orig_tkt;
682
-                    // get relations on the $orig_tkt that we need to setup.
683
-                    $orig_prices = $orig_tkt->prices();
684
-                    $new_tkt->set('TKT_ID', 0);
685
-                    $new_tkt->set('TKT_sold', 0);
686
-                    $new_tkt->set('TKT_reserved', 0);
687
-                    $new_tkt->save(); // make sure new ticket has ID.
688
-                    // price relations on new ticket need to be setup.
689
-                    foreach ($orig_prices as $orig_price) {
690
-                        $new_price = clone $orig_price;
691
-                        $new_price->set('PRC_ID', 0);
692
-                        $new_price->save();
693
-                        $new_tkt->_add_relation_to($new_price, 'Price');
694
-                        $new_tkt->save();
695
-                    }
696
-
697
-                    do_action(
698
-                        'AHEE__Extend_Events_Admin_Page___duplicate_event__duplicate_ticket__after',
699
-                        $orig_tkt,
700
-                        $new_tkt,
701
-                        $orig_prices,
702
-                        $orig_event,
703
-                        $orig_dtt,
704
-                        $new_dtt
705
-                    );
706
-                }
707
-                // k now we can add the new ticket as a relation to the new datetime
708
-                // and make sure its added to our cached $cloned_tickets array
709
-                // for use with later datetimes that have the same ticket.
710
-                $new_dtt->_add_relation_to($new_tkt, 'Ticket');
711
-                $new_dtt->save();
712
-                $cloned_tickets[ $orig_tkt->ID() ] = $new_tkt;
713
-            }
714
-        }
715
-        // clone taxonomy information
716
-        $taxonomies_to_clone_with = apply_filters(
717
-            'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone',
718
-            array('espresso_event_categories', 'espresso_event_type', 'post_tag')
719
-        );
720
-        // get terms for original event (notice)
721
-        $orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with);
722
-        // loop through terms and add them to new event.
723
-        foreach ($orig_terms as $term) {
724
-            wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true);
725
-        }
726
-
727
-        // duplicate other core WP_Post items for this event.
728
-        // post thumbnail (feature image).
729
-        $feature_image_id = get_post_thumbnail_id($orig_event->ID());
730
-        if ($feature_image_id) {
731
-            update_post_meta($new_event->ID(), '_thumbnail_id', $feature_image_id);
732
-        }
733
-
734
-        // duplicate page_template setting
735
-        $page_template = get_post_meta($orig_event->ID(), '_wp_page_template', true);
736
-        if ($page_template) {
737
-            update_post_meta($new_event->ID(), '_wp_page_template', $page_template);
738
-        }
739
-
740
-        do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event);
741
-        // now let's redirect to the edit page for this duplicated event if we have a new event id.
742
-        if ($new_event->ID()) {
743
-            $redirect_args = array(
744
-                'post'   => $new_event->ID(),
745
-                'action' => 'edit',
746
-            );
747
-            EE_Error::add_success(
748
-                esc_html__(
749
-                    'Event successfully duplicated.  Please review the details below and make any necessary edits',
750
-                    'event_espresso'
751
-                )
752
-            );
753
-        } else {
754
-            $redirect_args = array(
755
-                'action' => 'default',
756
-            );
757
-            EE_Error::add_error(
758
-                esc_html__('Not able to duplicate event.  Something went wrong.', 'event_espresso'),
759
-                __FILE__,
760
-                __FUNCTION__,
761
-                __LINE__
762
-            );
763
-        }
764
-        $this->_redirect_after_action(false, '', '', $redirect_args, true);
765
-    }
766
-
767
-
768
-    /**
769
-     * Generates output for the import page.
770
-     *
771
-     * @throws DomainException
772
-     * @throws EE_Error
773
-     * @throws InvalidArgumentException
774
-     * @throws InvalidDataTypeException
775
-     * @throws InvalidInterfaceException
776
-     */
777
-    protected function _import_page()
778
-    {
779
-        $title = esc_html__('Import', 'event_espresso');
780
-        $intro = esc_html__(
781
-            'If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ',
782
-            'event_espresso'
783
-        );
784
-        $form_url = EVENTS_ADMIN_URL;
785
-        $action = 'import_events';
786
-        $type = 'csv';
787
-        $this->_template_args['form'] = EE_Import::instance()->upload_form(
788
-            $title,
789
-            $intro,
790
-            $form_url,
791
-            $action,
792
-            $type
793
-        );
794
-        $this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(
795
-            array('action' => 'sample_export_file'),
796
-            $this->_admin_base_url
797
-        );
798
-        $content = EEH_Template::display_template(
799
-            EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',
800
-            $this->_template_args,
801
-            true
802
-        );
803
-        $this->_template_args['admin_page_content'] = $content;
804
-        $this->display_admin_page_with_sidebar();
805
-    }
806
-
807
-
808
-    /**
809
-     * _import_events
810
-     * This handles displaying the screen and running imports for importing events.
811
-     *
812
-     * @return void
813
-     * @throws EE_Error
814
-     * @throws InvalidArgumentException
815
-     * @throws InvalidDataTypeException
816
-     * @throws InvalidInterfaceException
817
-     */
818
-    protected function _import_events()
819
-    {
820
-        require_once(EE_CLASSES . 'EE_Import.class.php');
821
-        $success = EE_Import::instance()->import();
822
-        $this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'), true);
823
-    }
824
-
825
-
826
-    /**
827
-     * _events_export
828
-     * Will export all (or just the given event) to a Excel compatible file.
829
-     *
830
-     * @access protected
831
-     * @return void
832
-     */
833
-    protected function _events_export()
834
-    {
835
-        if (isset($this->_req_data['EVT_ID'])) {
836
-            $event_ids = $this->_req_data['EVT_ID'];
837
-        } elseif (isset($this->_req_data['EVT_IDs'])) {
838
-            $event_ids = $this->_req_data['EVT_IDs'];
839
-        } else {
840
-            $event_ids = null;
841
-        }
842
-        // todo: I don't like doing this but it'll do until we modify EE_Export Class.
843
-        $new_request_args = array(
844
-            'export' => 'report',
845
-            'action' => 'all_event_data',
846
-            'EVT_ID' => $event_ids,
847
-        );
848
-        $this->_req_data = array_merge($this->_req_data, $new_request_args);
849
-        if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
850
-            require_once(EE_CLASSES . 'EE_Export.class.php');
851
-            $EE_Export = EE_Export::instance($this->_req_data);
852
-            $EE_Export->export();
853
-        }
854
-    }
855
-
856
-
857
-    /**
858
-     * handle category exports()
859
-     *
860
-     * @return void
861
-     */
862
-    protected function _categories_export()
863
-    {
864
-        // todo: I don't like doing this but it'll do until we modify EE_Export Class.
865
-        $new_request_args = array(
866
-            'export'       => 'report',
867
-            'action'       => 'categories',
868
-            'category_ids' => $this->_req_data['EVT_CAT_ID'],
869
-        );
870
-        $this->_req_data = array_merge($this->_req_data, $new_request_args);
871
-        if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
872
-            require_once(EE_CLASSES . 'EE_Export.class.php');
873
-            $EE_Export = EE_Export::instance($this->_req_data);
874
-            $EE_Export->export();
875
-        }
876
-    }
877
-
878
-
879
-    /**
880
-     * Creates a sample CSV file for importing
881
-     */
882
-    protected function _sample_export_file()
883
-    {
884
-        // require_once(EE_CLASSES . 'EE_Export.class.php');
885
-        EE_Export::instance()->export_sample();
886
-    }
887
-
888
-
889
-    /*************        Template Settings        *************/
890
-    /**
891
-     * Generates template settings page output
892
-     *
893
-     * @throws DomainException
894
-     * @throws EE_Error
895
-     * @throws InvalidArgumentException
896
-     * @throws InvalidDataTypeException
897
-     * @throws InvalidInterfaceException
898
-     */
899
-    protected function _template_settings()
900
-    {
901
-        $this->_template_args['values'] = $this->_yes_no_values;
902
-        /**
903
-         * Note leaving this filter in for backward compatibility this was moved in 4.6.x
904
-         * from General_Settings_Admin_Page to here.
905
-         */
906
-        $this->_template_args = apply_filters(
907
-            'FHEE__General_Settings_Admin_Page__template_settings__template_args',
908
-            $this->_template_args
909
-        );
910
-        $this->_set_add_edit_form_tags('update_template_settings');
911
-        $this->_set_publish_post_box_vars(null, false, false, null, false);
912
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
913
-            EVENTS_CAF_TEMPLATE_PATH . 'template_settings.template.php',
914
-            $this->_template_args,
915
-            true
916
-        );
917
-        $this->display_admin_page_with_sidebar();
918
-    }
919
-
920
-
921
-    /**
922
-     * Handler for updating template settings.
923
-     *
924
-     * @throws EE_Error
925
-     * @throws InvalidArgumentException
926
-     * @throws InvalidDataTypeException
927
-     * @throws InvalidInterfaceException
928
-     */
929
-    protected function _update_template_settings()
930
-    {
931
-        /**
932
-         * Note leaving this filter in for backward compatibility this was moved in 4.6.x
933
-         * from General_Settings_Admin_Page to here.
934
-         */
935
-        EE_Registry::instance()->CFG->template_settings = apply_filters(
936
-            'FHEE__General_Settings_Admin_Page__update_template_settings__data',
937
-            EE_Registry::instance()->CFG->template_settings,
938
-            $this->_req_data
939
-        );
940
-        // update custom post type slugs and detect if we need to flush rewrite rules
941
-        $old_slug = EE_Registry::instance()->CFG->core->event_cpt_slug;
942
-        EE_Registry::instance()->CFG->core->event_cpt_slug = empty($this->_req_data['event_cpt_slug'])
943
-            ? EE_Registry::instance()->CFG->core->event_cpt_slug
944
-            : EEH_URL::slugify($this->_req_data['event_cpt_slug'], 'events');
945
-        $what = 'Template Settings';
946
-        $success = $this->_update_espresso_configuration(
947
-            $what,
948
-            EE_Registry::instance()->CFG->template_settings,
949
-            __FILE__,
950
-            __FUNCTION__,
951
-            __LINE__
952
-        );
953
-        if (EE_Registry::instance()->CFG->core->event_cpt_slug !== $old_slug) {
954
-            /** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
955
-            $rewrite_rules = LoaderFactory::getLoader()->getShared(
956
-                'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
957
-            );
958
-            $rewrite_rules->flush();
959
-        }
960
-        $this->_redirect_after_action($success, $what, 'updated', array('action' => 'template_settings'));
961
-    }
962
-
963
-
964
-    /**
965
-     * _premium_event_editor_meta_boxes
966
-     * add all metaboxes related to the event_editor
967
-     *
968
-     * @access protected
969
-     * @return void
970
-     * @throws EE_Error
971
-     * @throws InvalidArgumentException
972
-     * @throws InvalidDataTypeException
973
-     * @throws InvalidInterfaceException
974
-     * @throws ReflectionException
975
-     */
976
-    protected function _premium_event_editor_meta_boxes()
977
-    {
978
-        $this->verify_cpt_object();
979
-        add_meta_box(
980
-            'espresso_event_editor_event_options',
981
-            esc_html__('Event Registration Options', 'event_espresso'),
982
-            array($this, 'registration_options_meta_box'),
983
-            $this->page_slug,
984
-            'side',
985
-            'core'
986
-        );
987
-    }
988
-
989
-
990
-    /**
991
-     * override caf metabox
992
-     *
993
-     * @return void
994
-     * @throws DomainException
995
-     * @throws EE_Error
996
-     */
997
-    public function registration_options_meta_box()
998
-    {
999
-        $yes_no_values = array(
1000
-            array('id' => true, 'text' => esc_html__('Yes', 'event_espresso')),
1001
-            array('id' => false, 'text' => esc_html__('No', 'event_espresso')),
1002
-        );
1003
-        $default_reg_status_values = EEM_Registration::reg_status_array(
1004
-            array(
1005
-                EEM_Registration::status_id_cancelled,
1006
-                EEM_Registration::status_id_declined,
1007
-                EEM_Registration::status_id_incomplete,
1008
-                EEM_Registration::status_id_wait_list,
1009
-            ),
1010
-            true
1011
-        );
1012
-        $template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1013
-        $template_args['_event'] = $this->_cpt_model_obj;
1014
-        $template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1015
-        $template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1016
-            'default_reg_status',
1017
-            $default_reg_status_values,
1018
-            $this->_cpt_model_obj->default_registration_status()
1019
-        );
1020
-        $template_args['display_description'] = EEH_Form_Fields::select_input(
1021
-            'display_desc',
1022
-            $yes_no_values,
1023
-            $this->_cpt_model_obj->display_description()
1024
-        );
1025
-        $template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1026
-            'display_ticket_selector',
1027
-            $yes_no_values,
1028
-            $this->_cpt_model_obj->display_ticket_selector(),
1029
-            '',
1030
-            '',
1031
-            false
1032
-        );
1033
-        $template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input(
1034
-            'EVT_default_registration_status',
1035
-            $default_reg_status_values,
1036
-            $this->_cpt_model_obj->default_registration_status()
1037
-        );
1038
-        $template_args['additional_registration_options'] = apply_filters(
1039
-            'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1040
-            '',
1041
-            $template_args,
1042
-            $yes_no_values,
1043
-            $default_reg_status_values
1044
-        );
1045
-        EEH_Template::display_template(
1046
-            EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php',
1047
-            $template_args
1048
-        );
1049
-    }
1050
-
1051
-
1052
-
1053
-    /**
1054
-     * wp_list_table_mods for caf
1055
-     * ============================
1056
-     */
1057
-    /**
1058
-     * hook into list table filters and provide filters for caffeinated list table
1059
-     *
1060
-     * @param array $old_filters    any existing filters present
1061
-     * @param array $list_table_obj the list table object
1062
-     * @return array                  new filters
1063
-     * @throws EE_Error
1064
-     * @throws InvalidArgumentException
1065
-     * @throws InvalidDataTypeException
1066
-     * @throws InvalidInterfaceException
1067
-     * @throws ReflectionException
1068
-     */
1069
-    public function list_table_filters($old_filters, $list_table_obj)
1070
-    {
1071
-        $filters = array();
1072
-        // first month/year filters
1073
-        $filters[] = $this->espresso_event_months_dropdown();
1074
-        $status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1075
-        // active status dropdown
1076
-        if ($status !== 'draft') {
1077
-            $filters[] = $this->active_status_dropdown(
1078
-                isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : ''
1079
-            );
1080
-            $filters[] = $this->venuesDropdown(
1081
-                isset($this->_req_data['venue']) ? $this->_req_data['venue'] : ''
1082
-            );
1083
-        }
1084
-        // category filter
1085
-        $filters[] = $this->category_dropdown();
1086
-        return array_merge($old_filters, $filters);
1087
-    }
1088
-
1089
-
1090
-    /**
1091
-     * espresso_event_months_dropdown
1092
-     *
1093
-     * @access public
1094
-     * @return string                dropdown listing month/year selections for events.
1095
-     */
1096
-    public function espresso_event_months_dropdown()
1097
-    {
1098
-        // what we need to do is get all PRIMARY datetimes for all events to filter on.
1099
-        // Note we need to include any other filters that are set!
1100
-        $status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1101
-        // categories?
1102
-        $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1103
-            ? $this->_req_data['EVT_CAT']
1104
-            : null;
1105
-        // active status?
1106
-        $active_status = isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : null;
1107
-        $cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
1108
-        return EEH_Form_Fields::generate_event_months_dropdown($cur_date, $status, $category, $active_status);
1109
-    }
1110
-
1111
-
1112
-    /**
1113
-     * returns a list of "active" statuses on the event
1114
-     *
1115
-     * @param  string $current_value whatever the current active status is
1116
-     * @return string
1117
-     */
1118
-    public function active_status_dropdown($current_value = '')
1119
-    {
1120
-        $select_name = 'active_status';
1121
-        $values = array(
1122
-            'none'     => esc_html__('Show Active/Inactive', 'event_espresso'),
1123
-            'active'   => esc_html__('Active', 'event_espresso'),
1124
-            'upcoming' => esc_html__('Upcoming', 'event_espresso'),
1125
-            'expired'  => esc_html__('Expired', 'event_espresso'),
1126
-            'inactive' => esc_html__('Inactive', 'event_espresso'),
1127
-        );
1128
-
1129
-        return EEH_Form_Fields::select_input($select_name, $values, $current_value, '', 'wide');
1130
-    }
1131
-
1132
-
1133
-    /**
1134
-     * returns a list of "venues"
1135
-     *
1136
-     * @param string $current_value whatever the current active status is
1137
-     * @return string
1138
-     * @throws EE_Error
1139
-     * @throws InvalidArgumentException
1140
-     * @throws InvalidDataTypeException
1141
-     * @throws InvalidInterfaceException
1142
-     * @throws ReflectionException
1143
-     */
1144
-    protected function venuesDropdown($current_value = '')
1145
-    {
1146
-        $select_name = 'venue';
1147
-        $values = array(
1148
-            '' => esc_html__('All Venues', 'event_espresso'),
1149
-        );
1150
-        // populate the list of venues.
1151
-        $venue_model = EE_Registry::instance()->load_model('Venue');
1152
-        $venues = $venue_model->get_all(array('order_by' => array('VNU_name' => 'ASC')));
1153
-
1154
-        foreach ($venues as $venue) {
1155
-            $values[ $venue->ID() ] = $venue->name();
1156
-        }
1157
-
1158
-        return EEH_Form_Fields::select_input($select_name, $values, $current_value, '', 'wide');
1159
-    }
1160
-
1161
-
1162
-    /**
1163
-     * output a dropdown of the categories for the category filter on the event admin list table
1164
-     *
1165
-     * @access  public
1166
-     * @return string html
1167
-     */
1168
-    public function category_dropdown()
1169
-    {
1170
-        $cur_cat = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
1171
-        return EEH_Form_Fields::generate_event_category_dropdown($cur_cat);
1172
-    }
1173
-
1174
-
1175
-    /**
1176
-     * get total number of events today
1177
-     *
1178
-     * @access public
1179
-     * @return int
1180
-     * @throws EE_Error
1181
-     * @throws InvalidArgumentException
1182
-     * @throws InvalidDataTypeException
1183
-     * @throws InvalidInterfaceException
1184
-     */
1185
-    public function total_events_today()
1186
-    {
1187
-        $start = EEM_Datetime::instance()->convert_datetime_for_query(
1188
-            'DTT_EVT_start',
1189
-            date('Y-m-d') . ' 00:00:00',
1190
-            'Y-m-d H:i:s',
1191
-            'UTC'
1192
-        );
1193
-        $end = EEM_Datetime::instance()->convert_datetime_for_query(
1194
-            'DTT_EVT_start',
1195
-            date('Y-m-d') . ' 23:59:59',
1196
-            'Y-m-d H:i:s',
1197
-            'UTC'
1198
-        );
1199
-        $where = array(
1200
-            'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end)),
1201
-        );
1202
-        $count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
1203
-        return $count;
1204
-    }
1205
-
1206
-
1207
-    /**
1208
-     * get total number of events this month
1209
-     *
1210
-     * @access public
1211
-     * @return int
1212
-     * @throws EE_Error
1213
-     * @throws InvalidArgumentException
1214
-     * @throws InvalidDataTypeException
1215
-     * @throws InvalidInterfaceException
1216
-     */
1217
-    public function total_events_this_month()
1218
-    {
1219
-        // Dates
1220
-        $this_year_r = date('Y');
1221
-        $this_month_r = date('m');
1222
-        $days_this_month = date('t');
1223
-        $start = EEM_Datetime::instance()->convert_datetime_for_query(
1224
-            'DTT_EVT_start',
1225
-            $this_year_r . '-' . $this_month_r . '-01 00:00:00',
1226
-            'Y-m-d H:i:s',
1227
-            'UTC'
1228
-        );
1229
-        $end = EEM_Datetime::instance()->convert_datetime_for_query(
1230
-            'DTT_EVT_start',
1231
-            $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' 23:59:59',
1232
-            'Y-m-d H:i:s',
1233
-            'UTC'
1234
-        );
1235
-        $where = array(
1236
-            'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end)),
1237
-        );
1238
-        $count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
1239
-        return $count;
1240
-    }
1241
-
1242
-
1243
-    /** DEFAULT TICKETS STUFF **/
1244
-
1245
-    /**
1246
-     * Output default tickets list table view.
1247
-     *
1248
-     * @throws DomainException
1249
-     * @throws EE_Error
1250
-     * @throws InvalidArgumentException
1251
-     * @throws InvalidDataTypeException
1252
-     * @throws InvalidInterfaceException
1253
-     */
1254
-    public function _tickets_overview_list_table()
1255
-    {
1256
-        $this->_search_btn_label = esc_html__('Tickets', 'event_espresso');
1257
-        $this->display_admin_list_table_page_with_no_sidebar();
1258
-    }
1259
-
1260
-
1261
-    /**
1262
-     * @param int  $per_page
1263
-     * @param bool $count
1264
-     * @param bool $trashed
1265
-     * @return EE_Soft_Delete_Base_Class[]|int
1266
-     * @throws EE_Error
1267
-     * @throws InvalidArgumentException
1268
-     * @throws InvalidDataTypeException
1269
-     * @throws InvalidInterfaceException
1270
-     */
1271
-    public function get_default_tickets($per_page = 10, $count = false, $trashed = false)
1272
-    {
1273
-        $orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
1274
-        $order = empty($this->_req_data['order']) ? 'ASC' : $this->_req_data['order'];
1275
-        switch ($orderby) {
1276
-            case 'TKT_name':
1277
-                $orderby = array('TKT_name' => $order);
1278
-                break;
1279
-            case 'TKT_price':
1280
-                $orderby = array('TKT_price' => $order);
1281
-                break;
1282
-            case 'TKT_uses':
1283
-                $orderby = array('TKT_uses' => $order);
1284
-                break;
1285
-            case 'TKT_min':
1286
-                $orderby = array('TKT_min' => $order);
1287
-                break;
1288
-            case 'TKT_max':
1289
-                $orderby = array('TKT_max' => $order);
1290
-                break;
1291
-            case 'TKT_qty':
1292
-                $orderby = array('TKT_qty' => $order);
1293
-                break;
1294
-        }
1295
-        $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged'])
1296
-            ? $this->_req_data['paged']
1297
-            : 1;
1298
-        $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage'])
1299
-            ? $this->_req_data['perpage']
1300
-            : $per_page;
1301
-        $_where = array(
1302
-            'TKT_is_default' => 1,
1303
-            'TKT_deleted'    => $trashed,
1304
-        );
1305
-        $offset = ($current_page - 1) * $per_page;
1306
-        $limit = array($offset, $per_page);
1307
-        if (isset($this->_req_data['s'])) {
1308
-            $sstr = '%' . $this->_req_data['s'] . '%';
1309
-            $_where['OR'] = array(
1310
-                'TKT_name'        => array('LIKE', $sstr),
1311
-                'TKT_description' => array('LIKE', $sstr),
1312
-            );
1313
-        }
1314
-        $query_params = array(
1315
-            $_where,
1316
-            'order_by' => $orderby,
1317
-            'limit'    => $limit,
1318
-            'group_by' => 'TKT_ID',
1319
-        );
1320
-        if ($count) {
1321
-            return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
1322
-        } else {
1323
-            return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
1324
-        }
1325
-    }
1326
-
1327
-
1328
-    /**
1329
-     * @param bool $trash
1330
-     * @throws EE_Error
1331
-     * @throws InvalidArgumentException
1332
-     * @throws InvalidDataTypeException
1333
-     * @throws InvalidInterfaceException
1334
-     */
1335
-    protected function _trash_or_restore_ticket($trash = false)
1336
-    {
1337
-        $success = 1;
1338
-        $TKT = EEM_Ticket::instance();
1339
-        // checkboxes?
1340
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1341
-            // if array has more than one element then success message should be plural
1342
-            $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1343
-            // cycle thru the boxes
1344
-            foreach ($this->_req_data['checkbox'] as $TKT_ID) {
1345
-                if ($trash) {
1346
-                    if (! $TKT->delete_by_ID($TKT_ID)) {
1347
-                        $success = 0;
1348
-                    }
1349
-                } elseif (! $TKT->restore_by_ID($TKT_ID)) {
1350
-                    $success = 0;
1351
-                }
1352
-            }
1353
-        } else {
1354
-            // grab single id and trash
1355
-            $TKT_ID = absint($this->_req_data['TKT_ID']);
1356
-            if ($trash) {
1357
-                if (! $TKT->delete_by_ID($TKT_ID)) {
1358
-                    $success = 0;
1359
-                }
1360
-            } elseif (! $TKT->restore_by_ID($TKT_ID)) {
1361
-                $success = 0;
1362
-            }
1363
-        }
1364
-        $action_desc = $trash ? 'moved to the trash' : 'restored';
1365
-        $query_args = array(
1366
-            'action' => 'ticket_list_table',
1367
-            'status' => $trash ? '' : 'trashed',
1368
-        );
1369
-        $this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1370
-    }
1371
-
1372
-
1373
-    /**
1374
-     * Handles trashing default ticket.
1375
-     *
1376
-     * @throws EE_Error
1377
-     * @throws InvalidArgumentException
1378
-     * @throws InvalidDataTypeException
1379
-     * @throws InvalidInterfaceException
1380
-     * @throws ReflectionException
1381
-     */
1382
-    protected function _delete_ticket()
1383
-    {
1384
-        $success = 1;
1385
-        // checkboxes?
1386
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1387
-            // if array has more than one element then success message should be plural
1388
-            $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1389
-            // cycle thru the boxes
1390
-            foreach ($this->_req_data['checkbox'] as $TKT_ID) {
1391
-                // delete
1392
-                if (! $this->_delete_the_ticket($TKT_ID)) {
1393
-                    $success = 0;
1394
-                }
1395
-            }
1396
-        } else {
1397
-            // grab single id and trash
1398
-            $TKT_ID = absint($this->_req_data['TKT_ID']);
1399
-            if (! $this->_delete_the_ticket($TKT_ID)) {
1400
-                $success = 0;
1401
-            }
1402
-        }
1403
-        $action_desc = 'deleted';
1404
-        $query_args = array(
1405
-            'action' => 'ticket_list_table',
1406
-            'status' => 'trashed',
1407
-        );
1408
-        // fail safe.  If the default ticket count === 1 then we need to redirect to event overview.
1409
-        if (EEM_Ticket::instance()->count_deleted_and_undeleted(
1410
-            array(array('TKT_is_default' => 1)),
1411
-            'TKT_ID',
1412
-            true
1413
-        )
1414
-        ) {
1415
-            $query_args = array();
1416
-        }
1417
-        $this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1418
-    }
1419
-
1420
-
1421
-    /**
1422
-     * @param int $TKT_ID
1423
-     * @return bool|int
1424
-     * @throws EE_Error
1425
-     * @throws InvalidArgumentException
1426
-     * @throws InvalidDataTypeException
1427
-     * @throws InvalidInterfaceException
1428
-     * @throws ReflectionException
1429
-     */
1430
-    protected function _delete_the_ticket($TKT_ID)
1431
-    {
1432
-        $tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
1433
-        $tkt->_remove_relations('Datetime');
1434
-        // delete all related prices first
1435
-        $tkt->delete_related_permanently('Price');
1436
-        return $tkt->delete_permanently();
1437
-    }
21
+	/**
22
+	 * @var AdvancedEditorAdminFormSection
23
+	 */
24
+	protected $advanced_editor_admin_form;
25
+
26
+	/**
27
+	 * @var AdvancedEditorData
28
+	 */
29
+	protected $advanced_editor_data;
30
+
31
+
32
+	/**
33
+	 * Extend_Events_Admin_Page constructor.
34
+	 *
35
+	 * @param bool $routing
36
+	 * @throws EE_Error
37
+	 * @throws InvalidArgumentException
38
+	 * @throws InvalidDataTypeException
39
+	 * @throws InvalidInterfaceException
40
+	 * @throws ReflectionException
41
+	 */
42
+	public function __construct($routing = true)
43
+	{
44
+		if (! defined('EVENTS_CAF_TEMPLATE_PATH')) {
45
+			define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/');
46
+			define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/');
47
+			define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/');
48
+		}
49
+		parent::__construct($routing);
50
+	}
51
+
52
+
53
+	/**
54
+	 * Sets routes.
55
+	 *
56
+	 * @throws EE_Error
57
+	 * @throws InvalidArgumentException
58
+	 * @throws InvalidDataTypeException
59
+	 * @throws InvalidInterfaceException
60
+	 * @throws Exception
61
+	 */
62
+	protected function _extend_page_config()
63
+	{
64
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events';
65
+		// is there a evt_id in the request?
66
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
67
+			? $this->_req_data['EVT_ID']
68
+			: 0;
69
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
70
+		// tkt_id?
71
+		$tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID'])
72
+			? $this->_req_data['TKT_ID']
73
+			: 0;
74
+		$new_page_routes = array(
75
+			'duplicate_event'          => array(
76
+				'func'       => '_duplicate_event',
77
+				'capability' => 'ee_edit_event',
78
+				'obj_id'     => $evt_id,
79
+				'noheader'   => true,
80
+			),
81
+			'ticket_list_table'        => array(
82
+				'func'       => '_tickets_overview_list_table',
83
+				'capability' => 'ee_read_default_tickets',
84
+			),
85
+			'trash_ticket'             => array(
86
+				'func'       => '_trash_or_restore_ticket',
87
+				'capability' => 'ee_delete_default_ticket',
88
+				'obj_id'     => $tkt_id,
89
+				'noheader'   => true,
90
+				'args'       => array('trash' => true),
91
+			),
92
+			'trash_tickets'            => array(
93
+				'func'       => '_trash_or_restore_ticket',
94
+				'capability' => 'ee_delete_default_tickets',
95
+				'noheader'   => true,
96
+				'args'       => array('trash' => true),
97
+			),
98
+			'restore_ticket'           => array(
99
+				'func'       => '_trash_or_restore_ticket',
100
+				'capability' => 'ee_delete_default_ticket',
101
+				'obj_id'     => $tkt_id,
102
+				'noheader'   => true,
103
+			),
104
+			'restore_tickets'          => array(
105
+				'func'       => '_trash_or_restore_ticket',
106
+				'capability' => 'ee_delete_default_tickets',
107
+				'noheader'   => true,
108
+			),
109
+			'delete_ticket'            => array(
110
+				'func'       => '_delete_ticket',
111
+				'capability' => 'ee_delete_default_ticket',
112
+				'obj_id'     => $tkt_id,
113
+				'noheader'   => true,
114
+			),
115
+			'delete_tickets'           => array(
116
+				'func'       => '_delete_ticket',
117
+				'capability' => 'ee_delete_default_tickets',
118
+				'noheader'   => true,
119
+			),
120
+			'import_page'              => array(
121
+				'func'       => '_import_page',
122
+				'capability' => 'import',
123
+			),
124
+			'import'                   => array(
125
+				'func'       => '_import_events',
126
+				'capability' => 'import',
127
+				'noheader'   => true,
128
+			),
129
+			'import_events'            => array(
130
+				'func'       => '_import_events',
131
+				'capability' => 'import',
132
+				'noheader'   => true,
133
+			),
134
+			'export_events'            => array(
135
+				'func'       => '_events_export',
136
+				'capability' => 'export',
137
+				'noheader'   => true,
138
+			),
139
+			'export_categories'        => array(
140
+				'func'       => '_categories_export',
141
+				'capability' => 'export',
142
+				'noheader'   => true,
143
+			),
144
+			'sample_export_file'       => array(
145
+				'func'       => '_sample_export_file',
146
+				'capability' => 'export',
147
+				'noheader'   => true,
148
+			),
149
+			'update_template_settings' => array(
150
+				'func'       => '_update_template_settings',
151
+				'capability' => 'manage_options',
152
+				'noheader'   => true,
153
+			),
154
+		);
155
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
156
+		// partial route/config override
157
+		$this->_page_config['import_events']['metaboxes'] = $this->_default_espresso_metaboxes;
158
+		$this->_page_config['create_new']['metaboxes'][] = '_premium_event_editor_meta_boxes';
159
+		$this->_page_config['create_new']['qtips'][] = 'EE_Event_Editor_Tips';
160
+		$this->_page_config['edit']['qtips'][] = 'EE_Event_Editor_Tips';
161
+		$this->_page_config['edit']['metaboxes'][] = '_premium_event_editor_meta_boxes';
162
+		$this->_page_config['default']['list_table'] = 'Extend_Events_Admin_List_Table';
163
+		// add tickets tab but only if there are more than one default ticket!
164
+		$tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(
165
+			array(array('TKT_is_default' => 1)),
166
+			'TKT_ID',
167
+			true
168
+		);
169
+		if ($tkt_count > 1) {
170
+			$new_page_config = array(
171
+				'ticket_list_table' => array(
172
+					'nav'           => array(
173
+						'label' => esc_html__('Default Tickets', 'event_espresso'),
174
+						'order' => 60,
175
+					),
176
+					'list_table'    => 'Tickets_List_Table',
177
+					'require_nonce' => false,
178
+				),
179
+			);
180
+		}
181
+		// template settings
182
+		$new_page_config['template_settings'] = array(
183
+			'nav'           => array(
184
+				'label' => esc_html__('Templates', 'event_espresso'),
185
+				'order' => 30,
186
+			),
187
+			'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
188
+			'help_tabs'     => array(
189
+				'general_settings_templates_help_tab' => array(
190
+					'title'    => esc_html__('Templates', 'event_espresso'),
191
+					'filename' => 'general_settings_templates',
192
+				),
193
+			),
194
+			'help_tour'     => array('Templates_Help_Tour'),
195
+			'require_nonce' => false,
196
+		);
197
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
198
+		// add filters and actions
199
+		// modifying _views
200
+		add_filter(
201
+			'FHEE_event_datetime_metabox_add_additional_date_time_template',
202
+			array($this, 'add_additional_datetime_button'),
203
+			10,
204
+			2
205
+		);
206
+		add_filter(
207
+			'FHEE_event_datetime_metabox_clone_button_template',
208
+			array($this, 'add_datetime_clone_button'),
209
+			10,
210
+			2
211
+		);
212
+		add_filter(
213
+			'FHEE_event_datetime_metabox_timezones_template',
214
+			array($this, 'datetime_timezones_template'),
215
+			10,
216
+			2
217
+		);
218
+		// filters for event list table
219
+		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array($this, 'list_table_filters'), 10, 2);
220
+		add_filter(
221
+			'FHEE__Events_Admin_List_Table__column_actions__action_links',
222
+			array($this, 'extra_list_table_actions'),
223
+			10,
224
+			2
225
+		);
226
+		// legend item
227
+		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array($this, 'additional_legend_items'));
228
+		add_action('admin_init', array($this, 'admin_init'));
229
+	   // load additional handlers
230
+		$this->handleActionRequest();
231
+	}
232
+
233
+
234
+	private function getRequestAction()
235
+	{
236
+		return isset($this->_req_data['action']) ? sanitize_key($this->_req_data['action']) : null;
237
+	}
238
+
239
+
240
+	/**
241
+	 * @throws EE_Error
242
+	 * @throws InvalidArgumentException
243
+	 * @throws InvalidDataTypeException
244
+	 * @throws InvalidInterfaceException
245
+	 * @throws Exception
246
+	 */
247
+	private function handleActionRequest()
248
+	{
249
+		$action = $this->getRequestAction();
250
+		if ($action) {
251
+			// setup Advanced Editor ???
252
+			if ($action === 'default_event_settings' || $action === 'update_default_event_settings') {
253
+				$this->advanced_editor_admin_form = $this->loader->getShared(
254
+					'EventEspresso\core\domain\services\admin\events\default_settings\AdvancedEditorAdminFormSection'
255
+				);
256
+			}
257
+			$admin_config = $this->loader->getShared('EE_Admin_Config');
258
+			// load handler for GraphQL requests and AdvancedEditorData
259
+			if (($action === 'edit' || $action === 'create_new')
260
+				&& $admin_config instanceof EE_Admin_Config
261
+				&& class_exists('WPGraphQL')
262
+				&& $admin_config->useAdvancedEditor()
263
+			) {
264
+				try {
265
+					/** @var EventEspresso\core\services\graphql\GraphQLManager $graphQL_manager */
266
+					$graphQL_manager = $this->loader->getShared(
267
+						'EventEspresso\core\services\graphql\GraphQLManager'
268
+					);
269
+					$graphQL_manager->init();
270
+					$this->advanced_editor_data = $this->loader->getShared(
271
+						'EventEspresso\core\domain\services\admin\events\editor\AdvancedEditorData',
272
+						[$this->_cpt_model_obj]
273
+					);
274
+				} catch (Exception $exception) {
275
+					new ExceptionStackTraceDisplay($exception);
276
+				}
277
+			}
278
+		}
279
+	}
280
+
281
+
282
+	/**
283
+	 * admin_init
284
+	 */
285
+	public function admin_init()
286
+	{
287
+		EE_Registry::$i18n_js_strings = array_merge(
288
+			EE_Registry::$i18n_js_strings,
289
+			array(
290
+				'image_confirm'          => esc_html__(
291
+					'Do you really want to delete this image? Please remember to update your event to complete the removal.',
292
+					'event_espresso'
293
+				),
294
+				'event_starts_on'        => esc_html__('Event Starts on', 'event_espresso'),
295
+				'event_ends_on'          => esc_html__('Event Ends on', 'event_espresso'),
296
+				'event_datetime_actions' => esc_html__('Actions', 'event_espresso'),
297
+				'event_clone_dt_msg'     => esc_html__('Clone this Event Date and Time', 'event_espresso'),
298
+				'remove_event_dt_msg'    => esc_html__('Remove this Event Time', 'event_espresso'),
299
+			)
300
+		);
301
+	}
302
+
303
+
304
+	/**
305
+	 * Add per page screen options to the default ticket list table view.
306
+	 *
307
+	 * @throws InvalidArgumentException
308
+	 * @throws InvalidDataTypeException
309
+	 * @throws InvalidInterfaceException
310
+	 */
311
+	protected function _add_screen_options_ticket_list_table()
312
+	{
313
+		$this->_per_page_screen_option();
314
+	}
315
+
316
+
317
+	/**
318
+	 * @param string $return
319
+	 * @param int    $id
320
+	 * @param string $new_title
321
+	 * @param string $new_slug
322
+	 * @return string
323
+	 */
324
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
325
+	{
326
+		$return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug);
327
+		// make sure this is only when editing
328
+		if (! empty($id)) {
329
+			$href = EE_Admin_Page::add_query_args_and_nonce(
330
+				array('action' => 'duplicate_event', 'EVT_ID' => $id),
331
+				$this->_admin_base_url
332
+			);
333
+			$title = esc_attr__('Duplicate Event', 'event_espresso');
334
+			$return .= '<a href="'
335
+					   . $href
336
+					   . '" title="'
337
+					   . $title
338
+					   . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
339
+					   . $title
340
+					   . '</a>';
341
+		}
342
+		return $return;
343
+	}
344
+
345
+
346
+	/**
347
+	 * Set the list table views for the default ticket list table view.
348
+	 */
349
+	public function _set_list_table_views_ticket_list_table()
350
+	{
351
+		$this->_views = array(
352
+			'all'     => array(
353
+				'slug'        => 'all',
354
+				'label'       => esc_html__('All', 'event_espresso'),
355
+				'count'       => 0,
356
+				'bulk_action' => array(
357
+					'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'),
358
+				),
359
+			),
360
+			'trashed' => array(
361
+				'slug'        => 'trashed',
362
+				'label'       => esc_html__('Trash', 'event_espresso'),
363
+				'count'       => 0,
364
+				'bulk_action' => array(
365
+					'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'),
366
+					'delete_tickets'  => esc_html__('Delete Permanently', 'event_espresso'),
367
+				),
368
+			),
369
+		);
370
+	}
371
+
372
+
373
+	/**
374
+	 * Enqueue scripts and styles for the event editor.
375
+	 */
376
+	public function load_scripts_styles_edit()
377
+	{
378
+		wp_register_script(
379
+			'ee-event-editor-heartbeat',
380
+			EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js',
381
+			array('ee_admin_js', 'heartbeat'),
382
+			EVENT_ESPRESSO_VERSION,
383
+			true
384
+		);
385
+		wp_enqueue_script('ee-accounting');
386
+		// styles
387
+		wp_enqueue_style('espresso-ui-theme');
388
+		wp_enqueue_script('event_editor_js');
389
+		wp_enqueue_script('ee-event-editor-heartbeat');
390
+	}
391
+
392
+
393
+	/**
394
+	 * Returns template for the additional datetime.
395
+	 *
396
+	 * @param $template
397
+	 * @param $template_args
398
+	 * @return mixed
399
+	 * @throws DomainException
400
+	 */
401
+	public function add_additional_datetime_button($template, $template_args)
402
+	{
403
+		return EEH_Template::display_template(
404
+			EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php',
405
+			$template_args,
406
+			true
407
+		);
408
+	}
409
+
410
+
411
+	/**
412
+	 * Returns the template for cloning a datetime.
413
+	 *
414
+	 * @param $template
415
+	 * @param $template_args
416
+	 * @return mixed
417
+	 * @throws DomainException
418
+	 */
419
+	public function add_datetime_clone_button($template, $template_args)
420
+	{
421
+		return EEH_Template::display_template(
422
+			EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php',
423
+			$template_args,
424
+			true
425
+		);
426
+	}
427
+
428
+
429
+	/**
430
+	 * Returns the template for datetime timezones.
431
+	 *
432
+	 * @param $template
433
+	 * @param $template_args
434
+	 * @return mixed
435
+	 * @throws DomainException
436
+	 */
437
+	public function datetime_timezones_template($template, $template_args)
438
+	{
439
+		return EEH_Template::display_template(
440
+			EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php',
441
+			$template_args,
442
+			true
443
+		);
444
+	}
445
+
446
+
447
+	/**
448
+	 * Sets the views for the default list table view.
449
+	 */
450
+	protected function _set_list_table_views_default()
451
+	{
452
+		parent::_set_list_table_views_default();
453
+		$new_views = array(
454
+			'today' => array(
455
+				'slug'        => 'today',
456
+				'label'       => esc_html__('Today', 'event_espresso'),
457
+				'count'       => $this->total_events_today(),
458
+				'bulk_action' => array(
459
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
460
+				),
461
+			),
462
+			'month' => array(
463
+				'slug'        => 'month',
464
+				'label'       => esc_html__('This Month', 'event_espresso'),
465
+				'count'       => $this->total_events_this_month(),
466
+				'bulk_action' => array(
467
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
468
+				),
469
+			),
470
+		);
471
+		$this->_views = array_merge($this->_views, $new_views);
472
+	}
473
+
474
+
475
+	/**
476
+	 * Returns the extra action links for the default list table view.
477
+	 *
478
+	 * @param array    $action_links
479
+	 * @param EE_Event $event
480
+	 * @return array
481
+	 * @throws EE_Error
482
+	 * @throws InvalidArgumentException
483
+	 * @throws InvalidDataTypeException
484
+	 * @throws InvalidInterfaceException
485
+	 * @throws ReflectionException
486
+	 */
487
+	public function extra_list_table_actions(array $action_links, EE_Event $event)
488
+	{
489
+		if (EE_Registry::instance()->CAP->current_user_can(
490
+			'ee_read_registrations',
491
+			'espresso_registrations_reports',
492
+			$event->ID()
493
+		)
494
+		) {
495
+			$reports_query_args = array(
496
+				'action' => 'reports',
497
+				'EVT_ID' => $event->ID(),
498
+			);
499
+			$reports_link = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL);
500
+			$action_links[] = '<a href="'
501
+							  . $reports_link
502
+							  . '" title="'
503
+							  . esc_attr__('View Report', 'event_espresso')
504
+							  . '"><div class="dashicons dashicons-chart-bar"></div></a>'
505
+							  . "\n\t";
506
+		}
507
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
508
+			EE_Registry::instance()->load_helper('MSG_Template');
509
+			$action_links[] = EEH_MSG_Template::get_message_action_link(
510
+				'see_notifications_for',
511
+				null,
512
+				array('EVT_ID' => $event->ID())
513
+			);
514
+		}
515
+		return $action_links;
516
+	}
517
+
518
+
519
+	/**
520
+	 * @param $items
521
+	 * @return mixed
522
+	 */
523
+	public function additional_legend_items($items)
524
+	{
525
+		if (EE_Registry::instance()->CAP->current_user_can(
526
+			'ee_read_registrations',
527
+			'espresso_registrations_reports'
528
+		)
529
+		) {
530
+			$items['reports'] = array(
531
+				'class' => 'dashicons dashicons-chart-bar',
532
+				'desc'  => esc_html__('Event Reports', 'event_espresso'),
533
+			);
534
+		}
535
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
536
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
537
+			// $related_for_icon can sometimes be a string so 'css_class' would be an illegal offset
538
+			// (can only use numeric offsets when treating strings as arrays)
539
+			if (is_array($related_for_icon) && isset($related_for_icon['css_class'], $related_for_icon['label'])) {
540
+				$items['view_related_messages'] = array(
541
+					'class' => $related_for_icon['css_class'],
542
+					'desc'  => $related_for_icon['label'],
543
+				);
544
+			}
545
+		}
546
+		return $items;
547
+	}
548
+
549
+
550
+	/**
551
+	 * This is the callback method for the duplicate event route
552
+	 * Method looks for 'EVT_ID' in the request and retrieves that event and its details and duplicates them
553
+	 * into a new event.  We add a hook so that any plugins that add extra event details can hook into this
554
+	 * action.  Note that the dupe will have **DUPLICATE** as its title and slug.
555
+	 * After duplication the redirect is to the new event edit page.
556
+	 *
557
+	 * @return void
558
+	 * @throws EE_Error If EE_Event is not available with given ID
559
+	 * @throws InvalidArgumentException
560
+	 * @throws InvalidDataTypeException
561
+	 * @throws InvalidInterfaceException
562
+	 * @throws ReflectionException
563
+	 * @access protected
564
+	 */
565
+	protected function _duplicate_event()
566
+	{
567
+		// first make sure the ID for the event is in the request.
568
+		//  If it isn't then we need to bail and redirect back to overview list table (cause how did we get here?)
569
+		if (! isset($this->_req_data['EVT_ID'])) {
570
+			EE_Error::add_error(
571
+				esc_html__(
572
+					'In order to duplicate an event an Event ID is required.  None was given.',
573
+					'event_espresso'
574
+				),
575
+				__FILE__,
576
+				__FUNCTION__,
577
+				__LINE__
578
+			);
579
+			$this->_redirect_after_action(false, '', '', array(), true);
580
+			return;
581
+		}
582
+		// k we've got EVT_ID so let's use that to get the event we'll duplicate
583
+		$orig_event = EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']);
584
+		if (! $orig_event instanceof EE_Event) {
585
+			throw new EE_Error(
586
+				sprintf(
587
+					esc_html__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'),
588
+					$this->_req_data['EVT_ID']
589
+				)
590
+			);
591
+		}
592
+		// k now let's clone the $orig_event before getting relations
593
+		$new_event = clone $orig_event;
594
+		// original datetimes
595
+		$orig_datetimes = $orig_event->get_many_related('Datetime');
596
+		// other original relations
597
+		$orig_ven = $orig_event->get_many_related('Venue');
598
+		// reset the ID and modify other details to make it clear this is a dupe
599
+		$new_event->set('EVT_ID', 0);
600
+		$new_name = $new_event->name() . ' ' . esc_html__('**DUPLICATE**', 'event_espresso');
601
+		$new_event->set('EVT_name', $new_name);
602
+		$new_event->set(
603
+			'EVT_slug',
604
+			wp_unique_post_slug(
605
+				sanitize_title($orig_event->name()),
606
+				0,
607
+				'publish',
608
+				'espresso_events',
609
+				0
610
+			)
611
+		);
612
+		$new_event->set('status', 'draft');
613
+		// duplicate discussion settings
614
+		$new_event->set('comment_status', $orig_event->get('comment_status'));
615
+		$new_event->set('ping_status', $orig_event->get('ping_status'));
616
+		// save the new event
617
+		$new_event->save();
618
+		// venues
619
+		foreach ($orig_ven as $ven) {
620
+			$new_event->_add_relation_to($ven, 'Venue');
621
+		}
622
+		$new_event->save();
623
+		// now we need to get the question group relations and handle that
624
+		// first primary question groups
625
+		$orig_primary_qgs = $orig_event->get_many_related(
626
+			'Question_Group',
627
+			[['Event_Question_Group.EQG_primary' => true]]
628
+		);
629
+		if (! empty($orig_primary_qgs)) {
630
+			foreach ($orig_primary_qgs as $id => $obj) {
631
+				if ($obj instanceof EE_Question_Group) {
632
+					$new_event->_add_relation_to($obj, 'Question_Group', ['EQG_primary' => true]);
633
+				}
634
+			}
635
+		}
636
+		// next additional attendee question groups
637
+		$orig_additional_qgs = $orig_event->get_many_related(
638
+			'Question_Group',
639
+			[['Event_Question_Group.EQG_additional' => true]]
640
+		);
641
+		if (! empty($orig_additional_qgs)) {
642
+			foreach ($orig_additional_qgs as $id => $obj) {
643
+				if ($obj instanceof EE_Question_Group) {
644
+					$new_event->_add_relation_to($obj, 'Question_Group', ['EQG_additional' => true]);
645
+				}
646
+			}
647
+		}
648
+
649
+		$new_event->save();
650
+
651
+		// k now that we have the new event saved we can loop through the datetimes and start adding relations.
652
+		$cloned_tickets = array();
653
+		foreach ($orig_datetimes as $orig_dtt) {
654
+			if (! $orig_dtt instanceof EE_Datetime) {
655
+				continue;
656
+			}
657
+			$new_dtt = clone $orig_dtt;
658
+			$orig_tkts = $orig_dtt->tickets();
659
+			// save new dtt then add to event
660
+			$new_dtt->set('DTT_ID', 0);
661
+			$new_dtt->set('DTT_sold', 0);
662
+			$new_dtt->set_reserved(0);
663
+			$new_dtt->save();
664
+			$new_event->_add_relation_to($new_dtt, 'Datetime');
665
+			$new_event->save();
666
+			// now let's get the ticket relations setup.
667
+			foreach ((array) $orig_tkts as $orig_tkt) {
668
+				// it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
669
+				if (! $orig_tkt instanceof EE_Ticket) {
670
+					continue;
671
+				}
672
+				// is this ticket archived?  If it is then let's skip
673
+				if ($orig_tkt->get('TKT_deleted')) {
674
+					continue;
675
+				}
676
+				// does this original ticket already exist in the clone_tickets cache?
677
+				//  If so we'll just use the new ticket from it.
678
+				if (isset($cloned_tickets[ $orig_tkt->ID() ])) {
679
+					$new_tkt = $cloned_tickets[ $orig_tkt->ID() ];
680
+				} else {
681
+					$new_tkt = clone $orig_tkt;
682
+					// get relations on the $orig_tkt that we need to setup.
683
+					$orig_prices = $orig_tkt->prices();
684
+					$new_tkt->set('TKT_ID', 0);
685
+					$new_tkt->set('TKT_sold', 0);
686
+					$new_tkt->set('TKT_reserved', 0);
687
+					$new_tkt->save(); // make sure new ticket has ID.
688
+					// price relations on new ticket need to be setup.
689
+					foreach ($orig_prices as $orig_price) {
690
+						$new_price = clone $orig_price;
691
+						$new_price->set('PRC_ID', 0);
692
+						$new_price->save();
693
+						$new_tkt->_add_relation_to($new_price, 'Price');
694
+						$new_tkt->save();
695
+					}
696
+
697
+					do_action(
698
+						'AHEE__Extend_Events_Admin_Page___duplicate_event__duplicate_ticket__after',
699
+						$orig_tkt,
700
+						$new_tkt,
701
+						$orig_prices,
702
+						$orig_event,
703
+						$orig_dtt,
704
+						$new_dtt
705
+					);
706
+				}
707
+				// k now we can add the new ticket as a relation to the new datetime
708
+				// and make sure its added to our cached $cloned_tickets array
709
+				// for use with later datetimes that have the same ticket.
710
+				$new_dtt->_add_relation_to($new_tkt, 'Ticket');
711
+				$new_dtt->save();
712
+				$cloned_tickets[ $orig_tkt->ID() ] = $new_tkt;
713
+			}
714
+		}
715
+		// clone taxonomy information
716
+		$taxonomies_to_clone_with = apply_filters(
717
+			'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone',
718
+			array('espresso_event_categories', 'espresso_event_type', 'post_tag')
719
+		);
720
+		// get terms for original event (notice)
721
+		$orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with);
722
+		// loop through terms and add them to new event.
723
+		foreach ($orig_terms as $term) {
724
+			wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true);
725
+		}
726
+
727
+		// duplicate other core WP_Post items for this event.
728
+		// post thumbnail (feature image).
729
+		$feature_image_id = get_post_thumbnail_id($orig_event->ID());
730
+		if ($feature_image_id) {
731
+			update_post_meta($new_event->ID(), '_thumbnail_id', $feature_image_id);
732
+		}
733
+
734
+		// duplicate page_template setting
735
+		$page_template = get_post_meta($orig_event->ID(), '_wp_page_template', true);
736
+		if ($page_template) {
737
+			update_post_meta($new_event->ID(), '_wp_page_template', $page_template);
738
+		}
739
+
740
+		do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event);
741
+		// now let's redirect to the edit page for this duplicated event if we have a new event id.
742
+		if ($new_event->ID()) {
743
+			$redirect_args = array(
744
+				'post'   => $new_event->ID(),
745
+				'action' => 'edit',
746
+			);
747
+			EE_Error::add_success(
748
+				esc_html__(
749
+					'Event successfully duplicated.  Please review the details below and make any necessary edits',
750
+					'event_espresso'
751
+				)
752
+			);
753
+		} else {
754
+			$redirect_args = array(
755
+				'action' => 'default',
756
+			);
757
+			EE_Error::add_error(
758
+				esc_html__('Not able to duplicate event.  Something went wrong.', 'event_espresso'),
759
+				__FILE__,
760
+				__FUNCTION__,
761
+				__LINE__
762
+			);
763
+		}
764
+		$this->_redirect_after_action(false, '', '', $redirect_args, true);
765
+	}
766
+
767
+
768
+	/**
769
+	 * Generates output for the import page.
770
+	 *
771
+	 * @throws DomainException
772
+	 * @throws EE_Error
773
+	 * @throws InvalidArgumentException
774
+	 * @throws InvalidDataTypeException
775
+	 * @throws InvalidInterfaceException
776
+	 */
777
+	protected function _import_page()
778
+	{
779
+		$title = esc_html__('Import', 'event_espresso');
780
+		$intro = esc_html__(
781
+			'If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ',
782
+			'event_espresso'
783
+		);
784
+		$form_url = EVENTS_ADMIN_URL;
785
+		$action = 'import_events';
786
+		$type = 'csv';
787
+		$this->_template_args['form'] = EE_Import::instance()->upload_form(
788
+			$title,
789
+			$intro,
790
+			$form_url,
791
+			$action,
792
+			$type
793
+		);
794
+		$this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(
795
+			array('action' => 'sample_export_file'),
796
+			$this->_admin_base_url
797
+		);
798
+		$content = EEH_Template::display_template(
799
+			EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',
800
+			$this->_template_args,
801
+			true
802
+		);
803
+		$this->_template_args['admin_page_content'] = $content;
804
+		$this->display_admin_page_with_sidebar();
805
+	}
806
+
807
+
808
+	/**
809
+	 * _import_events
810
+	 * This handles displaying the screen and running imports for importing events.
811
+	 *
812
+	 * @return void
813
+	 * @throws EE_Error
814
+	 * @throws InvalidArgumentException
815
+	 * @throws InvalidDataTypeException
816
+	 * @throws InvalidInterfaceException
817
+	 */
818
+	protected function _import_events()
819
+	{
820
+		require_once(EE_CLASSES . 'EE_Import.class.php');
821
+		$success = EE_Import::instance()->import();
822
+		$this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'), true);
823
+	}
824
+
825
+
826
+	/**
827
+	 * _events_export
828
+	 * Will export all (or just the given event) to a Excel compatible file.
829
+	 *
830
+	 * @access protected
831
+	 * @return void
832
+	 */
833
+	protected function _events_export()
834
+	{
835
+		if (isset($this->_req_data['EVT_ID'])) {
836
+			$event_ids = $this->_req_data['EVT_ID'];
837
+		} elseif (isset($this->_req_data['EVT_IDs'])) {
838
+			$event_ids = $this->_req_data['EVT_IDs'];
839
+		} else {
840
+			$event_ids = null;
841
+		}
842
+		// todo: I don't like doing this but it'll do until we modify EE_Export Class.
843
+		$new_request_args = array(
844
+			'export' => 'report',
845
+			'action' => 'all_event_data',
846
+			'EVT_ID' => $event_ids,
847
+		);
848
+		$this->_req_data = array_merge($this->_req_data, $new_request_args);
849
+		if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
850
+			require_once(EE_CLASSES . 'EE_Export.class.php');
851
+			$EE_Export = EE_Export::instance($this->_req_data);
852
+			$EE_Export->export();
853
+		}
854
+	}
855
+
856
+
857
+	/**
858
+	 * handle category exports()
859
+	 *
860
+	 * @return void
861
+	 */
862
+	protected function _categories_export()
863
+	{
864
+		// todo: I don't like doing this but it'll do until we modify EE_Export Class.
865
+		$new_request_args = array(
866
+			'export'       => 'report',
867
+			'action'       => 'categories',
868
+			'category_ids' => $this->_req_data['EVT_CAT_ID'],
869
+		);
870
+		$this->_req_data = array_merge($this->_req_data, $new_request_args);
871
+		if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
872
+			require_once(EE_CLASSES . 'EE_Export.class.php');
873
+			$EE_Export = EE_Export::instance($this->_req_data);
874
+			$EE_Export->export();
875
+		}
876
+	}
877
+
878
+
879
+	/**
880
+	 * Creates a sample CSV file for importing
881
+	 */
882
+	protected function _sample_export_file()
883
+	{
884
+		// require_once(EE_CLASSES . 'EE_Export.class.php');
885
+		EE_Export::instance()->export_sample();
886
+	}
887
+
888
+
889
+	/*************        Template Settings        *************/
890
+	/**
891
+	 * Generates template settings page output
892
+	 *
893
+	 * @throws DomainException
894
+	 * @throws EE_Error
895
+	 * @throws InvalidArgumentException
896
+	 * @throws InvalidDataTypeException
897
+	 * @throws InvalidInterfaceException
898
+	 */
899
+	protected function _template_settings()
900
+	{
901
+		$this->_template_args['values'] = $this->_yes_no_values;
902
+		/**
903
+		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
904
+		 * from General_Settings_Admin_Page to here.
905
+		 */
906
+		$this->_template_args = apply_filters(
907
+			'FHEE__General_Settings_Admin_Page__template_settings__template_args',
908
+			$this->_template_args
909
+		);
910
+		$this->_set_add_edit_form_tags('update_template_settings');
911
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
912
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
913
+			EVENTS_CAF_TEMPLATE_PATH . 'template_settings.template.php',
914
+			$this->_template_args,
915
+			true
916
+		);
917
+		$this->display_admin_page_with_sidebar();
918
+	}
919
+
920
+
921
+	/**
922
+	 * Handler for updating template settings.
923
+	 *
924
+	 * @throws EE_Error
925
+	 * @throws InvalidArgumentException
926
+	 * @throws InvalidDataTypeException
927
+	 * @throws InvalidInterfaceException
928
+	 */
929
+	protected function _update_template_settings()
930
+	{
931
+		/**
932
+		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
933
+		 * from General_Settings_Admin_Page to here.
934
+		 */
935
+		EE_Registry::instance()->CFG->template_settings = apply_filters(
936
+			'FHEE__General_Settings_Admin_Page__update_template_settings__data',
937
+			EE_Registry::instance()->CFG->template_settings,
938
+			$this->_req_data
939
+		);
940
+		// update custom post type slugs and detect if we need to flush rewrite rules
941
+		$old_slug = EE_Registry::instance()->CFG->core->event_cpt_slug;
942
+		EE_Registry::instance()->CFG->core->event_cpt_slug = empty($this->_req_data['event_cpt_slug'])
943
+			? EE_Registry::instance()->CFG->core->event_cpt_slug
944
+			: EEH_URL::slugify($this->_req_data['event_cpt_slug'], 'events');
945
+		$what = 'Template Settings';
946
+		$success = $this->_update_espresso_configuration(
947
+			$what,
948
+			EE_Registry::instance()->CFG->template_settings,
949
+			__FILE__,
950
+			__FUNCTION__,
951
+			__LINE__
952
+		);
953
+		if (EE_Registry::instance()->CFG->core->event_cpt_slug !== $old_slug) {
954
+			/** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
955
+			$rewrite_rules = LoaderFactory::getLoader()->getShared(
956
+				'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
957
+			);
958
+			$rewrite_rules->flush();
959
+		}
960
+		$this->_redirect_after_action($success, $what, 'updated', array('action' => 'template_settings'));
961
+	}
962
+
963
+
964
+	/**
965
+	 * _premium_event_editor_meta_boxes
966
+	 * add all metaboxes related to the event_editor
967
+	 *
968
+	 * @access protected
969
+	 * @return void
970
+	 * @throws EE_Error
971
+	 * @throws InvalidArgumentException
972
+	 * @throws InvalidDataTypeException
973
+	 * @throws InvalidInterfaceException
974
+	 * @throws ReflectionException
975
+	 */
976
+	protected function _premium_event_editor_meta_boxes()
977
+	{
978
+		$this->verify_cpt_object();
979
+		add_meta_box(
980
+			'espresso_event_editor_event_options',
981
+			esc_html__('Event Registration Options', 'event_espresso'),
982
+			array($this, 'registration_options_meta_box'),
983
+			$this->page_slug,
984
+			'side',
985
+			'core'
986
+		);
987
+	}
988
+
989
+
990
+	/**
991
+	 * override caf metabox
992
+	 *
993
+	 * @return void
994
+	 * @throws DomainException
995
+	 * @throws EE_Error
996
+	 */
997
+	public function registration_options_meta_box()
998
+	{
999
+		$yes_no_values = array(
1000
+			array('id' => true, 'text' => esc_html__('Yes', 'event_espresso')),
1001
+			array('id' => false, 'text' => esc_html__('No', 'event_espresso')),
1002
+		);
1003
+		$default_reg_status_values = EEM_Registration::reg_status_array(
1004
+			array(
1005
+				EEM_Registration::status_id_cancelled,
1006
+				EEM_Registration::status_id_declined,
1007
+				EEM_Registration::status_id_incomplete,
1008
+				EEM_Registration::status_id_wait_list,
1009
+			),
1010
+			true
1011
+		);
1012
+		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1013
+		$template_args['_event'] = $this->_cpt_model_obj;
1014
+		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1015
+		$template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1016
+			'default_reg_status',
1017
+			$default_reg_status_values,
1018
+			$this->_cpt_model_obj->default_registration_status()
1019
+		);
1020
+		$template_args['display_description'] = EEH_Form_Fields::select_input(
1021
+			'display_desc',
1022
+			$yes_no_values,
1023
+			$this->_cpt_model_obj->display_description()
1024
+		);
1025
+		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1026
+			'display_ticket_selector',
1027
+			$yes_no_values,
1028
+			$this->_cpt_model_obj->display_ticket_selector(),
1029
+			'',
1030
+			'',
1031
+			false
1032
+		);
1033
+		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input(
1034
+			'EVT_default_registration_status',
1035
+			$default_reg_status_values,
1036
+			$this->_cpt_model_obj->default_registration_status()
1037
+		);
1038
+		$template_args['additional_registration_options'] = apply_filters(
1039
+			'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1040
+			'',
1041
+			$template_args,
1042
+			$yes_no_values,
1043
+			$default_reg_status_values
1044
+		);
1045
+		EEH_Template::display_template(
1046
+			EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php',
1047
+			$template_args
1048
+		);
1049
+	}
1050
+
1051
+
1052
+
1053
+	/**
1054
+	 * wp_list_table_mods for caf
1055
+	 * ============================
1056
+	 */
1057
+	/**
1058
+	 * hook into list table filters and provide filters for caffeinated list table
1059
+	 *
1060
+	 * @param array $old_filters    any existing filters present
1061
+	 * @param array $list_table_obj the list table object
1062
+	 * @return array                  new filters
1063
+	 * @throws EE_Error
1064
+	 * @throws InvalidArgumentException
1065
+	 * @throws InvalidDataTypeException
1066
+	 * @throws InvalidInterfaceException
1067
+	 * @throws ReflectionException
1068
+	 */
1069
+	public function list_table_filters($old_filters, $list_table_obj)
1070
+	{
1071
+		$filters = array();
1072
+		// first month/year filters
1073
+		$filters[] = $this->espresso_event_months_dropdown();
1074
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1075
+		// active status dropdown
1076
+		if ($status !== 'draft') {
1077
+			$filters[] = $this->active_status_dropdown(
1078
+				isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : ''
1079
+			);
1080
+			$filters[] = $this->venuesDropdown(
1081
+				isset($this->_req_data['venue']) ? $this->_req_data['venue'] : ''
1082
+			);
1083
+		}
1084
+		// category filter
1085
+		$filters[] = $this->category_dropdown();
1086
+		return array_merge($old_filters, $filters);
1087
+	}
1088
+
1089
+
1090
+	/**
1091
+	 * espresso_event_months_dropdown
1092
+	 *
1093
+	 * @access public
1094
+	 * @return string                dropdown listing month/year selections for events.
1095
+	 */
1096
+	public function espresso_event_months_dropdown()
1097
+	{
1098
+		// what we need to do is get all PRIMARY datetimes for all events to filter on.
1099
+		// Note we need to include any other filters that are set!
1100
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1101
+		// categories?
1102
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1103
+			? $this->_req_data['EVT_CAT']
1104
+			: null;
1105
+		// active status?
1106
+		$active_status = isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : null;
1107
+		$cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
1108
+		return EEH_Form_Fields::generate_event_months_dropdown($cur_date, $status, $category, $active_status);
1109
+	}
1110
+
1111
+
1112
+	/**
1113
+	 * returns a list of "active" statuses on the event
1114
+	 *
1115
+	 * @param  string $current_value whatever the current active status is
1116
+	 * @return string
1117
+	 */
1118
+	public function active_status_dropdown($current_value = '')
1119
+	{
1120
+		$select_name = 'active_status';
1121
+		$values = array(
1122
+			'none'     => esc_html__('Show Active/Inactive', 'event_espresso'),
1123
+			'active'   => esc_html__('Active', 'event_espresso'),
1124
+			'upcoming' => esc_html__('Upcoming', 'event_espresso'),
1125
+			'expired'  => esc_html__('Expired', 'event_espresso'),
1126
+			'inactive' => esc_html__('Inactive', 'event_espresso'),
1127
+		);
1128
+
1129
+		return EEH_Form_Fields::select_input($select_name, $values, $current_value, '', 'wide');
1130
+	}
1131
+
1132
+
1133
+	/**
1134
+	 * returns a list of "venues"
1135
+	 *
1136
+	 * @param string $current_value whatever the current active status is
1137
+	 * @return string
1138
+	 * @throws EE_Error
1139
+	 * @throws InvalidArgumentException
1140
+	 * @throws InvalidDataTypeException
1141
+	 * @throws InvalidInterfaceException
1142
+	 * @throws ReflectionException
1143
+	 */
1144
+	protected function venuesDropdown($current_value = '')
1145
+	{
1146
+		$select_name = 'venue';
1147
+		$values = array(
1148
+			'' => esc_html__('All Venues', 'event_espresso'),
1149
+		);
1150
+		// populate the list of venues.
1151
+		$venue_model = EE_Registry::instance()->load_model('Venue');
1152
+		$venues = $venue_model->get_all(array('order_by' => array('VNU_name' => 'ASC')));
1153
+
1154
+		foreach ($venues as $venue) {
1155
+			$values[ $venue->ID() ] = $venue->name();
1156
+		}
1157
+
1158
+		return EEH_Form_Fields::select_input($select_name, $values, $current_value, '', 'wide');
1159
+	}
1160
+
1161
+
1162
+	/**
1163
+	 * output a dropdown of the categories for the category filter on the event admin list table
1164
+	 *
1165
+	 * @access  public
1166
+	 * @return string html
1167
+	 */
1168
+	public function category_dropdown()
1169
+	{
1170
+		$cur_cat = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
1171
+		return EEH_Form_Fields::generate_event_category_dropdown($cur_cat);
1172
+	}
1173
+
1174
+
1175
+	/**
1176
+	 * get total number of events today
1177
+	 *
1178
+	 * @access public
1179
+	 * @return int
1180
+	 * @throws EE_Error
1181
+	 * @throws InvalidArgumentException
1182
+	 * @throws InvalidDataTypeException
1183
+	 * @throws InvalidInterfaceException
1184
+	 */
1185
+	public function total_events_today()
1186
+	{
1187
+		$start = EEM_Datetime::instance()->convert_datetime_for_query(
1188
+			'DTT_EVT_start',
1189
+			date('Y-m-d') . ' 00:00:00',
1190
+			'Y-m-d H:i:s',
1191
+			'UTC'
1192
+		);
1193
+		$end = EEM_Datetime::instance()->convert_datetime_for_query(
1194
+			'DTT_EVT_start',
1195
+			date('Y-m-d') . ' 23:59:59',
1196
+			'Y-m-d H:i:s',
1197
+			'UTC'
1198
+		);
1199
+		$where = array(
1200
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end)),
1201
+		);
1202
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
1203
+		return $count;
1204
+	}
1205
+
1206
+
1207
+	/**
1208
+	 * get total number of events this month
1209
+	 *
1210
+	 * @access public
1211
+	 * @return int
1212
+	 * @throws EE_Error
1213
+	 * @throws InvalidArgumentException
1214
+	 * @throws InvalidDataTypeException
1215
+	 * @throws InvalidInterfaceException
1216
+	 */
1217
+	public function total_events_this_month()
1218
+	{
1219
+		// Dates
1220
+		$this_year_r = date('Y');
1221
+		$this_month_r = date('m');
1222
+		$days_this_month = date('t');
1223
+		$start = EEM_Datetime::instance()->convert_datetime_for_query(
1224
+			'DTT_EVT_start',
1225
+			$this_year_r . '-' . $this_month_r . '-01 00:00:00',
1226
+			'Y-m-d H:i:s',
1227
+			'UTC'
1228
+		);
1229
+		$end = EEM_Datetime::instance()->convert_datetime_for_query(
1230
+			'DTT_EVT_start',
1231
+			$this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' 23:59:59',
1232
+			'Y-m-d H:i:s',
1233
+			'UTC'
1234
+		);
1235
+		$where = array(
1236
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end)),
1237
+		);
1238
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
1239
+		return $count;
1240
+	}
1241
+
1242
+
1243
+	/** DEFAULT TICKETS STUFF **/
1244
+
1245
+	/**
1246
+	 * Output default tickets list table view.
1247
+	 *
1248
+	 * @throws DomainException
1249
+	 * @throws EE_Error
1250
+	 * @throws InvalidArgumentException
1251
+	 * @throws InvalidDataTypeException
1252
+	 * @throws InvalidInterfaceException
1253
+	 */
1254
+	public function _tickets_overview_list_table()
1255
+	{
1256
+		$this->_search_btn_label = esc_html__('Tickets', 'event_espresso');
1257
+		$this->display_admin_list_table_page_with_no_sidebar();
1258
+	}
1259
+
1260
+
1261
+	/**
1262
+	 * @param int  $per_page
1263
+	 * @param bool $count
1264
+	 * @param bool $trashed
1265
+	 * @return EE_Soft_Delete_Base_Class[]|int
1266
+	 * @throws EE_Error
1267
+	 * @throws InvalidArgumentException
1268
+	 * @throws InvalidDataTypeException
1269
+	 * @throws InvalidInterfaceException
1270
+	 */
1271
+	public function get_default_tickets($per_page = 10, $count = false, $trashed = false)
1272
+	{
1273
+		$orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
1274
+		$order = empty($this->_req_data['order']) ? 'ASC' : $this->_req_data['order'];
1275
+		switch ($orderby) {
1276
+			case 'TKT_name':
1277
+				$orderby = array('TKT_name' => $order);
1278
+				break;
1279
+			case 'TKT_price':
1280
+				$orderby = array('TKT_price' => $order);
1281
+				break;
1282
+			case 'TKT_uses':
1283
+				$orderby = array('TKT_uses' => $order);
1284
+				break;
1285
+			case 'TKT_min':
1286
+				$orderby = array('TKT_min' => $order);
1287
+				break;
1288
+			case 'TKT_max':
1289
+				$orderby = array('TKT_max' => $order);
1290
+				break;
1291
+			case 'TKT_qty':
1292
+				$orderby = array('TKT_qty' => $order);
1293
+				break;
1294
+		}
1295
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged'])
1296
+			? $this->_req_data['paged']
1297
+			: 1;
1298
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage'])
1299
+			? $this->_req_data['perpage']
1300
+			: $per_page;
1301
+		$_where = array(
1302
+			'TKT_is_default' => 1,
1303
+			'TKT_deleted'    => $trashed,
1304
+		);
1305
+		$offset = ($current_page - 1) * $per_page;
1306
+		$limit = array($offset, $per_page);
1307
+		if (isset($this->_req_data['s'])) {
1308
+			$sstr = '%' . $this->_req_data['s'] . '%';
1309
+			$_where['OR'] = array(
1310
+				'TKT_name'        => array('LIKE', $sstr),
1311
+				'TKT_description' => array('LIKE', $sstr),
1312
+			);
1313
+		}
1314
+		$query_params = array(
1315
+			$_where,
1316
+			'order_by' => $orderby,
1317
+			'limit'    => $limit,
1318
+			'group_by' => 'TKT_ID',
1319
+		);
1320
+		if ($count) {
1321
+			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
1322
+		} else {
1323
+			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
1324
+		}
1325
+	}
1326
+
1327
+
1328
+	/**
1329
+	 * @param bool $trash
1330
+	 * @throws EE_Error
1331
+	 * @throws InvalidArgumentException
1332
+	 * @throws InvalidDataTypeException
1333
+	 * @throws InvalidInterfaceException
1334
+	 */
1335
+	protected function _trash_or_restore_ticket($trash = false)
1336
+	{
1337
+		$success = 1;
1338
+		$TKT = EEM_Ticket::instance();
1339
+		// checkboxes?
1340
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1341
+			// if array has more than one element then success message should be plural
1342
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1343
+			// cycle thru the boxes
1344
+			foreach ($this->_req_data['checkbox'] as $TKT_ID) {
1345
+				if ($trash) {
1346
+					if (! $TKT->delete_by_ID($TKT_ID)) {
1347
+						$success = 0;
1348
+					}
1349
+				} elseif (! $TKT->restore_by_ID($TKT_ID)) {
1350
+					$success = 0;
1351
+				}
1352
+			}
1353
+		} else {
1354
+			// grab single id and trash
1355
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1356
+			if ($trash) {
1357
+				if (! $TKT->delete_by_ID($TKT_ID)) {
1358
+					$success = 0;
1359
+				}
1360
+			} elseif (! $TKT->restore_by_ID($TKT_ID)) {
1361
+				$success = 0;
1362
+			}
1363
+		}
1364
+		$action_desc = $trash ? 'moved to the trash' : 'restored';
1365
+		$query_args = array(
1366
+			'action' => 'ticket_list_table',
1367
+			'status' => $trash ? '' : 'trashed',
1368
+		);
1369
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1370
+	}
1371
+
1372
+
1373
+	/**
1374
+	 * Handles trashing default ticket.
1375
+	 *
1376
+	 * @throws EE_Error
1377
+	 * @throws InvalidArgumentException
1378
+	 * @throws InvalidDataTypeException
1379
+	 * @throws InvalidInterfaceException
1380
+	 * @throws ReflectionException
1381
+	 */
1382
+	protected function _delete_ticket()
1383
+	{
1384
+		$success = 1;
1385
+		// checkboxes?
1386
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1387
+			// if array has more than one element then success message should be plural
1388
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1389
+			// cycle thru the boxes
1390
+			foreach ($this->_req_data['checkbox'] as $TKT_ID) {
1391
+				// delete
1392
+				if (! $this->_delete_the_ticket($TKT_ID)) {
1393
+					$success = 0;
1394
+				}
1395
+			}
1396
+		} else {
1397
+			// grab single id and trash
1398
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1399
+			if (! $this->_delete_the_ticket($TKT_ID)) {
1400
+				$success = 0;
1401
+			}
1402
+		}
1403
+		$action_desc = 'deleted';
1404
+		$query_args = array(
1405
+			'action' => 'ticket_list_table',
1406
+			'status' => 'trashed',
1407
+		);
1408
+		// fail safe.  If the default ticket count === 1 then we need to redirect to event overview.
1409
+		if (EEM_Ticket::instance()->count_deleted_and_undeleted(
1410
+			array(array('TKT_is_default' => 1)),
1411
+			'TKT_ID',
1412
+			true
1413
+		)
1414
+		) {
1415
+			$query_args = array();
1416
+		}
1417
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1418
+	}
1419
+
1420
+
1421
+	/**
1422
+	 * @param int $TKT_ID
1423
+	 * @return bool|int
1424
+	 * @throws EE_Error
1425
+	 * @throws InvalidArgumentException
1426
+	 * @throws InvalidDataTypeException
1427
+	 * @throws InvalidInterfaceException
1428
+	 * @throws ReflectionException
1429
+	 */
1430
+	protected function _delete_the_ticket($TKT_ID)
1431
+	{
1432
+		$tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
1433
+		$tkt->_remove_relations('Datetime');
1434
+		// delete all related prices first
1435
+		$tkt->delete_related_permanently('Price');
1436
+		return $tkt->delete_permanently();
1437
+	}
1438 1438
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/types/RootQuery.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -28,71 +28,71 @@
 block discarded – undo
28 28
 class RootQuery extends TypeBase
29 29
 {
30 30
 
31
-    /**
32
-     * RootQuery constructor.
33
-     */
34
-    public function __construct()
35
-    {
36
-        $this->setName('RootQuery');
37
-        $this->setIsCustomPostType(true);
38
-        parent::__construct();
39
-    }
31
+	/**
32
+	 * RootQuery constructor.
33
+	 */
34
+	public function __construct()
35
+	{
36
+		$this->setName('RootQuery');
37
+		$this->setIsCustomPostType(true);
38
+		parent::__construct();
39
+	}
40 40
 
41 41
 
42
-    /**
43
-     * @return GraphQLFieldInterface[]
44
-     * @since $VID:$
45
-     */
46
-    public function getFields()
47
-    {
48
-        return [
49
-            new GraphQLOutputField(
50
-                lcfirst($this->namespace) . 'EventRelations',
51
-                'String',
52
-                null,
53
-                esc_html__('JSON encoded relational data of the models', 'event_espresso'),
54
-                null,
55
-                [$this, 'getEventRelationalData'],
56
-                [
57
-                    'eventId' => [
58
-                        'type'        => ['non_null' => 'Int'],
59
-                        'description' => esc_html__('The event ID to get the relational data for.', 'event_espresso'),
60
-                    ],
61
-                ]
62
-            ),
63
-        ];
64
-    }
42
+	/**
43
+	 * @return GraphQLFieldInterface[]
44
+	 * @since $VID:$
45
+	 */
46
+	public function getFields()
47
+	{
48
+		return [
49
+			new GraphQLOutputField(
50
+				lcfirst($this->namespace) . 'EventRelations',
51
+				'String',
52
+				null,
53
+				esc_html__('JSON encoded relational data of the models', 'event_espresso'),
54
+				null,
55
+				[$this, 'getEventRelationalData'],
56
+				[
57
+					'eventId' => [
58
+						'type'        => ['non_null' => 'Int'],
59
+						'description' => esc_html__('The event ID to get the relational data for.', 'event_espresso'),
60
+					],
61
+				]
62
+			),
63
+		];
64
+	}
65 65
 
66 66
 
67
-    /**
68
-     * @param mixed       $source  The source that's passed down the GraphQL queries
69
-     * @param array       $args    The inputArgs on the field
70
-     * @param AppContext  $context The AppContext passed down the GraphQL tree
71
-     * @param ResolveInfo $info    The ResolveInfo passed down the GraphQL tree
72
-     * @return string
73
-     * @throws Exception
74
-     * @throws InvalidArgumentException
75
-     * @throws InvalidDataTypeException
76
-     * @throws InvalidInterfaceException
77
-     * @throws ReflectionException
78
-     * @throws UserError
79
-     * @throws UnexpectedEntityException
80
-     * @since $VID:$
81
-     */
82
-    public function getEventRelationalData($source, array $args, AppContext $context, ResolveInfo $info)
83
-    {
84
-        /**
85
-         * Throw an exception if there's no event ID
86
-         */
87
-        if (empty($args['eventId']) || ! absint($args['eventId'])) {
88
-            throw new UserError(esc_html__(
89
-                'No event ID was provided to get the relational data for',
90
-                'event_espresso'
91
-            ));
92
-        }
67
+	/**
68
+	 * @param mixed       $source  The source that's passed down the GraphQL queries
69
+	 * @param array       $args    The inputArgs on the field
70
+	 * @param AppContext  $context The AppContext passed down the GraphQL tree
71
+	 * @param ResolveInfo $info    The ResolveInfo passed down the GraphQL tree
72
+	 * @return string
73
+	 * @throws Exception
74
+	 * @throws InvalidArgumentException
75
+	 * @throws InvalidDataTypeException
76
+	 * @throws InvalidInterfaceException
77
+	 * @throws ReflectionException
78
+	 * @throws UserError
79
+	 * @throws UnexpectedEntityException
80
+	 * @since $VID:$
81
+	 */
82
+	public function getEventRelationalData($source, array $args, AppContext $context, ResolveInfo $info)
83
+	{
84
+		/**
85
+		 * Throw an exception if there's no event ID
86
+		 */
87
+		if (empty($args['eventId']) || ! absint($args['eventId'])) {
88
+			throw new UserError(esc_html__(
89
+				'No event ID was provided to get the relational data for',
90
+				'event_espresso'
91
+			));
92
+		}
93 93
 
94
-        $eventId = absint($args['eventId']);
94
+		$eventId = absint($args['eventId']);
95 95
 
96
-        return json_encode(AdvancedEditorData::getRelationalData($eventId));
97
-    }
96
+		return json_encode(AdvancedEditorData::getRelationalData($eventId));
97
+	}
98 98
 }
Please login to merge, or discard this patch.
core/EE_Dependency_Map.core.php 1 patch
Indentation   +1217 added lines, -1217 removed lines patch added patch discarded remove patch
@@ -21,1221 +21,1221 @@
 block discarded – undo
21 21
 class EE_Dependency_Map
22 22
 {
23 23
 
24
-    /**
25
-     * This means that the requested class dependency is not present in the dependency map
26
-     */
27
-    const not_registered = 0;
28
-
29
-    /**
30
-     * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
31
-     */
32
-    const load_new_object = 1;
33
-
34
-    /**
35
-     * This instructs class loaders to return a previously instantiated and cached object for the requested class.
36
-     * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
37
-     */
38
-    const load_from_cache = 2;
39
-
40
-    /**
41
-     * When registering a dependency,
42
-     * this indicates to keep any existing dependencies that already exist,
43
-     * and simply discard any new dependencies declared in the incoming data
44
-     */
45
-    const KEEP_EXISTING_DEPENDENCIES = 0;
46
-
47
-    /**
48
-     * When registering a dependency,
49
-     * this indicates to overwrite any existing dependencies that already exist using the incoming data
50
-     */
51
-    const OVERWRITE_DEPENDENCIES = 1;
52
-
53
-
54
-    /**
55
-     * @type EE_Dependency_Map $_instance
56
-     */
57
-    protected static $_instance;
58
-
59
-    /**
60
-     * @var ClassInterfaceCache $class_cache
61
-     */
62
-    private $class_cache;
63
-
64
-    /**
65
-     * @type RequestInterface $request
66
-     */
67
-    protected $request;
68
-
69
-    /**
70
-     * @type LegacyRequestInterface $legacy_request
71
-     */
72
-    protected $legacy_request;
73
-
74
-    /**
75
-     * @type ResponseInterface $response
76
-     */
77
-    protected $response;
78
-
79
-    /**
80
-     * @type LoaderInterface $loader
81
-     */
82
-    protected $loader;
83
-
84
-    /**
85
-     * @type array $_dependency_map
86
-     */
87
-    protected $_dependency_map = array();
88
-
89
-    /**
90
-     * @type array $_class_loaders
91
-     */
92
-    protected $_class_loaders = array();
93
-
94
-
95
-    /**
96
-     * EE_Dependency_Map constructor.
97
-     *
98
-     * @param ClassInterfaceCache $class_cache
99
-     */
100
-    protected function __construct(ClassInterfaceCache $class_cache)
101
-    {
102
-        $this->class_cache = $class_cache;
103
-        do_action('EE_Dependency_Map____construct', $this);
104
-    }
105
-
106
-
107
-    /**
108
-     * @return void
109
-     * @throws EE_Error
110
-     * @throws InvalidAliasException
111
-     */
112
-    public function initialize()
113
-    {
114
-        $this->_register_core_dependencies();
115
-        $this->_register_core_class_loaders();
116
-        $this->_register_core_aliases();
117
-    }
118
-
119
-
120
-    /**
121
-     * @singleton method used to instantiate class object
122
-     * @param ClassInterfaceCache|null $class_cache
123
-     * @return EE_Dependency_Map
124
-     */
125
-    public static function instance(ClassInterfaceCache $class_cache = null)
126
-    {
127
-        // check if class object is instantiated, and instantiated properly
128
-        if (! self::$_instance instanceof EE_Dependency_Map
129
-            && $class_cache instanceof ClassInterfaceCache
130
-        ) {
131
-            self::$_instance = new EE_Dependency_Map($class_cache);
132
-        }
133
-        return self::$_instance;
134
-    }
135
-
136
-
137
-    /**
138
-     * @param RequestInterface $request
139
-     */
140
-    public function setRequest(RequestInterface $request)
141
-    {
142
-        $this->request = $request;
143
-    }
144
-
145
-
146
-    /**
147
-     * @param LegacyRequestInterface $legacy_request
148
-     */
149
-    public function setLegacyRequest(LegacyRequestInterface $legacy_request)
150
-    {
151
-        $this->legacy_request = $legacy_request;
152
-    }
153
-
154
-
155
-    /**
156
-     * @param ResponseInterface $response
157
-     */
158
-    public function setResponse(ResponseInterface $response)
159
-    {
160
-        $this->response = $response;
161
-    }
162
-
163
-
164
-    /**
165
-     * @param LoaderInterface $loader
166
-     */
167
-    public function setLoader(LoaderInterface $loader)
168
-    {
169
-        $this->loader = $loader;
170
-    }
171
-
172
-
173
-    /**
174
-     * @param string $class
175
-     * @param array  $dependencies
176
-     * @param int    $overwrite
177
-     * @return bool
178
-     */
179
-    public static function register_dependencies(
180
-        $class,
181
-        array $dependencies,
182
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
183
-    ) {
184
-        return self::$_instance->registerDependencies($class, $dependencies, $overwrite);
185
-    }
186
-
187
-
188
-    /**
189
-     * Assigns an array of class names and corresponding load sources (new or cached)
190
-     * to the class specified by the first parameter.
191
-     * IMPORTANT !!!
192
-     * The order of elements in the incoming $dependencies array MUST match
193
-     * the order of the constructor parameters for the class in question.
194
-     * This is especially important when overriding any existing dependencies that are registered.
195
-     * the third parameter controls whether any duplicate dependencies are overwritten or not.
196
-     *
197
-     * @param string $class
198
-     * @param array  $dependencies
199
-     * @param int    $overwrite
200
-     * @return bool
201
-     */
202
-    public function registerDependencies(
203
-        $class,
204
-        array $dependencies,
205
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
206
-    ) {
207
-        $class = trim($class, '\\');
208
-        $registered = false;
209
-        if (empty(self::$_instance->_dependency_map[ $class ])) {
210
-            self::$_instance->_dependency_map[ $class ] = array();
211
-        }
212
-        // we need to make sure that any aliases used when registering a dependency
213
-        // get resolved to the correct class name
214
-        foreach ($dependencies as $dependency => $load_source) {
215
-            $alias = self::$_instance->getFqnForAlias($dependency);
216
-            if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
217
-                || ! isset(self::$_instance->_dependency_map[ $class ][ $alias ])
218
-            ) {
219
-                unset($dependencies[ $dependency ]);
220
-                $dependencies[ $alias ] = $load_source;
221
-                $registered = true;
222
-            }
223
-        }
224
-        // now add our two lists of dependencies together.
225
-        // using Union (+=) favours the arrays in precedence from left to right,
226
-        // so $dependencies is NOT overwritten because it is listed first
227
-        // ie: with A = B + C, entries in B take precedence over duplicate entries in C
228
-        // Union is way faster than array_merge() but should be used with caution...
229
-        // especially with numerically indexed arrays
230
-        $dependencies += self::$_instance->_dependency_map[ $class ];
231
-        // now we need to ensure that the resulting dependencies
232
-        // array only has the entries that are required for the class
233
-        // so first count how many dependencies were originally registered for the class
234
-        $dependency_count = count(self::$_instance->_dependency_map[ $class ]);
235
-        // if that count is non-zero (meaning dependencies were already registered)
236
-        self::$_instance->_dependency_map[ $class ] = $dependency_count
237
-            // then truncate the  final array to match that count
238
-            ? array_slice($dependencies, 0, $dependency_count)
239
-            // otherwise just take the incoming array because nothing previously existed
240
-            : $dependencies;
241
-        return $registered;
242
-    }
243
-
244
-
245
-    /**
246
-     * @param string $class_name
247
-     * @param string $loader
248
-     * @return bool
249
-     * @throws DomainException
250
-     */
251
-    public static function register_class_loader($class_name, $loader = 'load_core')
252
-    {
253
-        if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
254
-            throw new DomainException(
255
-                esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
256
-            );
257
-        }
258
-        // check that loader is callable or method starts with "load_" and exists in EE_Registry
259
-        if (! is_callable($loader)
260
-            && (
261
-                strpos($loader, 'load_') !== 0
262
-                || ! method_exists('EE_Registry', $loader)
263
-            )
264
-        ) {
265
-            throw new DomainException(
266
-                sprintf(
267
-                    esc_html__(
268
-                        '"%1$s" is not a valid loader method on EE_Registry.',
269
-                        'event_espresso'
270
-                    ),
271
-                    $loader
272
-                )
273
-            );
274
-        }
275
-        $class_name = self::$_instance->getFqnForAlias($class_name);
276
-        if (! isset(self::$_instance->_class_loaders[ $class_name ])) {
277
-            self::$_instance->_class_loaders[ $class_name ] = $loader;
278
-            return true;
279
-        }
280
-        return false;
281
-    }
282
-
283
-
284
-    /**
285
-     * @return array
286
-     */
287
-    public function dependency_map()
288
-    {
289
-        return $this->_dependency_map;
290
-    }
291
-
292
-
293
-    /**
294
-     * returns TRUE if dependency map contains a listing for the provided class name
295
-     *
296
-     * @param string $class_name
297
-     * @return boolean
298
-     */
299
-    public function has($class_name = '')
300
-    {
301
-        // all legacy models have the same dependencies
302
-        if (strpos($class_name, 'EEM_') === 0) {
303
-            $class_name = 'LEGACY_MODELS';
304
-        }
305
-        return isset($this->_dependency_map[ $class_name ]) ? true : false;
306
-    }
307
-
308
-
309
-    /**
310
-     * returns TRUE if dependency map contains a listing for the provided class name AND dependency
311
-     *
312
-     * @param string $class_name
313
-     * @param string $dependency
314
-     * @return bool
315
-     */
316
-    public function has_dependency_for_class($class_name = '', $dependency = '')
317
-    {
318
-        // all legacy models have the same dependencies
319
-        if (strpos($class_name, 'EEM_') === 0) {
320
-            $class_name = 'LEGACY_MODELS';
321
-        }
322
-        $dependency = $this->getFqnForAlias($dependency, $class_name);
323
-        return isset($this->_dependency_map[ $class_name ][ $dependency ])
324
-            ? true
325
-            : false;
326
-    }
327
-
328
-
329
-    /**
330
-     * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
331
-     *
332
-     * @param string $class_name
333
-     * @param string $dependency
334
-     * @return int
335
-     */
336
-    public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
337
-    {
338
-        // all legacy models have the same dependencies
339
-        if (strpos($class_name, 'EEM_') === 0) {
340
-            $class_name = 'LEGACY_MODELS';
341
-        }
342
-        $dependency = $this->getFqnForAlias($dependency);
343
-        return $this->has_dependency_for_class($class_name, $dependency)
344
-            ? $this->_dependency_map[ $class_name ][ $dependency ]
345
-            : EE_Dependency_Map::not_registered;
346
-    }
347
-
348
-
349
-    /**
350
-     * @param string $class_name
351
-     * @return string | Closure
352
-     */
353
-    public function class_loader($class_name)
354
-    {
355
-        // all legacy models use load_model()
356
-        if (strpos($class_name, 'EEM_') === 0) {
357
-            return 'load_model';
358
-        }
359
-        // EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
360
-        // perform strpos() first to avoid loading regex every time we load a class
361
-        if (strpos($class_name, 'EE_CPT_') === 0
362
-            && preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
363
-        ) {
364
-            return 'load_core';
365
-        }
366
-        $class_name = $this->getFqnForAlias($class_name);
367
-        return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
368
-    }
369
-
370
-
371
-    /**
372
-     * @return array
373
-     */
374
-    public function class_loaders()
375
-    {
376
-        return $this->_class_loaders;
377
-    }
378
-
379
-
380
-    /**
381
-     * adds an alias for a classname
382
-     *
383
-     * @param string $fqcn      the class name that should be used (concrete class to replace interface)
384
-     * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
385
-     * @param string $for_class the class that has the dependency (is type hinting for the interface)
386
-     * @throws InvalidAliasException
387
-     */
388
-    public function add_alias($fqcn, $alias, $for_class = '')
389
-    {
390
-        $this->class_cache->addAlias($fqcn, $alias, $for_class);
391
-    }
392
-
393
-
394
-    /**
395
-     * Returns TRUE if the provided fully qualified name IS an alias
396
-     * WHY?
397
-     * Because if a class is type hinting for a concretion,
398
-     * then why would we need to find another class to supply it?
399
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
400
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
401
-     * Don't go looking for some substitute.
402
-     * Whereas if a class is type hinting for an interface...
403
-     * then we need to find an actual class to use.
404
-     * So the interface IS the alias for some other FQN,
405
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
406
-     * represents some other class.
407
-     *
408
-     * @param string $fqn
409
-     * @param string $for_class
410
-     * @return bool
411
-     */
412
-    public function isAlias($fqn = '', $for_class = '')
413
-    {
414
-        return $this->class_cache->isAlias($fqn, $for_class);
415
-    }
416
-
417
-
418
-    /**
419
-     * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
420
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
421
-     *  for example:
422
-     *      if the following two entries were added to the _aliases array:
423
-     *          array(
424
-     *              'interface_alias'           => 'some\namespace\interface'
425
-     *              'some\namespace\interface'  => 'some\namespace\classname'
426
-     *          )
427
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
428
-     *      to load an instance of 'some\namespace\classname'
429
-     *
430
-     * @param string $alias
431
-     * @param string $for_class
432
-     * @return string
433
-     */
434
-    public function getFqnForAlias($alias = '', $for_class = '')
435
-    {
436
-        return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
437
-    }
438
-
439
-
440
-    /**
441
-     * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
442
-     * if one exists, or whether a new object should be generated every time the requested class is loaded.
443
-     * This is done by using the following class constants:
444
-     *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
445
-     *        EE_Dependency_Map::load_new_object - generates a new object every time
446
-     */
447
-    protected function _register_core_dependencies()
448
-    {
449
-        $this->_dependency_map = array(
450
-            'EE_Request_Handler'                                                                                          => array(
451
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
452
-            ),
453
-            'EE_System'                                                                                                   => array(
454
-                'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
455
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
456
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
457
-                'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
458
-            ),
459
-            'EE_Session'                                                                                                  => array(
460
-                'EventEspresso\core\services\cache\TransientCacheStorage'  => EE_Dependency_Map::load_from_cache,
461
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
462
-                'EventEspresso\core\services\request\Request'              => EE_Dependency_Map::load_from_cache,
463
-                'EventEspresso\core\services\session\SessionStartHandler'  => EE_Dependency_Map::load_from_cache,
464
-                'EE_Encryption'                                            => EE_Dependency_Map::load_from_cache,
465
-            ),
466
-            'EE_Cart'                                                                                                     => array(
467
-                'EE_Session' => EE_Dependency_Map::load_from_cache,
468
-            ),
469
-            'EE_Front_Controller'                                                                                         => array(
470
-                'EE_Registry'              => EE_Dependency_Map::load_from_cache,
471
-                'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
472
-                'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
473
-            ),
474
-            'EE_Messenger_Collection_Loader'                                                                              => array(
475
-                'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
476
-            ),
477
-            'EE_Message_Type_Collection_Loader'                                                                           => array(
478
-                'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
479
-            ),
480
-            'EE_Message_Resource_Manager'                                                                                 => array(
481
-                'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
482
-                'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
483
-                'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
484
-            ),
485
-            'EE_Message_Factory'                                                                                          => array(
486
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
487
-            ),
488
-            'EE_messages'                                                                                                 => array(
489
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
490
-            ),
491
-            'EE_Messages_Generator'                                                                                       => array(
492
-                'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
493
-                'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
494
-                'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
495
-                'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
496
-            ),
497
-            'EE_Messages_Processor'                                                                                       => array(
498
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
499
-            ),
500
-            'EE_Messages_Queue'                                                                                           => array(
501
-                'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
502
-            ),
503
-            'EE_Messages_Template_Defaults'                                                                               => array(
504
-                'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
505
-                'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
506
-            ),
507
-            'EE_Message_To_Generate_From_Request'                                                                         => array(
508
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
509
-                'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
510
-            ),
511
-            'EventEspresso\core\services\commands\CommandBus'                                                             => array(
512
-                'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
513
-            ),
514
-            'EventEspresso\services\commands\CommandHandler'                                                              => array(
515
-                'EE_Registry'         => EE_Dependency_Map::load_from_cache,
516
-                'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
517
-            ),
518
-            'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => array(
519
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
520
-            ),
521
-            'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => array(
522
-                'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
523
-                'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
524
-            ),
525
-            'EventEspresso\core\services\commands\CommandFactory'                                                         => array(
526
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
527
-            ),
528
-            'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => array(
529
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
530
-            ),
531
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => array(
532
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
533
-            ),
534
-            'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => array(
535
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
536
-            ),
537
-            'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => array(
538
-                'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
539
-            ),
540
-            'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => array(
541
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
542
-            ),
543
-            'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => array(
544
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
545
-            ),
546
-            'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => array(
547
-                'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
548
-            ),
549
-            'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => array(
550
-                'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
551
-            ),
552
-            'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => array(
553
-                'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
554
-            ),
555
-            'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => array(
556
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
557
-            ),
558
-            'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => array(
559
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
560
-            ),
561
-            'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => array(
562
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
563
-            ),
564
-            'EventEspresso\core\services\database\TableManager'                                                           => array(
565
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
566
-            ),
567
-            'EE_Data_Migration_Class_Base'                                                                                => array(
568
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
569
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
570
-            ),
571
-            'EE_DMS_Core_4_1_0'                                                                                           => array(
572
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
573
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
574
-            ),
575
-            'EE_DMS_Core_4_2_0'                                                                                           => array(
576
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
577
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
578
-            ),
579
-            'EE_DMS_Core_4_3_0'                                                                                           => array(
580
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
581
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
582
-            ),
583
-            'EE_DMS_Core_4_4_0'                                                                                           => array(
584
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
585
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
586
-            ),
587
-            'EE_DMS_Core_4_5_0'                                                                                           => array(
588
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
589
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
590
-            ),
591
-            'EE_DMS_Core_4_6_0'                                                                                           => array(
592
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
593
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
594
-            ),
595
-            'EE_DMS_Core_4_7_0'                                                                                           => array(
596
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
597
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
598
-            ),
599
-            'EE_DMS_Core_4_8_0'                                                                                           => array(
600
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
601
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
602
-            ),
603
-            'EE_DMS_Core_4_9_0' => array(
604
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
605
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
606
-            ),
607
-            'EE_DMS_Core_4_10_0' => array(
608
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
609
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
610
-                'EE_DMS_Core_4_9_0'                                  => EE_Dependency_Map::load_from_cache,
611
-            ),
612
-            'EventEspresso\core\services\assets\I18nRegistry'                                                             => array(
613
-                array(),
614
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
615
-            ),
616
-            'EventEspresso\core\services\assets\Registry'                                                                 => array(
617
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
618
-                'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
619
-            ),
620
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled'                                             => array(
621
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
622
-            ),
623
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout'                                              => array(
624
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
625
-            ),
626
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees'                                        => array(
627
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
628
-            ),
629
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEvents'                                                => array(
630
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
631
-            ),
632
-            'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou'                                              => array(
633
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
634
-            ),
635
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector'                                        => array(
636
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
637
-            ),
638
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage'                                               => array(
639
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
640
-            ),
641
-            'EventEspresso\core\services\cache\BasicCacheManager'                                                         => array(
642
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
643
-            ),
644
-            'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => array(
645
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
646
-            ),
647
-            'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => array(
648
-                'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
649
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
650
-            ),
651
-            'EventEspresso\core\domain\values\EmailAddress'                                                               => array(
652
-                null,
653
-                'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
654
-            ),
655
-            'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => array(
656
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
657
-            ),
658
-            'LEGACY_MODELS'                                                                                               => array(
659
-                null,
660
-                'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
661
-            ),
662
-            'EE_Module_Request_Router'                                                                                    => array(
663
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
664
-            ),
665
-            'EE_Registration_Processor'                                                                                   => array(
666
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
667
-            ),
668
-            'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => array(
669
-                null,
670
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
671
-                'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
672
-            ),
673
-            'EventEspresso\core\services\licensing\LicenseService'                                                        => array(
674
-                'EventEspresso\core\domain\services\pue\Stats'  => EE_Dependency_Map::load_from_cache,
675
-                'EventEspresso\core\domain\services\pue\Config' => EE_Dependency_Map::load_from_cache,
676
-            ),
677
-            'EE_Admin_Transactions_List_Table'                                                                            => array(
678
-                null,
679
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
680
-            ),
681
-            'EventEspresso\core\domain\services\pue\Stats'                                                                => array(
682
-                'EventEspresso\core\domain\services\pue\Config'        => EE_Dependency_Map::load_from_cache,
683
-                'EE_Maintenance_Mode'                                  => EE_Dependency_Map::load_from_cache,
684
-                'EventEspresso\core\domain\services\pue\StatsGatherer' => EE_Dependency_Map::load_from_cache,
685
-            ),
686
-            'EventEspresso\core\domain\services\pue\Config'                                                               => array(
687
-                'EE_Network_Config' => EE_Dependency_Map::load_from_cache,
688
-                'EE_Config'         => EE_Dependency_Map::load_from_cache,
689
-            ),
690
-            'EventEspresso\core\domain\services\pue\StatsGatherer'                                                        => array(
691
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
692
-                'EEM_Event'          => EE_Dependency_Map::load_from_cache,
693
-                'EEM_Datetime'       => EE_Dependency_Map::load_from_cache,
694
-                'EEM_Ticket'         => EE_Dependency_Map::load_from_cache,
695
-                'EEM_Registration'   => EE_Dependency_Map::load_from_cache,
696
-                'EEM_Transaction'    => EE_Dependency_Map::load_from_cache,
697
-                'EE_Config'          => EE_Dependency_Map::load_from_cache,
698
-            ),
699
-            'EventEspresso\core\domain\services\admin\ExitModal'                                                          => array(
700
-                'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
701
-            ),
702
-            'EventEspresso\core\domain\services\admin\PluginUpsells'                                                      => array(
703
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
704
-            ),
705
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => array(
706
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
707
-                'EE_Session'             => EE_Dependency_Map::load_from_cache,
708
-            ),
709
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings'                                => array(
710
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
711
-            ),
712
-            'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => array(
713
-                'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
714
-                'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
715
-                'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
716
-                'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
717
-                'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
718
-            ),
719
-            'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => array(
720
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
721
-            ),
722
-            'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => array(
723
-                'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
724
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
725
-            ),
726
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => array(
727
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
728
-            ),
729
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => array(
730
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
731
-            ),
732
-            'EE_CPT_Strategy'                                                                                             => array(
733
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
734
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
735
-            ),
736
-            'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => array(
737
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
738
-            ),
739
-            'EventEspresso\core\domain\services\assets\CoreAssetManager'                                                  => array(
740
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
741
-                'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
742
-                'EE_Template_Config'                                 => EE_Dependency_Map::load_from_cache,
743
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
744
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
745
-            ),
746
-            'EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy' => array(
747
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
748
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache
749
-            ),
750
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendee' => array(
751
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
752
-            ),
753
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendeeBillingData' => array(
754
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
755
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache
756
-            ),
757
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportCheckins' => array(
758
-                'EEM_Checkin' => EE_Dependency_Map::load_from_cache,
759
-            ),
760
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportRegistration' => array(
761
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache,
762
-            ),
763
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportTransaction' => array(
764
-                'EEM_Transaction' => EE_Dependency_Map::load_from_cache,
765
-            ),
766
-            'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAttendeeData' => array(
767
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
768
-            ),
769
-            'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAnswers' => array(
770
-                'EEM_Answer' => EE_Dependency_Map::load_from_cache,
771
-                'EEM_Question' => EE_Dependency_Map::load_from_cache,
772
-            ),
773
-            'EventEspresso\core\CPTs\CptQueryModifier' => array(
774
-                null,
775
-                null,
776
-                null,
777
-                'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
778
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
779
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
780
-            ),
781
-            'EventEspresso\core\domain\services\admin\privacy\forms\PrivacySettingsFormHandler' => array(
782
-                'EE_Registry' => EE_Dependency_Map::load_from_cache,
783
-                'EE_Config' => EE_Dependency_Map::load_from_cache
784
-            ),
785
-            'EventEspresso\core\services\editor\BlockRegistrationManager'                                                 => array(
786
-                'EventEspresso\core\services\assets\BlockAssetManagerCollection' => EE_Dependency_Map::load_from_cache,
787
-                'EventEspresso\core\domain\entities\editor\BlockCollection'      => EE_Dependency_Map::load_from_cache,
788
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => EE_Dependency_Map::load_from_cache,
789
-                'EventEspresso\core\services\request\Request'                    => EE_Dependency_Map::load_from_cache,
790
-            ),
791
-            'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => array(
792
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
793
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
794
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
795
-            ),
796
-            'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer' => array(
797
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
798
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
799
-            ),
800
-            'EventEspresso\core\domain\entities\editor\blocks\EventAttendees' => array(
801
-                'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => self::load_from_cache,
802
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
803
-                'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer' => self::load_from_cache,
804
-            ),
805
-            'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => array(
806
-                'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache,
807
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
808
-                'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache,
809
-            ),
810
-            'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => array(
811
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
812
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
813
-            ),
814
-            'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => array(
815
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
816
-                'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => EE_Dependency_Map::load_from_cache,
817
-            ),
818
-            'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => array(
819
-                'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache
820
-            ),
821
-            'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => array(
822
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
823
-            ),
824
-            'EventEspresso\core\libraries\rest_api\controllers\model\Read' => array(
825
-                'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache
826
-            ),
827
-            'EventEspresso\core\libraries\rest_api\calculations\Datetime' => array(
828
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
829
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
830
-            ),
831
-            'EventEspresso\core\libraries\rest_api\calculations\Event' => array(
832
-                'EEM_Event' => EE_Dependency_Map::load_from_cache,
833
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
834
-            ),
835
-            'EventEspresso\core\libraries\rest_api\calculations\Registration' => array(
836
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
837
-            ),
838
-            'EventEspresso\core\services\session\SessionStartHandler' => array(
839
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
840
-            ),
841
-            'EE_URL_Validation_Strategy' => array(
842
-                null,
843
-                null,
844
-                'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache
845
-            ),
846
-            'EventEspresso\admin_pages\general_settings\OrganizationSettings' => array(
847
-                'EE_Registry'                                             => EE_Dependency_Map::load_from_cache,
848
-                'EE_Organization_Config'                                  => EE_Dependency_Map::load_from_cache,
849
-                'EE_Core_Config'                                          => EE_Dependency_Map::load_from_cache,
850
-                'EE_Network_Core_Config'                                  => EE_Dependency_Map::load_from_cache,
851
-                'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache,
852
-            ),
853
-            'EventEspresso\core\services\address\CountrySubRegionDao' => array(
854
-                'EEM_State'                                            => EE_Dependency_Map::load_from_cache,
855
-                'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache
856
-            ),
857
-            'EventEspresso\core\domain\services\admin\ajax\WordpressHeartbeat' => array(
858
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
859
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
860
-            ),
861
-            'EventEspresso\core\domain\services\admin\ajax\EventEditorHeartbeat' => array(
862
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
863
-                'EE_Environment_Config'            => EE_Dependency_Map::load_from_cache,
864
-            ),
865
-            'EventEspresso\core\services\request\files\FilesDataHandler' => array(
866
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
867
-            ),
868
-            'EventEspressoBatchRequest\BatchRequestProcessor'                              => [
869
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
870
-            ],
871
-            'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder' => [
872
-                null,
873
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
874
-                'EEM_Registration'  => EE_Dependency_Map::load_from_cache,
875
-            ],
876
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader' => [
877
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
878
-                'EEM_Attendee'  => EE_Dependency_Map::load_from_cache,
879
-            ],
880
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader' => [
881
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
882
-                'EEM_Datetime'  => EE_Dependency_Map::load_from_cache,
883
-            ],
884
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader' => [
885
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
886
-                'EEM_Event'  => EE_Dependency_Map::load_from_cache,
887
-            ],
888
-            'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader' => [
889
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
890
-                'EEM_Ticket'  => EE_Dependency_Map::load_from_cache,
891
-            ],
892
-            'EventEspresso\core\domain\services\converters\RestApiSpoofer' => [
893
-                'WP_REST_Server' => EE_Dependency_Map::load_from_cache,
894
-                'EED_Core_Rest_Api' => EE_Dependency_Map::load_from_cache,
895
-                'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache,
896
-                null
897
-            ],
898
-            'EventEspresso\core\domain\services\admin\events\default_settings\AdvancedEditorAdminFormSection'  => [
899
-                'EE_Admin_Config' => EE_Dependency_Map::load_from_cache
900
-            ],
901
-            'EventEspresso\core\domain\services\admin\events\editor\AdvancedEditorData'  => [
902
-                'EE_Event'        => EE_Dependency_Map::not_registered,
903
-                'EE_Admin_Config' => EE_Dependency_Map::load_from_cache,
904
-            ],
905
-            'EventEspresso\core\services\graphql\GraphQLManager' => [
906
-                'EventEspresso\core\services\graphql\TypesManager'  => EE_Dependency_Map::load_from_cache,
907
-                'EventEspresso\core\services\graphql\InputsManager'  => EE_Dependency_Map::load_from_cache,
908
-                'EventEspresso\core\services\graphql\EnumsManager'  => EE_Dependency_Map::load_from_cache,
909
-                'EventEspresso\core\services\graphql\ConnectionsManager'  => EE_Dependency_Map::load_from_cache,
910
-            ],
911
-            'EventEspresso\core\services\graphql\TypesManager' => [
912
-                'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache,
913
-            ],
914
-            'EventEspresso\core\services\graphql\InputsManager' => [
915
-                'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache,
916
-            ],
917
-            'EventEspresso\core\services\graphql\EnumsManager' => [
918
-                'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache,
919
-            ],
920
-            'EventEspresso\core\services\graphql\ConnectionsManager' => [
921
-                'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache,
922
-            ],
923
-            'EventEspresso\core\domain\services\graphql\types\Datetime' => [
924
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
925
-            ],
926
-            'EventEspresso\core\domain\services\graphql\types\Event' => [
927
-                'EEM_Event' => EE_Dependency_Map::load_from_cache,
928
-            ],
929
-            'EventEspresso\core\domain\services\graphql\types\Ticket' => [
930
-                'EEM_Ticket' => EE_Dependency_Map::load_from_cache,
931
-            ],
932
-            'EventEspresso\core\domain\services\graphql\types\Price' => [
933
-                'EEM_Price' => EE_Dependency_Map::load_from_cache,
934
-            ],
935
-            'EventEspresso\core\domain\services\graphql\types\PriceType' => [
936
-                'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
937
-            ],
938
-            'EventEspresso\core\domain\services\graphql\types\Venue' => [
939
-                'EEM_Venue' => EE_Dependency_Map::load_from_cache,
940
-            ],
941
-            'EventEspresso\core\domain\services\graphql\types\State' => [
942
-                'EEM_State' => EE_Dependency_Map::load_from_cache,
943
-            ],
944
-            'EventEspresso\core\domain\services\graphql\types\Country' => [
945
-                'EEM_Country' => EE_Dependency_Map::load_from_cache,
946
-            ],
947
-            'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection' => [
948
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
949
-            ],
950
-            'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection' => [
951
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
952
-            ],
953
-            'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection' => [
954
-                'EEM_Ticket' => EE_Dependency_Map::load_from_cache,
955
-            ],
956
-            'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection' => [
957
-                'EEM_Ticket' => EE_Dependency_Map::load_from_cache,
958
-            ],
959
-            'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection' => [
960
-                'EEM_Price' => EE_Dependency_Map::load_from_cache,
961
-            ],
962
-            'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection' => [
963
-                'EEM_Price' => EE_Dependency_Map::load_from_cache,
964
-            ],
965
-            'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection' => [
966
-                'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
967
-            ],
968
-            'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection' => [
969
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
970
-            ],
971
-            'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection' => [
972
-                'EEM_Venue' => EE_Dependency_Map::load_from_cache,
973
-            ],
974
-        );
975
-    }
976
-
977
-
978
-    /**
979
-     * Registers how core classes are loaded.
980
-     * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
981
-     *        'EE_Request_Handler' => 'load_core'
982
-     *        'EE_Messages_Queue'  => 'load_lib'
983
-     *        'EEH_Debug_Tools'    => 'load_helper'
984
-     * or, if greater control is required, by providing a custom closure. For example:
985
-     *        'Some_Class' => function () {
986
-     *            return new Some_Class();
987
-     *        },
988
-     * This is required for instantiating dependencies
989
-     * where an interface has been type hinted in a class constructor. For example:
990
-     *        'Required_Interface' => function () {
991
-     *            return new A_Class_That_Implements_Required_Interface();
992
-     *        },
993
-     */
994
-    protected function _register_core_class_loaders()
995
-    {
996
-        $this->_class_loaders = array(
997
-            // load_core
998
-            'EE_Dependency_Map'                            => function () {
999
-                return $this;
1000
-            },
1001
-            'EE_Capabilities'                              => 'load_core',
1002
-            'EE_Encryption'                                => 'load_core',
1003
-            'EE_Front_Controller'                          => 'load_core',
1004
-            'EE_Module_Request_Router'                     => 'load_core',
1005
-            'EE_Registry'                                  => 'load_core',
1006
-            'EE_Request'                                   => function () {
1007
-                return $this->legacy_request;
1008
-            },
1009
-            'EventEspresso\core\services\request\Request'  => function () {
1010
-                return $this->request;
1011
-            },
1012
-            'EventEspresso\core\services\request\Response' => function () {
1013
-                return $this->response;
1014
-            },
1015
-            'EE_Base'                                      => 'load_core',
1016
-            'EE_Request_Handler'                           => 'load_core',
1017
-            'EE_Session'                                   => 'load_core',
1018
-            'EE_Cron_Tasks'                                => 'load_core',
1019
-            'EE_System'                                    => 'load_core',
1020
-            'EE_Maintenance_Mode'                          => 'load_core',
1021
-            'EE_Register_CPTs'                             => 'load_core',
1022
-            'EE_Admin'                                     => 'load_core',
1023
-            'EE_CPT_Strategy'                              => 'load_core',
1024
-            // load_class
1025
-            'EE_Registration_Processor'                    => 'load_class',
1026
-            // load_lib
1027
-            'EE_Message_Resource_Manager'                  => 'load_lib',
1028
-            'EE_Message_Type_Collection'                   => 'load_lib',
1029
-            'EE_Message_Type_Collection_Loader'            => 'load_lib',
1030
-            'EE_Messenger_Collection'                      => 'load_lib',
1031
-            'EE_Messenger_Collection_Loader'               => 'load_lib',
1032
-            'EE_Messages_Processor'                        => 'load_lib',
1033
-            'EE_Message_Repository'                        => 'load_lib',
1034
-            'EE_Messages_Queue'                            => 'load_lib',
1035
-            'EE_Messages_Data_Handler_Collection'          => 'load_lib',
1036
-            'EE_Message_Template_Group_Collection'         => 'load_lib',
1037
-            'EE_Payment_Method_Manager'                    => 'load_lib',
1038
-            'EE_DMS_Core_4_1_0'                            => 'load_dms',
1039
-            'EE_DMS_Core_4_2_0'                            => 'load_dms',
1040
-            'EE_DMS_Core_4_3_0'                            => 'load_dms',
1041
-            'EE_DMS_Core_4_5_0'                            => 'load_dms',
1042
-            'EE_DMS_Core_4_6_0'                            => 'load_dms',
1043
-            'EE_DMS_Core_4_7_0'                            => 'load_dms',
1044
-            'EE_DMS_Core_4_8_0'                            => 'load_dms',
1045
-            'EE_DMS_Core_4_9_0'                            => 'load_dms',
1046
-            'EE_DMS_Core_4_10_0'                            => 'load_dms',
1047
-            'EE_Messages_Generator'                        => static function () {
1048
-                return EE_Registry::instance()->load_lib(
1049
-                    'Messages_Generator',
1050
-                    array(),
1051
-                    false,
1052
-                    false
1053
-                );
1054
-            },
1055
-            'EE_Messages_Template_Defaults'                => static function ($arguments = array()) {
1056
-                return EE_Registry::instance()->load_lib(
1057
-                    'Messages_Template_Defaults',
1058
-                    $arguments,
1059
-                    false,
1060
-                    false
1061
-                );
1062
-            },
1063
-            // load_helper
1064
-            'EEH_Parse_Shortcodes'                         => static function () {
1065
-                if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
1066
-                    return new EEH_Parse_Shortcodes();
1067
-                }
1068
-                return null;
1069
-            },
1070
-            'EE_Template_Config'                           => static function () {
1071
-                return EE_Config::instance()->template_settings;
1072
-            },
1073
-            'EE_Currency_Config'                           => static function () {
1074
-                return EE_Config::instance()->currency;
1075
-            },
1076
-            'EE_Registration_Config'                       => static function () {
1077
-                return EE_Config::instance()->registration;
1078
-            },
1079
-            'EE_Core_Config'                               => static function () {
1080
-                return EE_Config::instance()->core;
1081
-            },
1082
-            'EventEspresso\core\services\loaders\Loader'   => static function () {
1083
-                return LoaderFactory::getLoader();
1084
-            },
1085
-            'EE_Network_Config'                            => static function () {
1086
-                return EE_Network_Config::instance();
1087
-            },
1088
-            'EE_Config'                                    => static function () {
1089
-                return EE_Config::instance();
1090
-            },
1091
-            'EventEspresso\core\domain\Domain'             => static function () {
1092
-                return DomainFactory::getEventEspressoCoreDomain();
1093
-            },
1094
-            'EE_Admin_Config'                              => static function () {
1095
-                return EE_Config::instance()->admin;
1096
-            },
1097
-            'EE_Organization_Config'                       => static function () {
1098
-                return EE_Config::instance()->organization;
1099
-            },
1100
-            'EE_Network_Core_Config'                       => static function () {
1101
-                return EE_Network_Config::instance()->core;
1102
-            },
1103
-            'EE_Environment_Config'                        => static function () {
1104
-                return EE_Config::instance()->environment;
1105
-            },
1106
-            'EED_Core_Rest_Api'                            => static function () {
1107
-                return EED_Core_Rest_Api::instance();
1108
-            },
1109
-            'WP_REST_Server'                            => static function () {
1110
-                return rest_get_server();
1111
-            },
1112
-        );
1113
-    }
1114
-
1115
-
1116
-    /**
1117
-     * can be used for supplying alternate names for classes,
1118
-     * or for connecting interface names to instantiable classes
1119
-     *
1120
-     * @throws InvalidAliasException
1121
-     */
1122
-    protected function _register_core_aliases()
1123
-    {
1124
-        $aliases = array(
1125
-            'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
1126
-            'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
1127
-            'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
1128
-            'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
1129
-            'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
1130
-            'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
1131
-            'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
1132
-            'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
1133
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
1134
-            'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
1135
-            'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
1136
-            'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
1137
-            'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
1138
-            'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
1139
-            'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
1140
-            'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
1141
-            'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
1142
-            'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
1143
-            'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
1144
-            'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
1145
-            'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
1146
-            'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
1147
-            'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
1148
-            'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
1149
-            'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
1150
-            'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
1151
-            'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
1152
-            'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
1153
-            'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
1154
-            'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
1155
-            'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
1156
-            'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
1157
-            'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
1158
-            'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
1159
-            'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
1160
-            'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
1161
-            'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
1162
-            'Registration_Processor'                                                       => 'EE_Registration_Processor',
1163
-        );
1164
-        foreach ($aliases as $alias => $fqn) {
1165
-            if (is_array($fqn)) {
1166
-                foreach ($fqn as $class => $for_class) {
1167
-                    $this->class_cache->addAlias($class, $alias, $for_class);
1168
-                }
1169
-                continue;
1170
-            }
1171
-            $this->class_cache->addAlias($fqn, $alias);
1172
-        }
1173
-        if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
1174
-            $this->class_cache->addAlias(
1175
-                'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
1176
-                'EventEspresso\core\services\notices\NoticeConverterInterface'
1177
-            );
1178
-        }
1179
-    }
1180
-
1181
-
1182
-    /**
1183
-     * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
1184
-     * request Primarily used by unit tests.
1185
-     */
1186
-    public function reset()
1187
-    {
1188
-        $this->_register_core_class_loaders();
1189
-        $this->_register_core_dependencies();
1190
-    }
1191
-
1192
-
1193
-    /**
1194
-     * PLZ NOTE: a better name for this method would be is_alias()
1195
-     * because it returns TRUE if the provided fully qualified name IS an alias
1196
-     * WHY?
1197
-     * Because if a class is type hinting for a concretion,
1198
-     * then why would we need to find another class to supply it?
1199
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
1200
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
1201
-     * Don't go looking for some substitute.
1202
-     * Whereas if a class is type hinting for an interface...
1203
-     * then we need to find an actual class to use.
1204
-     * So the interface IS the alias for some other FQN,
1205
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
1206
-     * represents some other class.
1207
-     *
1208
-     * @deprecated 4.9.62.p
1209
-     * @param string $fqn
1210
-     * @param string $for_class
1211
-     * @return bool
1212
-     */
1213
-    public function has_alias($fqn = '', $for_class = '')
1214
-    {
1215
-        return $this->isAlias($fqn, $for_class);
1216
-    }
1217
-
1218
-
1219
-    /**
1220
-     * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
1221
-     * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
1222
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
1223
-     *  for example:
1224
-     *      if the following two entries were added to the _aliases array:
1225
-     *          array(
1226
-     *              'interface_alias'           => 'some\namespace\interface'
1227
-     *              'some\namespace\interface'  => 'some\namespace\classname'
1228
-     *          )
1229
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1230
-     *      to load an instance of 'some\namespace\classname'
1231
-     *
1232
-     * @deprecated 4.9.62.p
1233
-     * @param string $alias
1234
-     * @param string $for_class
1235
-     * @return string
1236
-     */
1237
-    public function get_alias($alias = '', $for_class = '')
1238
-    {
1239
-        return $this->getFqnForAlias($alias, $for_class);
1240
-    }
24
+	/**
25
+	 * This means that the requested class dependency is not present in the dependency map
26
+	 */
27
+	const not_registered = 0;
28
+
29
+	/**
30
+	 * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
31
+	 */
32
+	const load_new_object = 1;
33
+
34
+	/**
35
+	 * This instructs class loaders to return a previously instantiated and cached object for the requested class.
36
+	 * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
37
+	 */
38
+	const load_from_cache = 2;
39
+
40
+	/**
41
+	 * When registering a dependency,
42
+	 * this indicates to keep any existing dependencies that already exist,
43
+	 * and simply discard any new dependencies declared in the incoming data
44
+	 */
45
+	const KEEP_EXISTING_DEPENDENCIES = 0;
46
+
47
+	/**
48
+	 * When registering a dependency,
49
+	 * this indicates to overwrite any existing dependencies that already exist using the incoming data
50
+	 */
51
+	const OVERWRITE_DEPENDENCIES = 1;
52
+
53
+
54
+	/**
55
+	 * @type EE_Dependency_Map $_instance
56
+	 */
57
+	protected static $_instance;
58
+
59
+	/**
60
+	 * @var ClassInterfaceCache $class_cache
61
+	 */
62
+	private $class_cache;
63
+
64
+	/**
65
+	 * @type RequestInterface $request
66
+	 */
67
+	protected $request;
68
+
69
+	/**
70
+	 * @type LegacyRequestInterface $legacy_request
71
+	 */
72
+	protected $legacy_request;
73
+
74
+	/**
75
+	 * @type ResponseInterface $response
76
+	 */
77
+	protected $response;
78
+
79
+	/**
80
+	 * @type LoaderInterface $loader
81
+	 */
82
+	protected $loader;
83
+
84
+	/**
85
+	 * @type array $_dependency_map
86
+	 */
87
+	protected $_dependency_map = array();
88
+
89
+	/**
90
+	 * @type array $_class_loaders
91
+	 */
92
+	protected $_class_loaders = array();
93
+
94
+
95
+	/**
96
+	 * EE_Dependency_Map constructor.
97
+	 *
98
+	 * @param ClassInterfaceCache $class_cache
99
+	 */
100
+	protected function __construct(ClassInterfaceCache $class_cache)
101
+	{
102
+		$this->class_cache = $class_cache;
103
+		do_action('EE_Dependency_Map____construct', $this);
104
+	}
105
+
106
+
107
+	/**
108
+	 * @return void
109
+	 * @throws EE_Error
110
+	 * @throws InvalidAliasException
111
+	 */
112
+	public function initialize()
113
+	{
114
+		$this->_register_core_dependencies();
115
+		$this->_register_core_class_loaders();
116
+		$this->_register_core_aliases();
117
+	}
118
+
119
+
120
+	/**
121
+	 * @singleton method used to instantiate class object
122
+	 * @param ClassInterfaceCache|null $class_cache
123
+	 * @return EE_Dependency_Map
124
+	 */
125
+	public static function instance(ClassInterfaceCache $class_cache = null)
126
+	{
127
+		// check if class object is instantiated, and instantiated properly
128
+		if (! self::$_instance instanceof EE_Dependency_Map
129
+			&& $class_cache instanceof ClassInterfaceCache
130
+		) {
131
+			self::$_instance = new EE_Dependency_Map($class_cache);
132
+		}
133
+		return self::$_instance;
134
+	}
135
+
136
+
137
+	/**
138
+	 * @param RequestInterface $request
139
+	 */
140
+	public function setRequest(RequestInterface $request)
141
+	{
142
+		$this->request = $request;
143
+	}
144
+
145
+
146
+	/**
147
+	 * @param LegacyRequestInterface $legacy_request
148
+	 */
149
+	public function setLegacyRequest(LegacyRequestInterface $legacy_request)
150
+	{
151
+		$this->legacy_request = $legacy_request;
152
+	}
153
+
154
+
155
+	/**
156
+	 * @param ResponseInterface $response
157
+	 */
158
+	public function setResponse(ResponseInterface $response)
159
+	{
160
+		$this->response = $response;
161
+	}
162
+
163
+
164
+	/**
165
+	 * @param LoaderInterface $loader
166
+	 */
167
+	public function setLoader(LoaderInterface $loader)
168
+	{
169
+		$this->loader = $loader;
170
+	}
171
+
172
+
173
+	/**
174
+	 * @param string $class
175
+	 * @param array  $dependencies
176
+	 * @param int    $overwrite
177
+	 * @return bool
178
+	 */
179
+	public static function register_dependencies(
180
+		$class,
181
+		array $dependencies,
182
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
183
+	) {
184
+		return self::$_instance->registerDependencies($class, $dependencies, $overwrite);
185
+	}
186
+
187
+
188
+	/**
189
+	 * Assigns an array of class names and corresponding load sources (new or cached)
190
+	 * to the class specified by the first parameter.
191
+	 * IMPORTANT !!!
192
+	 * The order of elements in the incoming $dependencies array MUST match
193
+	 * the order of the constructor parameters for the class in question.
194
+	 * This is especially important when overriding any existing dependencies that are registered.
195
+	 * the third parameter controls whether any duplicate dependencies are overwritten or not.
196
+	 *
197
+	 * @param string $class
198
+	 * @param array  $dependencies
199
+	 * @param int    $overwrite
200
+	 * @return bool
201
+	 */
202
+	public function registerDependencies(
203
+		$class,
204
+		array $dependencies,
205
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
206
+	) {
207
+		$class = trim($class, '\\');
208
+		$registered = false;
209
+		if (empty(self::$_instance->_dependency_map[ $class ])) {
210
+			self::$_instance->_dependency_map[ $class ] = array();
211
+		}
212
+		// we need to make sure that any aliases used when registering a dependency
213
+		// get resolved to the correct class name
214
+		foreach ($dependencies as $dependency => $load_source) {
215
+			$alias = self::$_instance->getFqnForAlias($dependency);
216
+			if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
217
+				|| ! isset(self::$_instance->_dependency_map[ $class ][ $alias ])
218
+			) {
219
+				unset($dependencies[ $dependency ]);
220
+				$dependencies[ $alias ] = $load_source;
221
+				$registered = true;
222
+			}
223
+		}
224
+		// now add our two lists of dependencies together.
225
+		// using Union (+=) favours the arrays in precedence from left to right,
226
+		// so $dependencies is NOT overwritten because it is listed first
227
+		// ie: with A = B + C, entries in B take precedence over duplicate entries in C
228
+		// Union is way faster than array_merge() but should be used with caution...
229
+		// especially with numerically indexed arrays
230
+		$dependencies += self::$_instance->_dependency_map[ $class ];
231
+		// now we need to ensure that the resulting dependencies
232
+		// array only has the entries that are required for the class
233
+		// so first count how many dependencies were originally registered for the class
234
+		$dependency_count = count(self::$_instance->_dependency_map[ $class ]);
235
+		// if that count is non-zero (meaning dependencies were already registered)
236
+		self::$_instance->_dependency_map[ $class ] = $dependency_count
237
+			// then truncate the  final array to match that count
238
+			? array_slice($dependencies, 0, $dependency_count)
239
+			// otherwise just take the incoming array because nothing previously existed
240
+			: $dependencies;
241
+		return $registered;
242
+	}
243
+
244
+
245
+	/**
246
+	 * @param string $class_name
247
+	 * @param string $loader
248
+	 * @return bool
249
+	 * @throws DomainException
250
+	 */
251
+	public static function register_class_loader($class_name, $loader = 'load_core')
252
+	{
253
+		if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
254
+			throw new DomainException(
255
+				esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
256
+			);
257
+		}
258
+		// check that loader is callable or method starts with "load_" and exists in EE_Registry
259
+		if (! is_callable($loader)
260
+			&& (
261
+				strpos($loader, 'load_') !== 0
262
+				|| ! method_exists('EE_Registry', $loader)
263
+			)
264
+		) {
265
+			throw new DomainException(
266
+				sprintf(
267
+					esc_html__(
268
+						'"%1$s" is not a valid loader method on EE_Registry.',
269
+						'event_espresso'
270
+					),
271
+					$loader
272
+				)
273
+			);
274
+		}
275
+		$class_name = self::$_instance->getFqnForAlias($class_name);
276
+		if (! isset(self::$_instance->_class_loaders[ $class_name ])) {
277
+			self::$_instance->_class_loaders[ $class_name ] = $loader;
278
+			return true;
279
+		}
280
+		return false;
281
+	}
282
+
283
+
284
+	/**
285
+	 * @return array
286
+	 */
287
+	public function dependency_map()
288
+	{
289
+		return $this->_dependency_map;
290
+	}
291
+
292
+
293
+	/**
294
+	 * returns TRUE if dependency map contains a listing for the provided class name
295
+	 *
296
+	 * @param string $class_name
297
+	 * @return boolean
298
+	 */
299
+	public function has($class_name = '')
300
+	{
301
+		// all legacy models have the same dependencies
302
+		if (strpos($class_name, 'EEM_') === 0) {
303
+			$class_name = 'LEGACY_MODELS';
304
+		}
305
+		return isset($this->_dependency_map[ $class_name ]) ? true : false;
306
+	}
307
+
308
+
309
+	/**
310
+	 * returns TRUE if dependency map contains a listing for the provided class name AND dependency
311
+	 *
312
+	 * @param string $class_name
313
+	 * @param string $dependency
314
+	 * @return bool
315
+	 */
316
+	public function has_dependency_for_class($class_name = '', $dependency = '')
317
+	{
318
+		// all legacy models have the same dependencies
319
+		if (strpos($class_name, 'EEM_') === 0) {
320
+			$class_name = 'LEGACY_MODELS';
321
+		}
322
+		$dependency = $this->getFqnForAlias($dependency, $class_name);
323
+		return isset($this->_dependency_map[ $class_name ][ $dependency ])
324
+			? true
325
+			: false;
326
+	}
327
+
328
+
329
+	/**
330
+	 * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
331
+	 *
332
+	 * @param string $class_name
333
+	 * @param string $dependency
334
+	 * @return int
335
+	 */
336
+	public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
337
+	{
338
+		// all legacy models have the same dependencies
339
+		if (strpos($class_name, 'EEM_') === 0) {
340
+			$class_name = 'LEGACY_MODELS';
341
+		}
342
+		$dependency = $this->getFqnForAlias($dependency);
343
+		return $this->has_dependency_for_class($class_name, $dependency)
344
+			? $this->_dependency_map[ $class_name ][ $dependency ]
345
+			: EE_Dependency_Map::not_registered;
346
+	}
347
+
348
+
349
+	/**
350
+	 * @param string $class_name
351
+	 * @return string | Closure
352
+	 */
353
+	public function class_loader($class_name)
354
+	{
355
+		// all legacy models use load_model()
356
+		if (strpos($class_name, 'EEM_') === 0) {
357
+			return 'load_model';
358
+		}
359
+		// EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
360
+		// perform strpos() first to avoid loading regex every time we load a class
361
+		if (strpos($class_name, 'EE_CPT_') === 0
362
+			&& preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
363
+		) {
364
+			return 'load_core';
365
+		}
366
+		$class_name = $this->getFqnForAlias($class_name);
367
+		return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
368
+	}
369
+
370
+
371
+	/**
372
+	 * @return array
373
+	 */
374
+	public function class_loaders()
375
+	{
376
+		return $this->_class_loaders;
377
+	}
378
+
379
+
380
+	/**
381
+	 * adds an alias for a classname
382
+	 *
383
+	 * @param string $fqcn      the class name that should be used (concrete class to replace interface)
384
+	 * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
385
+	 * @param string $for_class the class that has the dependency (is type hinting for the interface)
386
+	 * @throws InvalidAliasException
387
+	 */
388
+	public function add_alias($fqcn, $alias, $for_class = '')
389
+	{
390
+		$this->class_cache->addAlias($fqcn, $alias, $for_class);
391
+	}
392
+
393
+
394
+	/**
395
+	 * Returns TRUE if the provided fully qualified name IS an alias
396
+	 * WHY?
397
+	 * Because if a class is type hinting for a concretion,
398
+	 * then why would we need to find another class to supply it?
399
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
400
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
401
+	 * Don't go looking for some substitute.
402
+	 * Whereas if a class is type hinting for an interface...
403
+	 * then we need to find an actual class to use.
404
+	 * So the interface IS the alias for some other FQN,
405
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
406
+	 * represents some other class.
407
+	 *
408
+	 * @param string $fqn
409
+	 * @param string $for_class
410
+	 * @return bool
411
+	 */
412
+	public function isAlias($fqn = '', $for_class = '')
413
+	{
414
+		return $this->class_cache->isAlias($fqn, $for_class);
415
+	}
416
+
417
+
418
+	/**
419
+	 * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
420
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
421
+	 *  for example:
422
+	 *      if the following two entries were added to the _aliases array:
423
+	 *          array(
424
+	 *              'interface_alias'           => 'some\namespace\interface'
425
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
426
+	 *          )
427
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
428
+	 *      to load an instance of 'some\namespace\classname'
429
+	 *
430
+	 * @param string $alias
431
+	 * @param string $for_class
432
+	 * @return string
433
+	 */
434
+	public function getFqnForAlias($alias = '', $for_class = '')
435
+	{
436
+		return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
437
+	}
438
+
439
+
440
+	/**
441
+	 * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
442
+	 * if one exists, or whether a new object should be generated every time the requested class is loaded.
443
+	 * This is done by using the following class constants:
444
+	 *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
445
+	 *        EE_Dependency_Map::load_new_object - generates a new object every time
446
+	 */
447
+	protected function _register_core_dependencies()
448
+	{
449
+		$this->_dependency_map = array(
450
+			'EE_Request_Handler'                                                                                          => array(
451
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
452
+			),
453
+			'EE_System'                                                                                                   => array(
454
+				'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
455
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
456
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
457
+				'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
458
+			),
459
+			'EE_Session'                                                                                                  => array(
460
+				'EventEspresso\core\services\cache\TransientCacheStorage'  => EE_Dependency_Map::load_from_cache,
461
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
462
+				'EventEspresso\core\services\request\Request'              => EE_Dependency_Map::load_from_cache,
463
+				'EventEspresso\core\services\session\SessionStartHandler'  => EE_Dependency_Map::load_from_cache,
464
+				'EE_Encryption'                                            => EE_Dependency_Map::load_from_cache,
465
+			),
466
+			'EE_Cart'                                                                                                     => array(
467
+				'EE_Session' => EE_Dependency_Map::load_from_cache,
468
+			),
469
+			'EE_Front_Controller'                                                                                         => array(
470
+				'EE_Registry'              => EE_Dependency_Map::load_from_cache,
471
+				'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
472
+				'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
473
+			),
474
+			'EE_Messenger_Collection_Loader'                                                                              => array(
475
+				'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
476
+			),
477
+			'EE_Message_Type_Collection_Loader'                                                                           => array(
478
+				'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
479
+			),
480
+			'EE_Message_Resource_Manager'                                                                                 => array(
481
+				'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
482
+				'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
483
+				'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
484
+			),
485
+			'EE_Message_Factory'                                                                                          => array(
486
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
487
+			),
488
+			'EE_messages'                                                                                                 => array(
489
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
490
+			),
491
+			'EE_Messages_Generator'                                                                                       => array(
492
+				'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
493
+				'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
494
+				'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
495
+				'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
496
+			),
497
+			'EE_Messages_Processor'                                                                                       => array(
498
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
499
+			),
500
+			'EE_Messages_Queue'                                                                                           => array(
501
+				'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
502
+			),
503
+			'EE_Messages_Template_Defaults'                                                                               => array(
504
+				'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
505
+				'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
506
+			),
507
+			'EE_Message_To_Generate_From_Request'                                                                         => array(
508
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
509
+				'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
510
+			),
511
+			'EventEspresso\core\services\commands\CommandBus'                                                             => array(
512
+				'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
513
+			),
514
+			'EventEspresso\services\commands\CommandHandler'                                                              => array(
515
+				'EE_Registry'         => EE_Dependency_Map::load_from_cache,
516
+				'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
517
+			),
518
+			'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => array(
519
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
520
+			),
521
+			'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => array(
522
+				'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
523
+				'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
524
+			),
525
+			'EventEspresso\core\services\commands\CommandFactory'                                                         => array(
526
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
527
+			),
528
+			'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => array(
529
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
530
+			),
531
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => array(
532
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
533
+			),
534
+			'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => array(
535
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
536
+			),
537
+			'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => array(
538
+				'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
539
+			),
540
+			'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => array(
541
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
542
+			),
543
+			'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => array(
544
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
545
+			),
546
+			'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => array(
547
+				'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
548
+			),
549
+			'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => array(
550
+				'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
551
+			),
552
+			'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => array(
553
+				'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
554
+			),
555
+			'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => array(
556
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
557
+			),
558
+			'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => array(
559
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
560
+			),
561
+			'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => array(
562
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
563
+			),
564
+			'EventEspresso\core\services\database\TableManager'                                                           => array(
565
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
566
+			),
567
+			'EE_Data_Migration_Class_Base'                                                                                => array(
568
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
569
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
570
+			),
571
+			'EE_DMS_Core_4_1_0'                                                                                           => array(
572
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
573
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
574
+			),
575
+			'EE_DMS_Core_4_2_0'                                                                                           => array(
576
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
577
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
578
+			),
579
+			'EE_DMS_Core_4_3_0'                                                                                           => array(
580
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
581
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
582
+			),
583
+			'EE_DMS_Core_4_4_0'                                                                                           => array(
584
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
585
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
586
+			),
587
+			'EE_DMS_Core_4_5_0'                                                                                           => array(
588
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
589
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
590
+			),
591
+			'EE_DMS_Core_4_6_0'                                                                                           => array(
592
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
593
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
594
+			),
595
+			'EE_DMS_Core_4_7_0'                                                                                           => array(
596
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
597
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
598
+			),
599
+			'EE_DMS_Core_4_8_0'                                                                                           => array(
600
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
601
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
602
+			),
603
+			'EE_DMS_Core_4_9_0' => array(
604
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
605
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
606
+			),
607
+			'EE_DMS_Core_4_10_0' => array(
608
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
609
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
610
+				'EE_DMS_Core_4_9_0'                                  => EE_Dependency_Map::load_from_cache,
611
+			),
612
+			'EventEspresso\core\services\assets\I18nRegistry'                                                             => array(
613
+				array(),
614
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
615
+			),
616
+			'EventEspresso\core\services\assets\Registry'                                                                 => array(
617
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
618
+				'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
619
+			),
620
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled'                                             => array(
621
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
622
+			),
623
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout'                                              => array(
624
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
625
+			),
626
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees'                                        => array(
627
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
628
+			),
629
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEvents'                                                => array(
630
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
631
+			),
632
+			'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou'                                              => array(
633
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
634
+			),
635
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector'                                        => array(
636
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
637
+			),
638
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage'                                               => array(
639
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
640
+			),
641
+			'EventEspresso\core\services\cache\BasicCacheManager'                                                         => array(
642
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
643
+			),
644
+			'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => array(
645
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
646
+			),
647
+			'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => array(
648
+				'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
649
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
650
+			),
651
+			'EventEspresso\core\domain\values\EmailAddress'                                                               => array(
652
+				null,
653
+				'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
654
+			),
655
+			'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => array(
656
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
657
+			),
658
+			'LEGACY_MODELS'                                                                                               => array(
659
+				null,
660
+				'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
661
+			),
662
+			'EE_Module_Request_Router'                                                                                    => array(
663
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
664
+			),
665
+			'EE_Registration_Processor'                                                                                   => array(
666
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
667
+			),
668
+			'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => array(
669
+				null,
670
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
671
+				'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
672
+			),
673
+			'EventEspresso\core\services\licensing\LicenseService'                                                        => array(
674
+				'EventEspresso\core\domain\services\pue\Stats'  => EE_Dependency_Map::load_from_cache,
675
+				'EventEspresso\core\domain\services\pue\Config' => EE_Dependency_Map::load_from_cache,
676
+			),
677
+			'EE_Admin_Transactions_List_Table'                                                                            => array(
678
+				null,
679
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
680
+			),
681
+			'EventEspresso\core\domain\services\pue\Stats'                                                                => array(
682
+				'EventEspresso\core\domain\services\pue\Config'        => EE_Dependency_Map::load_from_cache,
683
+				'EE_Maintenance_Mode'                                  => EE_Dependency_Map::load_from_cache,
684
+				'EventEspresso\core\domain\services\pue\StatsGatherer' => EE_Dependency_Map::load_from_cache,
685
+			),
686
+			'EventEspresso\core\domain\services\pue\Config'                                                               => array(
687
+				'EE_Network_Config' => EE_Dependency_Map::load_from_cache,
688
+				'EE_Config'         => EE_Dependency_Map::load_from_cache,
689
+			),
690
+			'EventEspresso\core\domain\services\pue\StatsGatherer'                                                        => array(
691
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
692
+				'EEM_Event'          => EE_Dependency_Map::load_from_cache,
693
+				'EEM_Datetime'       => EE_Dependency_Map::load_from_cache,
694
+				'EEM_Ticket'         => EE_Dependency_Map::load_from_cache,
695
+				'EEM_Registration'   => EE_Dependency_Map::load_from_cache,
696
+				'EEM_Transaction'    => EE_Dependency_Map::load_from_cache,
697
+				'EE_Config'          => EE_Dependency_Map::load_from_cache,
698
+			),
699
+			'EventEspresso\core\domain\services\admin\ExitModal'                                                          => array(
700
+				'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
701
+			),
702
+			'EventEspresso\core\domain\services\admin\PluginUpsells'                                                      => array(
703
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
704
+			),
705
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => array(
706
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
707
+				'EE_Session'             => EE_Dependency_Map::load_from_cache,
708
+			),
709
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings'                                => array(
710
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
711
+			),
712
+			'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => array(
713
+				'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
714
+				'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
715
+				'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
716
+				'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
717
+				'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
718
+			),
719
+			'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => array(
720
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
721
+			),
722
+			'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => array(
723
+				'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
724
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
725
+			),
726
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => array(
727
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
728
+			),
729
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => array(
730
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
731
+			),
732
+			'EE_CPT_Strategy'                                                                                             => array(
733
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
734
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
735
+			),
736
+			'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => array(
737
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
738
+			),
739
+			'EventEspresso\core\domain\services\assets\CoreAssetManager'                                                  => array(
740
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
741
+				'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
742
+				'EE_Template_Config'                                 => EE_Dependency_Map::load_from_cache,
743
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
744
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
745
+			),
746
+			'EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy' => array(
747
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
748
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache
749
+			),
750
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendee' => array(
751
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
752
+			),
753
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendeeBillingData' => array(
754
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
755
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache
756
+			),
757
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportCheckins' => array(
758
+				'EEM_Checkin' => EE_Dependency_Map::load_from_cache,
759
+			),
760
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportRegistration' => array(
761
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache,
762
+			),
763
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportTransaction' => array(
764
+				'EEM_Transaction' => EE_Dependency_Map::load_from_cache,
765
+			),
766
+			'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAttendeeData' => array(
767
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
768
+			),
769
+			'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAnswers' => array(
770
+				'EEM_Answer' => EE_Dependency_Map::load_from_cache,
771
+				'EEM_Question' => EE_Dependency_Map::load_from_cache,
772
+			),
773
+			'EventEspresso\core\CPTs\CptQueryModifier' => array(
774
+				null,
775
+				null,
776
+				null,
777
+				'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
778
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
779
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
780
+			),
781
+			'EventEspresso\core\domain\services\admin\privacy\forms\PrivacySettingsFormHandler' => array(
782
+				'EE_Registry' => EE_Dependency_Map::load_from_cache,
783
+				'EE_Config' => EE_Dependency_Map::load_from_cache
784
+			),
785
+			'EventEspresso\core\services\editor\BlockRegistrationManager'                                                 => array(
786
+				'EventEspresso\core\services\assets\BlockAssetManagerCollection' => EE_Dependency_Map::load_from_cache,
787
+				'EventEspresso\core\domain\entities\editor\BlockCollection'      => EE_Dependency_Map::load_from_cache,
788
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => EE_Dependency_Map::load_from_cache,
789
+				'EventEspresso\core\services\request\Request'                    => EE_Dependency_Map::load_from_cache,
790
+			),
791
+			'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => array(
792
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
793
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
794
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
795
+			),
796
+			'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer' => array(
797
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
798
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
799
+			),
800
+			'EventEspresso\core\domain\entities\editor\blocks\EventAttendees' => array(
801
+				'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => self::load_from_cache,
802
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
803
+				'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer' => self::load_from_cache,
804
+			),
805
+			'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => array(
806
+				'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache,
807
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
808
+				'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache,
809
+			),
810
+			'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => array(
811
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
812
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
813
+			),
814
+			'EventEspresso\core\services\route_match\RouteMatchSpecificationManager' => array(
815
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
816
+				'EventEspresso\core\services\route_match\RouteMatchSpecificationFactory' => EE_Dependency_Map::load_from_cache,
817
+			),
818
+			'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => array(
819
+				'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache
820
+			),
821
+			'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => array(
822
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
823
+			),
824
+			'EventEspresso\core\libraries\rest_api\controllers\model\Read' => array(
825
+				'EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache
826
+			),
827
+			'EventEspresso\core\libraries\rest_api\calculations\Datetime' => array(
828
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
829
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
830
+			),
831
+			'EventEspresso\core\libraries\rest_api\calculations\Event' => array(
832
+				'EEM_Event' => EE_Dependency_Map::load_from_cache,
833
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
834
+			),
835
+			'EventEspresso\core\libraries\rest_api\calculations\Registration' => array(
836
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
837
+			),
838
+			'EventEspresso\core\services\session\SessionStartHandler' => array(
839
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
840
+			),
841
+			'EE_URL_Validation_Strategy' => array(
842
+				null,
843
+				null,
844
+				'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache
845
+			),
846
+			'EventEspresso\admin_pages\general_settings\OrganizationSettings' => array(
847
+				'EE_Registry'                                             => EE_Dependency_Map::load_from_cache,
848
+				'EE_Organization_Config'                                  => EE_Dependency_Map::load_from_cache,
849
+				'EE_Core_Config'                                          => EE_Dependency_Map::load_from_cache,
850
+				'EE_Network_Core_Config'                                  => EE_Dependency_Map::load_from_cache,
851
+				'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache,
852
+			),
853
+			'EventEspresso\core\services\address\CountrySubRegionDao' => array(
854
+				'EEM_State'                                            => EE_Dependency_Map::load_from_cache,
855
+				'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache
856
+			),
857
+			'EventEspresso\core\domain\services\admin\ajax\WordpressHeartbeat' => array(
858
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
859
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
860
+			),
861
+			'EventEspresso\core\domain\services\admin\ajax\EventEditorHeartbeat' => array(
862
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
863
+				'EE_Environment_Config'            => EE_Dependency_Map::load_from_cache,
864
+			),
865
+			'EventEspresso\core\services\request\files\FilesDataHandler' => array(
866
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
867
+			),
868
+			'EventEspressoBatchRequest\BatchRequestProcessor'                              => [
869
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
870
+			],
871
+			'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder' => [
872
+				null,
873
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
874
+				'EEM_Registration'  => EE_Dependency_Map::load_from_cache,
875
+			],
876
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader' => [
877
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
878
+				'EEM_Attendee'  => EE_Dependency_Map::load_from_cache,
879
+			],
880
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader' => [
881
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
882
+				'EEM_Datetime'  => EE_Dependency_Map::load_from_cache,
883
+			],
884
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader' => [
885
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
886
+				'EEM_Event'  => EE_Dependency_Map::load_from_cache,
887
+			],
888
+			'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader' => [
889
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
890
+				'EEM_Ticket'  => EE_Dependency_Map::load_from_cache,
891
+			],
892
+			'EventEspresso\core\domain\services\converters\RestApiSpoofer' => [
893
+				'WP_REST_Server' => EE_Dependency_Map::load_from_cache,
894
+				'EED_Core_Rest_Api' => EE_Dependency_Map::load_from_cache,
895
+				'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache,
896
+				null
897
+			],
898
+			'EventEspresso\core\domain\services\admin\events\default_settings\AdvancedEditorAdminFormSection'  => [
899
+				'EE_Admin_Config' => EE_Dependency_Map::load_from_cache
900
+			],
901
+			'EventEspresso\core\domain\services\admin\events\editor\AdvancedEditorData'  => [
902
+				'EE_Event'        => EE_Dependency_Map::not_registered,
903
+				'EE_Admin_Config' => EE_Dependency_Map::load_from_cache,
904
+			],
905
+			'EventEspresso\core\services\graphql\GraphQLManager' => [
906
+				'EventEspresso\core\services\graphql\TypesManager'  => EE_Dependency_Map::load_from_cache,
907
+				'EventEspresso\core\services\graphql\InputsManager'  => EE_Dependency_Map::load_from_cache,
908
+				'EventEspresso\core\services\graphql\EnumsManager'  => EE_Dependency_Map::load_from_cache,
909
+				'EventEspresso\core\services\graphql\ConnectionsManager'  => EE_Dependency_Map::load_from_cache,
910
+			],
911
+			'EventEspresso\core\services\graphql\TypesManager' => [
912
+				'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache,
913
+			],
914
+			'EventEspresso\core\services\graphql\InputsManager' => [
915
+				'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache,
916
+			],
917
+			'EventEspresso\core\services\graphql\EnumsManager' => [
918
+				'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache,
919
+			],
920
+			'EventEspresso\core\services\graphql\ConnectionsManager' => [
921
+				'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache,
922
+			],
923
+			'EventEspresso\core\domain\services\graphql\types\Datetime' => [
924
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
925
+			],
926
+			'EventEspresso\core\domain\services\graphql\types\Event' => [
927
+				'EEM_Event' => EE_Dependency_Map::load_from_cache,
928
+			],
929
+			'EventEspresso\core\domain\services\graphql\types\Ticket' => [
930
+				'EEM_Ticket' => EE_Dependency_Map::load_from_cache,
931
+			],
932
+			'EventEspresso\core\domain\services\graphql\types\Price' => [
933
+				'EEM_Price' => EE_Dependency_Map::load_from_cache,
934
+			],
935
+			'EventEspresso\core\domain\services\graphql\types\PriceType' => [
936
+				'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
937
+			],
938
+			'EventEspresso\core\domain\services\graphql\types\Venue' => [
939
+				'EEM_Venue' => EE_Dependency_Map::load_from_cache,
940
+			],
941
+			'EventEspresso\core\domain\services\graphql\types\State' => [
942
+				'EEM_State' => EE_Dependency_Map::load_from_cache,
943
+			],
944
+			'EventEspresso\core\domain\services\graphql\types\Country' => [
945
+				'EEM_Country' => EE_Dependency_Map::load_from_cache,
946
+			],
947
+			'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection' => [
948
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
949
+			],
950
+			'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection' => [
951
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
952
+			],
953
+			'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection' => [
954
+				'EEM_Ticket' => EE_Dependency_Map::load_from_cache,
955
+			],
956
+			'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection' => [
957
+				'EEM_Ticket' => EE_Dependency_Map::load_from_cache,
958
+			],
959
+			'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection' => [
960
+				'EEM_Price' => EE_Dependency_Map::load_from_cache,
961
+			],
962
+			'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection' => [
963
+				'EEM_Price' => EE_Dependency_Map::load_from_cache,
964
+			],
965
+			'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection' => [
966
+				'EEM_Price_Type' => EE_Dependency_Map::load_from_cache,
967
+			],
968
+			'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection' => [
969
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
970
+			],
971
+			'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection' => [
972
+				'EEM_Venue' => EE_Dependency_Map::load_from_cache,
973
+			],
974
+		);
975
+	}
976
+
977
+
978
+	/**
979
+	 * Registers how core classes are loaded.
980
+	 * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
981
+	 *        'EE_Request_Handler' => 'load_core'
982
+	 *        'EE_Messages_Queue'  => 'load_lib'
983
+	 *        'EEH_Debug_Tools'    => 'load_helper'
984
+	 * or, if greater control is required, by providing a custom closure. For example:
985
+	 *        'Some_Class' => function () {
986
+	 *            return new Some_Class();
987
+	 *        },
988
+	 * This is required for instantiating dependencies
989
+	 * where an interface has been type hinted in a class constructor. For example:
990
+	 *        'Required_Interface' => function () {
991
+	 *            return new A_Class_That_Implements_Required_Interface();
992
+	 *        },
993
+	 */
994
+	protected function _register_core_class_loaders()
995
+	{
996
+		$this->_class_loaders = array(
997
+			// load_core
998
+			'EE_Dependency_Map'                            => function () {
999
+				return $this;
1000
+			},
1001
+			'EE_Capabilities'                              => 'load_core',
1002
+			'EE_Encryption'                                => 'load_core',
1003
+			'EE_Front_Controller'                          => 'load_core',
1004
+			'EE_Module_Request_Router'                     => 'load_core',
1005
+			'EE_Registry'                                  => 'load_core',
1006
+			'EE_Request'                                   => function () {
1007
+				return $this->legacy_request;
1008
+			},
1009
+			'EventEspresso\core\services\request\Request'  => function () {
1010
+				return $this->request;
1011
+			},
1012
+			'EventEspresso\core\services\request\Response' => function () {
1013
+				return $this->response;
1014
+			},
1015
+			'EE_Base'                                      => 'load_core',
1016
+			'EE_Request_Handler'                           => 'load_core',
1017
+			'EE_Session'                                   => 'load_core',
1018
+			'EE_Cron_Tasks'                                => 'load_core',
1019
+			'EE_System'                                    => 'load_core',
1020
+			'EE_Maintenance_Mode'                          => 'load_core',
1021
+			'EE_Register_CPTs'                             => 'load_core',
1022
+			'EE_Admin'                                     => 'load_core',
1023
+			'EE_CPT_Strategy'                              => 'load_core',
1024
+			// load_class
1025
+			'EE_Registration_Processor'                    => 'load_class',
1026
+			// load_lib
1027
+			'EE_Message_Resource_Manager'                  => 'load_lib',
1028
+			'EE_Message_Type_Collection'                   => 'load_lib',
1029
+			'EE_Message_Type_Collection_Loader'            => 'load_lib',
1030
+			'EE_Messenger_Collection'                      => 'load_lib',
1031
+			'EE_Messenger_Collection_Loader'               => 'load_lib',
1032
+			'EE_Messages_Processor'                        => 'load_lib',
1033
+			'EE_Message_Repository'                        => 'load_lib',
1034
+			'EE_Messages_Queue'                            => 'load_lib',
1035
+			'EE_Messages_Data_Handler_Collection'          => 'load_lib',
1036
+			'EE_Message_Template_Group_Collection'         => 'load_lib',
1037
+			'EE_Payment_Method_Manager'                    => 'load_lib',
1038
+			'EE_DMS_Core_4_1_0'                            => 'load_dms',
1039
+			'EE_DMS_Core_4_2_0'                            => 'load_dms',
1040
+			'EE_DMS_Core_4_3_0'                            => 'load_dms',
1041
+			'EE_DMS_Core_4_5_0'                            => 'load_dms',
1042
+			'EE_DMS_Core_4_6_0'                            => 'load_dms',
1043
+			'EE_DMS_Core_4_7_0'                            => 'load_dms',
1044
+			'EE_DMS_Core_4_8_0'                            => 'load_dms',
1045
+			'EE_DMS_Core_4_9_0'                            => 'load_dms',
1046
+			'EE_DMS_Core_4_10_0'                            => 'load_dms',
1047
+			'EE_Messages_Generator'                        => static function () {
1048
+				return EE_Registry::instance()->load_lib(
1049
+					'Messages_Generator',
1050
+					array(),
1051
+					false,
1052
+					false
1053
+				);
1054
+			},
1055
+			'EE_Messages_Template_Defaults'                => static function ($arguments = array()) {
1056
+				return EE_Registry::instance()->load_lib(
1057
+					'Messages_Template_Defaults',
1058
+					$arguments,
1059
+					false,
1060
+					false
1061
+				);
1062
+			},
1063
+			// load_helper
1064
+			'EEH_Parse_Shortcodes'                         => static function () {
1065
+				if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
1066
+					return new EEH_Parse_Shortcodes();
1067
+				}
1068
+				return null;
1069
+			},
1070
+			'EE_Template_Config'                           => static function () {
1071
+				return EE_Config::instance()->template_settings;
1072
+			},
1073
+			'EE_Currency_Config'                           => static function () {
1074
+				return EE_Config::instance()->currency;
1075
+			},
1076
+			'EE_Registration_Config'                       => static function () {
1077
+				return EE_Config::instance()->registration;
1078
+			},
1079
+			'EE_Core_Config'                               => static function () {
1080
+				return EE_Config::instance()->core;
1081
+			},
1082
+			'EventEspresso\core\services\loaders\Loader'   => static function () {
1083
+				return LoaderFactory::getLoader();
1084
+			},
1085
+			'EE_Network_Config'                            => static function () {
1086
+				return EE_Network_Config::instance();
1087
+			},
1088
+			'EE_Config'                                    => static function () {
1089
+				return EE_Config::instance();
1090
+			},
1091
+			'EventEspresso\core\domain\Domain'             => static function () {
1092
+				return DomainFactory::getEventEspressoCoreDomain();
1093
+			},
1094
+			'EE_Admin_Config'                              => static function () {
1095
+				return EE_Config::instance()->admin;
1096
+			},
1097
+			'EE_Organization_Config'                       => static function () {
1098
+				return EE_Config::instance()->organization;
1099
+			},
1100
+			'EE_Network_Core_Config'                       => static function () {
1101
+				return EE_Network_Config::instance()->core;
1102
+			},
1103
+			'EE_Environment_Config'                        => static function () {
1104
+				return EE_Config::instance()->environment;
1105
+			},
1106
+			'EED_Core_Rest_Api'                            => static function () {
1107
+				return EED_Core_Rest_Api::instance();
1108
+			},
1109
+			'WP_REST_Server'                            => static function () {
1110
+				return rest_get_server();
1111
+			},
1112
+		);
1113
+	}
1114
+
1115
+
1116
+	/**
1117
+	 * can be used for supplying alternate names for classes,
1118
+	 * or for connecting interface names to instantiable classes
1119
+	 *
1120
+	 * @throws InvalidAliasException
1121
+	 */
1122
+	protected function _register_core_aliases()
1123
+	{
1124
+		$aliases = array(
1125
+			'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
1126
+			'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
1127
+			'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
1128
+			'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
1129
+			'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
1130
+			'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
1131
+			'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
1132
+			'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
1133
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
1134
+			'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
1135
+			'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
1136
+			'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
1137
+			'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
1138
+			'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
1139
+			'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
1140
+			'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
1141
+			'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
1142
+			'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
1143
+			'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
1144
+			'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
1145
+			'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
1146
+			'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
1147
+			'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
1148
+			'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
1149
+			'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
1150
+			'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
1151
+			'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
1152
+			'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
1153
+			'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
1154
+			'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
1155
+			'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
1156
+			'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
1157
+			'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
1158
+			'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
1159
+			'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
1160
+			'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
1161
+			'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
1162
+			'Registration_Processor'                                                       => 'EE_Registration_Processor',
1163
+		);
1164
+		foreach ($aliases as $alias => $fqn) {
1165
+			if (is_array($fqn)) {
1166
+				foreach ($fqn as $class => $for_class) {
1167
+					$this->class_cache->addAlias($class, $alias, $for_class);
1168
+				}
1169
+				continue;
1170
+			}
1171
+			$this->class_cache->addAlias($fqn, $alias);
1172
+		}
1173
+		if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
1174
+			$this->class_cache->addAlias(
1175
+				'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
1176
+				'EventEspresso\core\services\notices\NoticeConverterInterface'
1177
+			);
1178
+		}
1179
+	}
1180
+
1181
+
1182
+	/**
1183
+	 * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
1184
+	 * request Primarily used by unit tests.
1185
+	 */
1186
+	public function reset()
1187
+	{
1188
+		$this->_register_core_class_loaders();
1189
+		$this->_register_core_dependencies();
1190
+	}
1191
+
1192
+
1193
+	/**
1194
+	 * PLZ NOTE: a better name for this method would be is_alias()
1195
+	 * because it returns TRUE if the provided fully qualified name IS an alias
1196
+	 * WHY?
1197
+	 * Because if a class is type hinting for a concretion,
1198
+	 * then why would we need to find another class to supply it?
1199
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
1200
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
1201
+	 * Don't go looking for some substitute.
1202
+	 * Whereas if a class is type hinting for an interface...
1203
+	 * then we need to find an actual class to use.
1204
+	 * So the interface IS the alias for some other FQN,
1205
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
1206
+	 * represents some other class.
1207
+	 *
1208
+	 * @deprecated 4.9.62.p
1209
+	 * @param string $fqn
1210
+	 * @param string $for_class
1211
+	 * @return bool
1212
+	 */
1213
+	public function has_alias($fqn = '', $for_class = '')
1214
+	{
1215
+		return $this->isAlias($fqn, $for_class);
1216
+	}
1217
+
1218
+
1219
+	/**
1220
+	 * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
1221
+	 * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
1222
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
1223
+	 *  for example:
1224
+	 *      if the following two entries were added to the _aliases array:
1225
+	 *          array(
1226
+	 *              'interface_alias'           => 'some\namespace\interface'
1227
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
1228
+	 *          )
1229
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1230
+	 *      to load an instance of 'some\namespace\classname'
1231
+	 *
1232
+	 * @deprecated 4.9.62.p
1233
+	 * @param string $alias
1234
+	 * @param string $for_class
1235
+	 * @return string
1236
+	 */
1237
+	public function get_alias($alias = '', $for_class = '')
1238
+	{
1239
+		return $this->getFqnForAlias($alias, $for_class);
1240
+	}
1241 1241
 }
Please login to merge, or discard this patch.