Completed
Branch FET/asset-manager (433489)
by
unknown
32:42 queued 18:11
created
core/services/orm/ModelFieldFactory.php 2 patches
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -125,7 +125,6 @@  discard block
 block discarded – undo
125 125
     /**
126 126
      * @param string $table_column
127 127
      * @param string $nice_name
128
-     * @param string $timezone_string
129 128
      * @param bool   $nullable
130 129
      * @param string $default_value
131 130
      * @throws EE_Error
@@ -170,7 +169,7 @@  discard block
 block discarded – undo
170 169
      * @param string $table_column
171 170
      * @param string $nice_name
172 171
      * @param bool   $nullable
173
-     * @param null   $default_value
172
+     * @param integer   $default_value
174 173
      * @return EE_DB_Only_Int_Field
175 174
      */
176 175
     public function createDbOnlyIntField($table_column, $nice_name, $nullable, $default_value = null)
@@ -280,7 +279,7 @@  discard block
 block discarded – undo
280 279
      * @param string $table_column
281 280
      * @param string $nice_name
282 281
      * @param bool   $nullable
283
-     * @param null   $default_value
282
+     * @param integer   $default_value
284 283
      * @param string $model_name
285 284
      * @return EE_Foreign_Key_Int_Field
286 285
      */
@@ -297,7 +296,7 @@  discard block
 block discarded – undo
297 296
      * @param string $table_column
298 297
      * @param string $nice_name
299 298
      * @param bool   $nullable
300
-     * @param null   $default_value
299
+     * @param string   $default_value
301 300
      * @param string $model_name
302 301
      * @return EE_Foreign_Key_String_Field
303 302
      */
@@ -533,7 +532,7 @@  discard block
 block discarded – undo
533 532
      * @param string $table_column
534 533
      * @param string $nice_name
535 534
      * @param bool   $nullable
536
-     * @param mixed  $default_value
535
+     * @param string  $default_value
537 536
      * @param array  $values                            If additional stati are to be used other than the default WP
538 537
      *                                                  statuses, then they can be registered via this property. The
539 538
      *                                                  format of the array should be as follows: array(
Please login to merge, or discard this patch.
Indentation   +543 added lines, -543 removed lines patch added patch discarded remove patch
@@ -51,547 +51,547 @@
 block discarded – undo
51 51
 class ModelFieldFactory
52 52
 {
53 53
 
54
-    /**
55
-     * @var LoaderInterface $loader
56
-     */
57
-    private $loader;
58
-
59
-
60
-    /**
61
-     * ModelFieldFactory constructor.
62
-     *
63
-     * @param LoaderInterface $loader
64
-     */
65
-    public function __construct(LoaderInterface $loader)
66
-    {
67
-        $this->loader = $loader;
68
-    }
69
-
70
-
71
-    /**
72
-     * @param string $table_column
73
-     * @param string $nice_name
74
-     * @param bool   $nullable
75
-     * @param null   $default_value
76
-     * @return EE_All_Caps_Text_Field
77
-     */
78
-    public function createAllCapsTextField($table_column, $nice_name, $nullable, $default_value = null)
79
-    {
80
-        return $this->loader->getNew(
81
-            'EE_All_Caps_Text_Field',
82
-            array($table_column, $nice_name, $nullable, $default_value)
83
-        );
84
-    }
85
-
86
-
87
-    /**
88
-     * @param string $table_column
89
-     * @param string $nice_name
90
-     * @param bool   $nullable
91
-     * @param null   $default_value
92
-     * @param string $model_name
93
-     * @return EE_Any_Foreign_Model_Name_Field
94
-     */
95
-    public function createAnyForeignModelNameField(
96
-        $table_column,
97
-        $nice_name,
98
-        $nullable,
99
-        $default_value = null,
100
-        $model_name
101
-    ) {
102
-        return $this->loader->getNew(
103
-            'EE_Any_Foreign_Model_Name_Field',
104
-            array($table_column, $nice_name, $nullable, $default_value, $model_name)
105
-        );
106
-    }
107
-
108
-
109
-    /**
110
-     * @param string $table_column
111
-     * @param string $nice_name
112
-     * @param bool   $nullable
113
-     * @param null   $default_value
114
-     * @return EE_Boolean_Field
115
-     */
116
-    public function createBooleanField($table_column, $nice_name, $nullable, $default_value = null)
117
-    {
118
-        return $this->loader->getNew(
119
-            'EE_Boolean_Field',
120
-            array($table_column, $nice_name, $nullable, $default_value)
121
-        );
122
-    }
123
-
124
-
125
-    /**
126
-     * @param string $table_column
127
-     * @param string $nice_name
128
-     * @param string $timezone_string
129
-     * @param bool   $nullable
130
-     * @param string $default_value
131
-     * @throws EE_Error
132
-     * @throws InvalidArgumentException
133
-     * @return EE_Datetime_Field
134
-     */
135
-    public function createDatetimeField(
136
-        $table_column,
137
-        $nice_name,
138
-        $nullable = false,
139
-        $default_value = EE_Datetime_Field::now
140
-    ) {
141
-        return $this->loader->getNew(
142
-            'EE_Datetime_Field',
143
-            array(
144
-                $table_column,
145
-                $nice_name,
146
-                $nullable,
147
-                $default_value,
148
-            )
149
-        );
150
-    }
151
-
152
-
153
-    /**
154
-     * @param string $table_column
155
-     * @param string $nice_name
156
-     * @param bool   $nullable
157
-     * @param null   $default_value
158
-     * @return EE_DB_Only_Float_Field
159
-     */
160
-    public function createDbOnlyFloatField($table_column, $nice_name, $nullable, $default_value = null)
161
-    {
162
-        return $this->loader->getNew(
163
-            'EE_DB_Only_Float_Field',
164
-            array($table_column, $nice_name, $nullable, $default_value)
165
-        );
166
-    }
167
-
168
-
169
-    /**
170
-     * @param string $table_column
171
-     * @param string $nice_name
172
-     * @param bool   $nullable
173
-     * @param null   $default_value
174
-     * @return EE_DB_Only_Int_Field
175
-     */
176
-    public function createDbOnlyIntField($table_column, $nice_name, $nullable, $default_value = null)
177
-    {
178
-        return $this->loader->getNew(
179
-            'EE_DB_Only_Int_Field',
180
-            array($table_column, $nice_name, $nullable, $default_value)
181
-        );
182
-    }
183
-
184
-
185
-    /**
186
-     * @param string $table_column
187
-     * @param string $nice_name
188
-     * @param bool   $nullable
189
-     * @param null   $default_value
190
-     * @return EE_DB_Only_Text_Field
191
-     */
192
-    public function createDbOnlyTextField($table_column, $nice_name, $nullable, $default_value = null)
193
-    {
194
-        return $this->loader->getNew(
195
-            'EE_DB_Only_Text_Field',
196
-            array($table_column, $nice_name, $nullable, $default_value)
197
-        );
198
-    }
199
-
200
-
201
-    /**
202
-     * @param string $table_column
203
-     * @param string $nice_name
204
-     * @param bool   $nullable
205
-     * @param string $default_value
206
-     * @return EE_Email_Field
207
-     */
208
-    public function createEmailField($table_column, $nice_name, $nullable = true, $default_value = '')
209
-    {
210
-        return $this->loader->getNew(
211
-            'EE_Email_Field',
212
-            array($table_column, $nice_name, $nullable, $default_value)
213
-        );
214
-    }
215
-
216
-
217
-    /**
218
-     * @param string $table_column
219
-     * @param string $nice_name
220
-     * @param bool   $nullable
221
-     * @param null   $default_value
222
-     * @param array  $allowed_enum_values keys are values to be used in the DB,
223
-     *                                    values are how they should be displayed
224
-     * @return EE_Enum_Integer_Field
225
-     */
226
-    public function createEnumIntegerField(
227
-        $table_column,
228
-        $nice_name,
229
-        $nullable,
230
-        $default_value = null,
231
-        array $allowed_enum_values
232
-    ) {
233
-        return $this->loader->getNew(
234
-            'EE_Enum_Integer_Field',
235
-            array($table_column, $nice_name, $nullable, $default_value, $allowed_enum_values)
236
-        );
237
-    }
238
-
239
-
240
-    /**
241
-     * @param string $table_column
242
-     * @param string $nice_name
243
-     * @param bool   $nullable
244
-     * @param null   $default_value
245
-     * @param array  $allowed_enum_values keys are values to be used in the DB,
246
-     *                                    values are how they should be displayed
247
-     * @return EE_Enum_Text_Field
248
-     */
249
-    public function createEnumTextField(
250
-        $table_column,
251
-        $nice_name,
252
-        $nullable,
253
-        $default_value,
254
-        array $allowed_enum_values
255
-    ) {
256
-        return $this->loader->getNew(
257
-            'EE_Enum_Text_Field',
258
-            array($table_column, $nice_name, $nullable, $default_value, $allowed_enum_values)
259
-        );
260
-    }
261
-
262
-
263
-    /**
264
-     * @param string $table_column
265
-     * @param string $nice_name
266
-     * @param bool   $nullable
267
-     * @param null   $default_value
268
-     * @return EE_Float_Field
269
-     */
270
-    public function createFloatField($table_column, $nice_name, $nullable, $default_value = null)
271
-    {
272
-        return $this->loader->getNew(
273
-            'EE_Float_Field',
274
-            array($table_column, $nice_name, $nullable, $default_value)
275
-        );
276
-    }
277
-
278
-
279
-    /**
280
-     * @param string $table_column
281
-     * @param string $nice_name
282
-     * @param bool   $nullable
283
-     * @param null   $default_value
284
-     * @param string $model_name
285
-     * @return EE_Foreign_Key_Int_Field
286
-     */
287
-    public function createForeignKeyIntField($table_column, $nice_name, $nullable, $default_value, $model_name)
288
-    {
289
-        return $this->loader->getNew(
290
-            'EE_Foreign_Key_Int_Field',
291
-            array($table_column, $nice_name, $nullable, $default_value, $model_name)
292
-        );
293
-    }
294
-
295
-
296
-    /**
297
-     * @param string $table_column
298
-     * @param string $nice_name
299
-     * @param bool   $nullable
300
-     * @param null   $default_value
301
-     * @param string $model_name
302
-     * @return EE_Foreign_Key_String_Field
303
-     */
304
-    public function createForeignKeyStringField(
305
-        $table_column,
306
-        $nice_name,
307
-        $nullable,
308
-        $default_value,
309
-        $model_name
310
-    ) {
311
-        return $this->loader->getNew(
312
-            'EE_Foreign_Key_String_Field',
313
-            array($table_column, $nice_name, $nullable, $default_value, $model_name)
314
-        );
315
-    }
316
-
317
-
318
-    /**
319
-     * @param string $table_column
320
-     * @param string $nice_name
321
-     * @param bool   $nullable
322
-     * @param null   $default_value
323
-     * @return EE_Full_HTML_Field
324
-     */
325
-    public function createFullHtmlField($table_column, $nice_name, $nullable, $default_value = null)
326
-    {
327
-        return $this->loader->getNew(
328
-            'EE_Full_HTML_Field',
329
-            array($table_column, $nice_name, $nullable, $default_value)
330
-        );
331
-    }
332
-
333
-
334
-    /**
335
-     * @param string $table_column
336
-     * @param string $nice_name
337
-     * @param bool   $nullable
338
-     * @param null   $default_value
339
-     * @return EE_Infinite_Integer_Field
340
-     */
341
-    public function createInfiniteIntegerField($table_column, $nice_name, $nullable, $default_value = null)
342
-    {
343
-        return $this->loader->getNew(
344
-            'EE_Infinite_Integer_Field',
345
-            array($table_column, $nice_name, $nullable, $default_value)
346
-        );
347
-    }
348
-
349
-
350
-    /**
351
-     * @param string  $table_column
352
-     * @param string  $nice_name
353
-     * @param bool    $nullable
354
-     * @param integer $default_value
355
-     * @return EE_Integer_Field
356
-     */
357
-    public function createIntegerField($table_column, $nice_name, $nullable = false, $default_value = 0)
358
-    {
359
-        return $this->loader->getNew(
360
-            'EE_Integer_Field',
361
-            array($table_column, $nice_name, $nullable, $default_value)
362
-        );
363
-    }
364
-
365
-
366
-    /**
367
-     * @param string $table_column
368
-     * @param string $nice_name
369
-     * @param bool   $nullable
370
-     * @param null   $default_value
371
-     * @return EE_Maybe_Serialized_Simple_HTML_Field
372
-     */
373
-    public function createMaybeSerializedSimpleHtmlField($table_column, $nice_name, $nullable, $default_value = null)
374
-    {
375
-        return $this->loader->getNew(
376
-            'EE_Maybe_Serialized_Simple_HTML_Field',
377
-            array($table_column, $nice_name, $nullable, $default_value)
378
-        );
379
-    }
380
-
381
-
382
-    /**
383
-     * @param string $table_column
384
-     * @param string $nice_name
385
-     * @param bool   $nullable
386
-     * @param null   $default_value
387
-     * @return EE_Maybe_Serialized_Text_Field
388
-     */
389
-    public function createMaybeSerializedTextField($table_column, $nice_name, $nullable, $default_value = null)
390
-    {
391
-        return $this->loader->getNew(
392
-            'EE_Maybe_Serialized_Text_Field',
393
-            array($table_column, $nice_name, $nullable, $default_value)
394
-        );
395
-    }
396
-
397
-
398
-    /**
399
-     * @param string $table_column
400
-     * @param string $nice_name
401
-     * @param bool   $nullable
402
-     * @param null   $default_value
403
-     * @return EE_Money_Field
404
-     */
405
-    public function createMoneyField($table_column, $nice_name, $nullable, $default_value = null)
406
-    {
407
-        return $this->loader->getNew(
408
-            'EE_Money_Field',
409
-            array($table_column, $nice_name, $nullable, $default_value)
410
-        );
411
-    }
412
-
413
-
414
-    /**
415
-     * @param string $table_column
416
-     * @param string $nice_name
417
-     * @param bool   $nullable
418
-     * @param string $default_value
419
-     * @return EE_Plain_Text_Field
420
-     */
421
-    public function createPlainTextField($table_column, $nice_name, $nullable = true, $default_value = '')
422
-    {
423
-        return $this->loader->getNew(
424
-            'EE_Plain_Text_Field',
425
-            array($table_column, $nice_name, $nullable, $default_value)
426
-        );
427
-    }
428
-
429
-
430
-    /**
431
-     * @param string $table_column
432
-     * @param string $nice_name
433
-     * @param bool   $nullable
434
-     * @param null   $default_value
435
-     * @return EE_Post_Content_Field
436
-     */
437
-    public function createPostContentField($table_column, $nice_name, $nullable, $default_value = null)
438
-    {
439
-        return $this->loader->getNew(
440
-            'EE_Post_Content_Field',
441
-            array($table_column, $nice_name, $nullable, $default_value)
442
-        );
443
-    }
444
-
445
-
446
-    /**
447
-     * @param string $table_column
448
-     * @param string $nice_name
449
-     * @return EE_Primary_Key_Int_Field
450
-     */
451
-    public function createPrimaryKeyIntField($table_column, $nice_name)
452
-    {
453
-        return $this->loader->getNew('EE_Primary_Key_Int_Field', array($table_column, $nice_name));
454
-    }
455
-
456
-
457
-    /**
458
-     * @param string $table_column
459
-     * @param string $nice_name
460
-     * @return EE_Primary_Key_String_Field
461
-     */
462
-    public function createPrimaryKeyStringField($table_column, $nice_name)
463
-    {
464
-        return $this->loader->getNew('EE_Primary_Key_String_Field', array($table_column, $nice_name));
465
-    }
466
-
467
-
468
-    /**
469
-     * @param string $table_column
470
-     * @param string $nice_name
471
-     * @param bool   $nullable
472
-     * @param null   $default_value
473
-     * @return EE_Serialized_Text_Field
474
-     */
475
-    public function createSerializedTextField($table_column, $nice_name, $nullable, $default_value = null)
476
-    {
477
-        return $this->loader->getNew(
478
-            'EE_Serialized_Text_Field',
479
-            array($table_column, $nice_name, $nullable, $default_value)
480
-        );
481
-    }
482
-
483
-
484
-    /**
485
-     * @param string $table_column
486
-     * @param string $nice_name
487
-     * @param bool   $nullable
488
-     * @param null   $default_value
489
-     * @return EE_Simple_HTML_Field
490
-     */
491
-    public function createSimpleHtmlField($table_column, $nice_name, $nullable, $default_value = null)
492
-    {
493
-        return $this->loader->getNew(
494
-            'EE_Simple_HTML_Field',
495
-            array($table_column, $nice_name, $nullable, $default_value)
496
-        );
497
-    }
498
-
499
-
500
-    /**
501
-     * @param string $table_column
502
-     * @param string $nice_name
503
-     * @param bool   $nullable
504
-     * @param null   $default_value
505
-     * @return EE_Slug_Field
506
-     */
507
-    public function createSlugField($table_column, $nice_name, $nullable = false, $default_value = null)
508
-    {
509
-        return $this->loader->getNew(
510
-            'EE_Slug_Field',
511
-            array($table_column, $nice_name, $nullable, $default_value)
512
-        );
513
-    }
514
-
515
-
516
-    /**
517
-     * @param string $table_column
518
-     * @param string $nice_name
519
-     * @param bool   $nullable
520
-     * @param null   $default_value
521
-     * @return EE_Trashed_Flag_Field
522
-     */
523
-    public function createTrashedFlagField($table_column, $nice_name, $nullable, $default_value = null)
524
-    {
525
-        return $this->loader->getNew(
526
-            'EE_Trashed_Flag_Field',
527
-            array($table_column, $nice_name, $nullable, $default_value)
528
-        );
529
-    }
530
-
531
-
532
-    /**
533
-     * @param string $table_column
534
-     * @param string $nice_name
535
-     * @param bool   $nullable
536
-     * @param mixed  $default_value
537
-     * @param array  $values                            If additional stati are to be used other than the default WP
538
-     *                                                  statuses, then they can be registered via this property. The
539
-     *                                                  format of the array should be as follows: array(
540
-     *                                                  'status_reference' => array(
541
-     *                                                  'label' => __('Status Reference Label', 'event_espresso'),
542
-     *                                                  'public' => true,                 // whether this status should
543
-     *                                                  be shown on the frontend of the site
544
-     *                                                  'exclude_from_search' => false,   // whether this status should
545
-     *                                                  be excluded from wp searches
546
-     *                                                  'show_in_admin_all_list' => true, // whether this status is
547
-     *                                                  included in queries for the admin "all" view in list table
548
-     *                                                  views.
549
-     *                                                  'show_in_admin_status_list' => true, // show in the list of
550
-     *                                                  statuses with post counts at the top of the admin list tables
551
-     *                                                  (i.e. Status Reference(2) )
552
-     *                                                  'label_count' => _n_noop(
553
-     *                                                  'Status Reference <span class="count">(%s)</span>',
554
-     *                                                  'Status References <span class="count">(%s)</span>'
555
-     *                                                  ),                                   // the text to display on
556
-     *                                                  the admin screen
557
-     *                                                  ( or you won't see your status count ).
558
-     *                                                  )
559
-     *                                                  )
560
-     * @link http://codex.wordpress.org/Function_Reference/register_post_status for more info
561
-     * @return EE_WP_Post_Status_Field
562
-     */
563
-    public function createWpPostStatusField(
564
-        $table_column,
565
-        $nice_name,
566
-        $nullable,
567
-        $default_value = null,
568
-        array $values = array()
569
-    ) {
570
-        return $this->loader->getNew(
571
-            'EE_WP_Post_Status_Field',
572
-            array($table_column, $nice_name, $nullable, $default_value, $values)
573
-        );
574
-    }
575
-
576
-
577
-    /**
578
-     * @param string $post_type
579
-     * @return EE_WP_Post_Type_Field
580
-     */
581
-    public function createWpPostTypeField($post_type)
582
-    {
583
-        return $this->loader->getNew('EE_WP_Post_Type_Field', array($post_type));
584
-    }
585
-
586
-
587
-    /**
588
-     * @param string $table_column
589
-     * @param string $nice_name
590
-     * @param bool   $nullable
591
-     * @return EE_WP_User_Field
592
-     */
593
-    public function createWpUserField($table_column, $nice_name, $nullable)
594
-    {
595
-        return $this->loader->getNew('EE_WP_User_Field', array($table_column, $nice_name, $nullable));
596
-    }
54
+	/**
55
+	 * @var LoaderInterface $loader
56
+	 */
57
+	private $loader;
58
+
59
+
60
+	/**
61
+	 * ModelFieldFactory constructor.
62
+	 *
63
+	 * @param LoaderInterface $loader
64
+	 */
65
+	public function __construct(LoaderInterface $loader)
66
+	{
67
+		$this->loader = $loader;
68
+	}
69
+
70
+
71
+	/**
72
+	 * @param string $table_column
73
+	 * @param string $nice_name
74
+	 * @param bool   $nullable
75
+	 * @param null   $default_value
76
+	 * @return EE_All_Caps_Text_Field
77
+	 */
78
+	public function createAllCapsTextField($table_column, $nice_name, $nullable, $default_value = null)
79
+	{
80
+		return $this->loader->getNew(
81
+			'EE_All_Caps_Text_Field',
82
+			array($table_column, $nice_name, $nullable, $default_value)
83
+		);
84
+	}
85
+
86
+
87
+	/**
88
+	 * @param string $table_column
89
+	 * @param string $nice_name
90
+	 * @param bool   $nullable
91
+	 * @param null   $default_value
92
+	 * @param string $model_name
93
+	 * @return EE_Any_Foreign_Model_Name_Field
94
+	 */
95
+	public function createAnyForeignModelNameField(
96
+		$table_column,
97
+		$nice_name,
98
+		$nullable,
99
+		$default_value = null,
100
+		$model_name
101
+	) {
102
+		return $this->loader->getNew(
103
+			'EE_Any_Foreign_Model_Name_Field',
104
+			array($table_column, $nice_name, $nullable, $default_value, $model_name)
105
+		);
106
+	}
107
+
108
+
109
+	/**
110
+	 * @param string $table_column
111
+	 * @param string $nice_name
112
+	 * @param bool   $nullable
113
+	 * @param null   $default_value
114
+	 * @return EE_Boolean_Field
115
+	 */
116
+	public function createBooleanField($table_column, $nice_name, $nullable, $default_value = null)
117
+	{
118
+		return $this->loader->getNew(
119
+			'EE_Boolean_Field',
120
+			array($table_column, $nice_name, $nullable, $default_value)
121
+		);
122
+	}
123
+
124
+
125
+	/**
126
+	 * @param string $table_column
127
+	 * @param string $nice_name
128
+	 * @param string $timezone_string
129
+	 * @param bool   $nullable
130
+	 * @param string $default_value
131
+	 * @throws EE_Error
132
+	 * @throws InvalidArgumentException
133
+	 * @return EE_Datetime_Field
134
+	 */
135
+	public function createDatetimeField(
136
+		$table_column,
137
+		$nice_name,
138
+		$nullable = false,
139
+		$default_value = EE_Datetime_Field::now
140
+	) {
141
+		return $this->loader->getNew(
142
+			'EE_Datetime_Field',
143
+			array(
144
+				$table_column,
145
+				$nice_name,
146
+				$nullable,
147
+				$default_value,
148
+			)
149
+		);
150
+	}
151
+
152
+
153
+	/**
154
+	 * @param string $table_column
155
+	 * @param string $nice_name
156
+	 * @param bool   $nullable
157
+	 * @param null   $default_value
158
+	 * @return EE_DB_Only_Float_Field
159
+	 */
160
+	public function createDbOnlyFloatField($table_column, $nice_name, $nullable, $default_value = null)
161
+	{
162
+		return $this->loader->getNew(
163
+			'EE_DB_Only_Float_Field',
164
+			array($table_column, $nice_name, $nullable, $default_value)
165
+		);
166
+	}
167
+
168
+
169
+	/**
170
+	 * @param string $table_column
171
+	 * @param string $nice_name
172
+	 * @param bool   $nullable
173
+	 * @param null   $default_value
174
+	 * @return EE_DB_Only_Int_Field
175
+	 */
176
+	public function createDbOnlyIntField($table_column, $nice_name, $nullable, $default_value = null)
177
+	{
178
+		return $this->loader->getNew(
179
+			'EE_DB_Only_Int_Field',
180
+			array($table_column, $nice_name, $nullable, $default_value)
181
+		);
182
+	}
183
+
184
+
185
+	/**
186
+	 * @param string $table_column
187
+	 * @param string $nice_name
188
+	 * @param bool   $nullable
189
+	 * @param null   $default_value
190
+	 * @return EE_DB_Only_Text_Field
191
+	 */
192
+	public function createDbOnlyTextField($table_column, $nice_name, $nullable, $default_value = null)
193
+	{
194
+		return $this->loader->getNew(
195
+			'EE_DB_Only_Text_Field',
196
+			array($table_column, $nice_name, $nullable, $default_value)
197
+		);
198
+	}
199
+
200
+
201
+	/**
202
+	 * @param string $table_column
203
+	 * @param string $nice_name
204
+	 * @param bool   $nullable
205
+	 * @param string $default_value
206
+	 * @return EE_Email_Field
207
+	 */
208
+	public function createEmailField($table_column, $nice_name, $nullable = true, $default_value = '')
209
+	{
210
+		return $this->loader->getNew(
211
+			'EE_Email_Field',
212
+			array($table_column, $nice_name, $nullable, $default_value)
213
+		);
214
+	}
215
+
216
+
217
+	/**
218
+	 * @param string $table_column
219
+	 * @param string $nice_name
220
+	 * @param bool   $nullable
221
+	 * @param null   $default_value
222
+	 * @param array  $allowed_enum_values keys are values to be used in the DB,
223
+	 *                                    values are how they should be displayed
224
+	 * @return EE_Enum_Integer_Field
225
+	 */
226
+	public function createEnumIntegerField(
227
+		$table_column,
228
+		$nice_name,
229
+		$nullable,
230
+		$default_value = null,
231
+		array $allowed_enum_values
232
+	) {
233
+		return $this->loader->getNew(
234
+			'EE_Enum_Integer_Field',
235
+			array($table_column, $nice_name, $nullable, $default_value, $allowed_enum_values)
236
+		);
237
+	}
238
+
239
+
240
+	/**
241
+	 * @param string $table_column
242
+	 * @param string $nice_name
243
+	 * @param bool   $nullable
244
+	 * @param null   $default_value
245
+	 * @param array  $allowed_enum_values keys are values to be used in the DB,
246
+	 *                                    values are how they should be displayed
247
+	 * @return EE_Enum_Text_Field
248
+	 */
249
+	public function createEnumTextField(
250
+		$table_column,
251
+		$nice_name,
252
+		$nullable,
253
+		$default_value,
254
+		array $allowed_enum_values
255
+	) {
256
+		return $this->loader->getNew(
257
+			'EE_Enum_Text_Field',
258
+			array($table_column, $nice_name, $nullable, $default_value, $allowed_enum_values)
259
+		);
260
+	}
261
+
262
+
263
+	/**
264
+	 * @param string $table_column
265
+	 * @param string $nice_name
266
+	 * @param bool   $nullable
267
+	 * @param null   $default_value
268
+	 * @return EE_Float_Field
269
+	 */
270
+	public function createFloatField($table_column, $nice_name, $nullable, $default_value = null)
271
+	{
272
+		return $this->loader->getNew(
273
+			'EE_Float_Field',
274
+			array($table_column, $nice_name, $nullable, $default_value)
275
+		);
276
+	}
277
+
278
+
279
+	/**
280
+	 * @param string $table_column
281
+	 * @param string $nice_name
282
+	 * @param bool   $nullable
283
+	 * @param null   $default_value
284
+	 * @param string $model_name
285
+	 * @return EE_Foreign_Key_Int_Field
286
+	 */
287
+	public function createForeignKeyIntField($table_column, $nice_name, $nullable, $default_value, $model_name)
288
+	{
289
+		return $this->loader->getNew(
290
+			'EE_Foreign_Key_Int_Field',
291
+			array($table_column, $nice_name, $nullable, $default_value, $model_name)
292
+		);
293
+	}
294
+
295
+
296
+	/**
297
+	 * @param string $table_column
298
+	 * @param string $nice_name
299
+	 * @param bool   $nullable
300
+	 * @param null   $default_value
301
+	 * @param string $model_name
302
+	 * @return EE_Foreign_Key_String_Field
303
+	 */
304
+	public function createForeignKeyStringField(
305
+		$table_column,
306
+		$nice_name,
307
+		$nullable,
308
+		$default_value,
309
+		$model_name
310
+	) {
311
+		return $this->loader->getNew(
312
+			'EE_Foreign_Key_String_Field',
313
+			array($table_column, $nice_name, $nullable, $default_value, $model_name)
314
+		);
315
+	}
316
+
317
+
318
+	/**
319
+	 * @param string $table_column
320
+	 * @param string $nice_name
321
+	 * @param bool   $nullable
322
+	 * @param null   $default_value
323
+	 * @return EE_Full_HTML_Field
324
+	 */
325
+	public function createFullHtmlField($table_column, $nice_name, $nullable, $default_value = null)
326
+	{
327
+		return $this->loader->getNew(
328
+			'EE_Full_HTML_Field',
329
+			array($table_column, $nice_name, $nullable, $default_value)
330
+		);
331
+	}
332
+
333
+
334
+	/**
335
+	 * @param string $table_column
336
+	 * @param string $nice_name
337
+	 * @param bool   $nullable
338
+	 * @param null   $default_value
339
+	 * @return EE_Infinite_Integer_Field
340
+	 */
341
+	public function createInfiniteIntegerField($table_column, $nice_name, $nullable, $default_value = null)
342
+	{
343
+		return $this->loader->getNew(
344
+			'EE_Infinite_Integer_Field',
345
+			array($table_column, $nice_name, $nullable, $default_value)
346
+		);
347
+	}
348
+
349
+
350
+	/**
351
+	 * @param string  $table_column
352
+	 * @param string  $nice_name
353
+	 * @param bool    $nullable
354
+	 * @param integer $default_value
355
+	 * @return EE_Integer_Field
356
+	 */
357
+	public function createIntegerField($table_column, $nice_name, $nullable = false, $default_value = 0)
358
+	{
359
+		return $this->loader->getNew(
360
+			'EE_Integer_Field',
361
+			array($table_column, $nice_name, $nullable, $default_value)
362
+		);
363
+	}
364
+
365
+
366
+	/**
367
+	 * @param string $table_column
368
+	 * @param string $nice_name
369
+	 * @param bool   $nullable
370
+	 * @param null   $default_value
371
+	 * @return EE_Maybe_Serialized_Simple_HTML_Field
372
+	 */
373
+	public function createMaybeSerializedSimpleHtmlField($table_column, $nice_name, $nullable, $default_value = null)
374
+	{
375
+		return $this->loader->getNew(
376
+			'EE_Maybe_Serialized_Simple_HTML_Field',
377
+			array($table_column, $nice_name, $nullable, $default_value)
378
+		);
379
+	}
380
+
381
+
382
+	/**
383
+	 * @param string $table_column
384
+	 * @param string $nice_name
385
+	 * @param bool   $nullable
386
+	 * @param null   $default_value
387
+	 * @return EE_Maybe_Serialized_Text_Field
388
+	 */
389
+	public function createMaybeSerializedTextField($table_column, $nice_name, $nullable, $default_value = null)
390
+	{
391
+		return $this->loader->getNew(
392
+			'EE_Maybe_Serialized_Text_Field',
393
+			array($table_column, $nice_name, $nullable, $default_value)
394
+		);
395
+	}
396
+
397
+
398
+	/**
399
+	 * @param string $table_column
400
+	 * @param string $nice_name
401
+	 * @param bool   $nullable
402
+	 * @param null   $default_value
403
+	 * @return EE_Money_Field
404
+	 */
405
+	public function createMoneyField($table_column, $nice_name, $nullable, $default_value = null)
406
+	{
407
+		return $this->loader->getNew(
408
+			'EE_Money_Field',
409
+			array($table_column, $nice_name, $nullable, $default_value)
410
+		);
411
+	}
412
+
413
+
414
+	/**
415
+	 * @param string $table_column
416
+	 * @param string $nice_name
417
+	 * @param bool   $nullable
418
+	 * @param string $default_value
419
+	 * @return EE_Plain_Text_Field
420
+	 */
421
+	public function createPlainTextField($table_column, $nice_name, $nullable = true, $default_value = '')
422
+	{
423
+		return $this->loader->getNew(
424
+			'EE_Plain_Text_Field',
425
+			array($table_column, $nice_name, $nullable, $default_value)
426
+		);
427
+	}
428
+
429
+
430
+	/**
431
+	 * @param string $table_column
432
+	 * @param string $nice_name
433
+	 * @param bool   $nullable
434
+	 * @param null   $default_value
435
+	 * @return EE_Post_Content_Field
436
+	 */
437
+	public function createPostContentField($table_column, $nice_name, $nullable, $default_value = null)
438
+	{
439
+		return $this->loader->getNew(
440
+			'EE_Post_Content_Field',
441
+			array($table_column, $nice_name, $nullable, $default_value)
442
+		);
443
+	}
444
+
445
+
446
+	/**
447
+	 * @param string $table_column
448
+	 * @param string $nice_name
449
+	 * @return EE_Primary_Key_Int_Field
450
+	 */
451
+	public function createPrimaryKeyIntField($table_column, $nice_name)
452
+	{
453
+		return $this->loader->getNew('EE_Primary_Key_Int_Field', array($table_column, $nice_name));
454
+	}
455
+
456
+
457
+	/**
458
+	 * @param string $table_column
459
+	 * @param string $nice_name
460
+	 * @return EE_Primary_Key_String_Field
461
+	 */
462
+	public function createPrimaryKeyStringField($table_column, $nice_name)
463
+	{
464
+		return $this->loader->getNew('EE_Primary_Key_String_Field', array($table_column, $nice_name));
465
+	}
466
+
467
+
468
+	/**
469
+	 * @param string $table_column
470
+	 * @param string $nice_name
471
+	 * @param bool   $nullable
472
+	 * @param null   $default_value
473
+	 * @return EE_Serialized_Text_Field
474
+	 */
475
+	public function createSerializedTextField($table_column, $nice_name, $nullable, $default_value = null)
476
+	{
477
+		return $this->loader->getNew(
478
+			'EE_Serialized_Text_Field',
479
+			array($table_column, $nice_name, $nullable, $default_value)
480
+		);
481
+	}
482
+
483
+
484
+	/**
485
+	 * @param string $table_column
486
+	 * @param string $nice_name
487
+	 * @param bool   $nullable
488
+	 * @param null   $default_value
489
+	 * @return EE_Simple_HTML_Field
490
+	 */
491
+	public function createSimpleHtmlField($table_column, $nice_name, $nullable, $default_value = null)
492
+	{
493
+		return $this->loader->getNew(
494
+			'EE_Simple_HTML_Field',
495
+			array($table_column, $nice_name, $nullable, $default_value)
496
+		);
497
+	}
498
+
499
+
500
+	/**
501
+	 * @param string $table_column
502
+	 * @param string $nice_name
503
+	 * @param bool   $nullable
504
+	 * @param null   $default_value
505
+	 * @return EE_Slug_Field
506
+	 */
507
+	public function createSlugField($table_column, $nice_name, $nullable = false, $default_value = null)
508
+	{
509
+		return $this->loader->getNew(
510
+			'EE_Slug_Field',
511
+			array($table_column, $nice_name, $nullable, $default_value)
512
+		);
513
+	}
514
+
515
+
516
+	/**
517
+	 * @param string $table_column
518
+	 * @param string $nice_name
519
+	 * @param bool   $nullable
520
+	 * @param null   $default_value
521
+	 * @return EE_Trashed_Flag_Field
522
+	 */
523
+	public function createTrashedFlagField($table_column, $nice_name, $nullable, $default_value = null)
524
+	{
525
+		return $this->loader->getNew(
526
+			'EE_Trashed_Flag_Field',
527
+			array($table_column, $nice_name, $nullable, $default_value)
528
+		);
529
+	}
530
+
531
+
532
+	/**
533
+	 * @param string $table_column
534
+	 * @param string $nice_name
535
+	 * @param bool   $nullable
536
+	 * @param mixed  $default_value
537
+	 * @param array  $values                            If additional stati are to be used other than the default WP
538
+	 *                                                  statuses, then they can be registered via this property. The
539
+	 *                                                  format of the array should be as follows: array(
540
+	 *                                                  'status_reference' => array(
541
+	 *                                                  'label' => __('Status Reference Label', 'event_espresso'),
542
+	 *                                                  'public' => true,                 // whether this status should
543
+	 *                                                  be shown on the frontend of the site
544
+	 *                                                  'exclude_from_search' => false,   // whether this status should
545
+	 *                                                  be excluded from wp searches
546
+	 *                                                  'show_in_admin_all_list' => true, // whether this status is
547
+	 *                                                  included in queries for the admin "all" view in list table
548
+	 *                                                  views.
549
+	 *                                                  'show_in_admin_status_list' => true, // show in the list of
550
+	 *                                                  statuses with post counts at the top of the admin list tables
551
+	 *                                                  (i.e. Status Reference(2) )
552
+	 *                                                  'label_count' => _n_noop(
553
+	 *                                                  'Status Reference <span class="count">(%s)</span>',
554
+	 *                                                  'Status References <span class="count">(%s)</span>'
555
+	 *                                                  ),                                   // the text to display on
556
+	 *                                                  the admin screen
557
+	 *                                                  ( or you won't see your status count ).
558
+	 *                                                  )
559
+	 *                                                  )
560
+	 * @link http://codex.wordpress.org/Function_Reference/register_post_status for more info
561
+	 * @return EE_WP_Post_Status_Field
562
+	 */
563
+	public function createWpPostStatusField(
564
+		$table_column,
565
+		$nice_name,
566
+		$nullable,
567
+		$default_value = null,
568
+		array $values = array()
569
+	) {
570
+		return $this->loader->getNew(
571
+			'EE_WP_Post_Status_Field',
572
+			array($table_column, $nice_name, $nullable, $default_value, $values)
573
+		);
574
+	}
575
+
576
+
577
+	/**
578
+	 * @param string $post_type
579
+	 * @return EE_WP_Post_Type_Field
580
+	 */
581
+	public function createWpPostTypeField($post_type)
582
+	{
583
+		return $this->loader->getNew('EE_WP_Post_Type_Field', array($post_type));
584
+	}
585
+
586
+
587
+	/**
588
+	 * @param string $table_column
589
+	 * @param string $nice_name
590
+	 * @param bool   $nullable
591
+	 * @return EE_WP_User_Field
592
+	 */
593
+	public function createWpUserField($table_column, $nice_name, $nullable)
594
+	{
595
+		return $this->loader->getNew('EE_WP_User_Field', array($table_column, $nice_name, $nullable));
596
+	}
597 597
 }
Please login to merge, or discard this patch.
modules/ticket_selector/ProcessTicketSelector.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -473,7 +473,7 @@
 block discarded – undo
473 473
      *
474 474
      * @param EE_Ticket $ticket
475 475
      * @param int       $qty
476
-     * @return TRUE on success, FALSE on fail
476
+     * @return boolean on success, FALSE on fail
477 477
      * @throws InvalidArgumentException
478 478
      * @throws InvalidInterfaceException
479 479
      * @throws InvalidDataTypeException
Please login to merge, or discard this patch.
Indentation   +497 added lines, -497 removed lines patch added patch discarded remove patch
@@ -33,526 +33,526 @@
 block discarded – undo
33 33
 class ProcessTicketSelector
34 34
 {
35 35
 
36
-    /**
37
-     * @var EE_Cart $cart
38
-     */
39
-    private $cart;
36
+	/**
37
+	 * @var EE_Cart $cart
38
+	 */
39
+	private $cart;
40 40
 
41
-    /**
42
-     * @var EE_Core_Config $core_config
43
-     */
44
-    private $core_config;
41
+	/**
42
+	 * @var EE_Core_Config $core_config
43
+	 */
44
+	private $core_config;
45 45
 
46
-    /**
47
-     * @var Request $request
48
-     */
49
-    private $request;
46
+	/**
47
+	 * @var Request $request
48
+	 */
49
+	private $request;
50 50
 
51
-    /**
52
-     * @var EE_Session $session
53
-     */
54
-    private $session;
51
+	/**
52
+	 * @var EE_Session $session
53
+	 */
54
+	private $session;
55 55
 
56
-    /**
57
-     * @var EEM_Ticket $ticket_model
58
-     */
59
-    private $ticket_model;
56
+	/**
57
+	 * @var EEM_Ticket $ticket_model
58
+	 */
59
+	private $ticket_model;
60 60
 
61
-    /**
62
-     * @var TicketDatetimeAvailabilityTracker $tracker
63
-     */
64
-    private $tracker;
61
+	/**
62
+	 * @var TicketDatetimeAvailabilityTracker $tracker
63
+	 */
64
+	private $tracker;
65 65
 
66 66
 
67
-    /**
68
-     * ProcessTicketSelector constructor.
69
-     * NOTE: PLZ use the Loader to instantiate this class if need be
70
-     * so that all dependencies get injected correctly (which will happen automatically)
71
-     * Null values for parameters are only for backwards compatibility but will be removed later on.
72
-     *
73
-     * @param EE_Core_Config                    $core_config
74
-     * @param Request                           $request
75
-     * @param EE_Session                        $session
76
-     * @param EEM_Ticket                        $ticket_model
77
-     * @param TicketDatetimeAvailabilityTracker $tracker
78
-     * @throws InvalidArgumentException
79
-     * @throws InvalidDataTypeException
80
-     * @throws InvalidInterfaceException
81
-     */
82
-    public function __construct(
83
-        EE_Core_Config $core_config = null,
84
-        Request $request = null,
85
-        EE_Session $session = null,
86
-        EEM_Ticket $ticket_model = null,
87
-        TicketDatetimeAvailabilityTracker $tracker = null
88
-    ) {
89
-        /** @var LoaderInterface $loader */
90
-        $loader = LoaderFactory::getLoader();
91
-        $this->core_config = $core_config instanceof EE_Core_Config
92
-            ? $core_config
93
-            : $loader->getShared('EE_Core_Config');
94
-        $this->request = $request instanceof Request
95
-            ? $request
96
-            : $loader->getShared('EventEspresso\core\services\request\Request');
97
-        $this->session = $session instanceof EE_Session
98
-            ? $session
99
-            : $loader->getShared('EE_Session');
100
-        $this->ticket_model = $ticket_model instanceof EEM_Ticket
101
-            ? $ticket_model
102
-            : $loader->getShared('EEM_Ticket');
103
-        $this->tracker = $tracker instanceof TicketDatetimeAvailabilityTracker
104
-            ? $tracker
105
-            : $loader->getShared('EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker');
106
-    }
67
+	/**
68
+	 * ProcessTicketSelector constructor.
69
+	 * NOTE: PLZ use the Loader to instantiate this class if need be
70
+	 * so that all dependencies get injected correctly (which will happen automatically)
71
+	 * Null values for parameters are only for backwards compatibility but will be removed later on.
72
+	 *
73
+	 * @param EE_Core_Config                    $core_config
74
+	 * @param Request                           $request
75
+	 * @param EE_Session                        $session
76
+	 * @param EEM_Ticket                        $ticket_model
77
+	 * @param TicketDatetimeAvailabilityTracker $tracker
78
+	 * @throws InvalidArgumentException
79
+	 * @throws InvalidDataTypeException
80
+	 * @throws InvalidInterfaceException
81
+	 */
82
+	public function __construct(
83
+		EE_Core_Config $core_config = null,
84
+		Request $request = null,
85
+		EE_Session $session = null,
86
+		EEM_Ticket $ticket_model = null,
87
+		TicketDatetimeAvailabilityTracker $tracker = null
88
+	) {
89
+		/** @var LoaderInterface $loader */
90
+		$loader = LoaderFactory::getLoader();
91
+		$this->core_config = $core_config instanceof EE_Core_Config
92
+			? $core_config
93
+			: $loader->getShared('EE_Core_Config');
94
+		$this->request = $request instanceof Request
95
+			? $request
96
+			: $loader->getShared('EventEspresso\core\services\request\Request');
97
+		$this->session = $session instanceof EE_Session
98
+			? $session
99
+			: $loader->getShared('EE_Session');
100
+		$this->ticket_model = $ticket_model instanceof EEM_Ticket
101
+			? $ticket_model
102
+			: $loader->getShared('EEM_Ticket');
103
+		$this->tracker = $tracker instanceof TicketDatetimeAvailabilityTracker
104
+			? $tracker
105
+			: $loader->getShared('EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker');
106
+	}
107 107
 
108 108
 
109
-    /**
110
-     * cancelTicketSelections
111
-     *
112
-     * @return bool
113
-     * @throws EE_Error
114
-     * @throws InvalidArgumentException
115
-     * @throws InvalidInterfaceException
116
-     * @throws InvalidDataTypeException
117
-     */
118
-    public function cancelTicketSelections()
119
-    {
120
-        // check nonce
121
-        if (! $this->processTicketSelectorNonce('cancel_ticket_selections')) {
122
-            return false;
123
-        }
124
-        $this->session->clear_session(__CLASS__, __FUNCTION__);
125
-        if ($this->request->requestParamIsSet('event_id')) {
126
-            EEH_URL::safeRedirectAndExit(
127
-                EEH_Event_View::event_link_url(
128
-                    $this->request->getRequestParam('event_id')
129
-                )
130
-            );
131
-        }
132
-        EEH_URL::safeRedirectAndExit(
133
-            site_url('/' . $this->core_config->event_cpt_slug . '/')
134
-        );
135
-        return true;
136
-    }
109
+	/**
110
+	 * cancelTicketSelections
111
+	 *
112
+	 * @return bool
113
+	 * @throws EE_Error
114
+	 * @throws InvalidArgumentException
115
+	 * @throws InvalidInterfaceException
116
+	 * @throws InvalidDataTypeException
117
+	 */
118
+	public function cancelTicketSelections()
119
+	{
120
+		// check nonce
121
+		if (! $this->processTicketSelectorNonce('cancel_ticket_selections')) {
122
+			return false;
123
+		}
124
+		$this->session->clear_session(__CLASS__, __FUNCTION__);
125
+		if ($this->request->requestParamIsSet('event_id')) {
126
+			EEH_URL::safeRedirectAndExit(
127
+				EEH_Event_View::event_link_url(
128
+					$this->request->getRequestParam('event_id')
129
+				)
130
+			);
131
+		}
132
+		EEH_URL::safeRedirectAndExit(
133
+			site_url('/' . $this->core_config->event_cpt_slug . '/')
134
+		);
135
+		return true;
136
+	}
137 137
 
138 138
 
139
-    /**
140
-     * processTicketSelectorNonce
141
-     *
142
-     * @param  string $nonce_name
143
-     * @param string  $id
144
-     * @return bool
145
-     */
146
-    private function processTicketSelectorNonce($nonce_name, $id = '')
147
-    {
148
-        $nonce_name_with_id = ! empty($id) ? "{$nonce_name}_nonce_{$id}" : "{$nonce_name}_nonce";
149
-        if (! $this->request->isAdmin()
150
-            && (
151
-                ! $this->request->is_set($nonce_name_with_id)
152
-                || ! wp_verify_nonce(
153
-                    $this->request->get($nonce_name_with_id),
154
-                    $nonce_name
155
-                )
156
-            )
157
-        ) {
158
-            EE_Error::add_error(
159
-                sprintf(
160
-                    esc_html__(
161
-                        'We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.',
162
-                        'event_espresso'
163
-                    ),
164
-                    '<br/>'
165
-                ),
166
-                __FILE__,
167
-                __FUNCTION__,
168
-                __LINE__
169
-            );
170
-            return false;
171
-        }
172
-        return true;
173
-    }
139
+	/**
140
+	 * processTicketSelectorNonce
141
+	 *
142
+	 * @param  string $nonce_name
143
+	 * @param string  $id
144
+	 * @return bool
145
+	 */
146
+	private function processTicketSelectorNonce($nonce_name, $id = '')
147
+	{
148
+		$nonce_name_with_id = ! empty($id) ? "{$nonce_name}_nonce_{$id}" : "{$nonce_name}_nonce";
149
+		if (! $this->request->isAdmin()
150
+			&& (
151
+				! $this->request->is_set($nonce_name_with_id)
152
+				|| ! wp_verify_nonce(
153
+					$this->request->get($nonce_name_with_id),
154
+					$nonce_name
155
+				)
156
+			)
157
+		) {
158
+			EE_Error::add_error(
159
+				sprintf(
160
+					esc_html__(
161
+						'We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.',
162
+						'event_espresso'
163
+					),
164
+					'<br/>'
165
+				),
166
+				__FILE__,
167
+				__FUNCTION__,
168
+				__LINE__
169
+			);
170
+			return false;
171
+		}
172
+		return true;
173
+	}
174 174
 
175 175
 
176
-    /**
177
-     * process_ticket_selections
178
-     *
179
-     * @return array|bool
180
-     * @throws EE_Error
181
-     * @throws InvalidArgumentException
182
-     * @throws InvalidDataTypeException
183
-     * @throws InvalidInterfaceException
184
-     */
185
-    public function processTicketSelections()
186
-    {
187
-        do_action('EED_Ticket_Selector__process_ticket_selections__before');
188
-        if ($this->request->isBot()) {
189
-            EEH_URL::safeRedirectAndExit(
190
-                apply_filters(
191
-                    'FHEE__EE_Ticket_Selector__process_ticket_selections__bot_redirect_url',
192
-                    site_url()
193
-                )
194
-            );
195
-        }
196
-        // do we have an event id?
197
-        $id = $this->getEventId();
198
-        // we should really only have 1 registration in the works now
199
-        // (ie, no MER) so unless otherwise requested, clear the session
200
-        if (apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', true)) {
201
-            $this->session->clear_session(__CLASS__, __FUNCTION__);
202
-        }
203
-        // validate/sanitize/filter data
204
-        $valid = apply_filters(
205
-            'FHEE__EED_Ticket_Selector__process_ticket_selections__valid_post_data',
206
-            $this->validatePostData($id)
207
-        );
208
-        // check total tickets ordered vs max number of attendees that can register
209
-        if ($valid['total_tickets'] > $valid['max_atndz']) {
210
-            $this->maxAttendeesViolation($valid);
211
-        } else {
212
-            // all data appears to be valid
213
-            if ($this->processSuccessfulCart($this->addTicketsToCart($valid))) {
214
-                return true;
215
-            }
216
-        }
217
-        // die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL BEFORE REDIRECT
218
-        // at this point, just return if registration is being made from admin
219
-        if ($this->request->isAdmin() || $this->request->isFrontAjax()) {
220
-            return false;
221
-        }
222
-        if ($valid['return_url']) {
223
-            EEH_URL::safeRedirectAndExit($valid['return_url']);
224
-        }
225
-        if ($id) {
226
-            EEH_URL::safeRedirectAndExit(get_permalink($id));
227
-        }
228
-        echo EE_Error::get_notices();
229
-        return false;
230
-    }
176
+	/**
177
+	 * process_ticket_selections
178
+	 *
179
+	 * @return array|bool
180
+	 * @throws EE_Error
181
+	 * @throws InvalidArgumentException
182
+	 * @throws InvalidDataTypeException
183
+	 * @throws InvalidInterfaceException
184
+	 */
185
+	public function processTicketSelections()
186
+	{
187
+		do_action('EED_Ticket_Selector__process_ticket_selections__before');
188
+		if ($this->request->isBot()) {
189
+			EEH_URL::safeRedirectAndExit(
190
+				apply_filters(
191
+					'FHEE__EE_Ticket_Selector__process_ticket_selections__bot_redirect_url',
192
+					site_url()
193
+				)
194
+			);
195
+		}
196
+		// do we have an event id?
197
+		$id = $this->getEventId();
198
+		// we should really only have 1 registration in the works now
199
+		// (ie, no MER) so unless otherwise requested, clear the session
200
+		if (apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', true)) {
201
+			$this->session->clear_session(__CLASS__, __FUNCTION__);
202
+		}
203
+		// validate/sanitize/filter data
204
+		$valid = apply_filters(
205
+			'FHEE__EED_Ticket_Selector__process_ticket_selections__valid_post_data',
206
+			$this->validatePostData($id)
207
+		);
208
+		// check total tickets ordered vs max number of attendees that can register
209
+		if ($valid['total_tickets'] > $valid['max_atndz']) {
210
+			$this->maxAttendeesViolation($valid);
211
+		} else {
212
+			// all data appears to be valid
213
+			if ($this->processSuccessfulCart($this->addTicketsToCart($valid))) {
214
+				return true;
215
+			}
216
+		}
217
+		// die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL BEFORE REDIRECT
218
+		// at this point, just return if registration is being made from admin
219
+		if ($this->request->isAdmin() || $this->request->isFrontAjax()) {
220
+			return false;
221
+		}
222
+		if ($valid['return_url']) {
223
+			EEH_URL::safeRedirectAndExit($valid['return_url']);
224
+		}
225
+		if ($id) {
226
+			EEH_URL::safeRedirectAndExit(get_permalink($id));
227
+		}
228
+		echo EE_Error::get_notices();
229
+		return false;
230
+	}
231 231
 
232 232
 
233
-    /**
234
-     * @return int
235
-     */
236
-    private function getEventId()
237
-    {
238
-        // do we have an event id?
239
-        if (! $this->request->requestParamIsSet('tkt-slctr-event-id')) {
240
-            // $_POST['tkt-slctr-event-id'] was not set ?!?!?!?
241
-            EE_Error::add_error(
242
-                sprintf(
243
-                    esc_html__(
244
-                        'An event id was not provided or was not received.%sPlease click the back button on your browser and try again.',
245
-                        'event_espresso'
246
-                    ),
247
-                    '<br/>'
248
-                ),
249
-                __FILE__,
250
-                __FUNCTION__,
251
-                __LINE__
252
-            );
253
-        }
254
-        // if event id is valid
255
-        return absint($this->request->getRequestParam('tkt-slctr-event-id'));
256
-    }
233
+	/**
234
+	 * @return int
235
+	 */
236
+	private function getEventId()
237
+	{
238
+		// do we have an event id?
239
+		if (! $this->request->requestParamIsSet('tkt-slctr-event-id')) {
240
+			// $_POST['tkt-slctr-event-id'] was not set ?!?!?!?
241
+			EE_Error::add_error(
242
+				sprintf(
243
+					esc_html__(
244
+						'An event id was not provided or was not received.%sPlease click the back button on your browser and try again.',
245
+						'event_espresso'
246
+					),
247
+					'<br/>'
248
+				),
249
+				__FILE__,
250
+				__FUNCTION__,
251
+				__LINE__
252
+			);
253
+		}
254
+		// if event id is valid
255
+		return absint($this->request->getRequestParam('tkt-slctr-event-id'));
256
+	}
257 257
 
258 258
 
259
-    /**
260
-     * validate_post_data
261
-     *
262
-     * @param int $id
263
-     * @return array|FALSE
264
-     */
265
-    private function validatePostData($id = 0)
266
-    {
267
-        if (! $id) {
268
-            EE_Error::add_error(
269
-                esc_html__('The event id provided was not valid.', 'event_espresso'),
270
-                __FILE__,
271
-                __FUNCTION__,
272
-                __LINE__
273
-            );
274
-            return false;
275
-        }
276
-        // start with an empty array()
277
-        $valid_data = array();
278
-        // grab valid id
279
-        $valid_data['id'] = $id;
280
-        // array of other form names
281
-        $inputs_to_clean = array(
282
-            'event_id'   => 'tkt-slctr-event-id',
283
-            'max_atndz'  => 'tkt-slctr-max-atndz-',
284
-            'rows'       => 'tkt-slctr-rows-',
285
-            'qty'        => 'tkt-slctr-qty-',
286
-            'ticket_id'  => 'tkt-slctr-ticket-id-',
287
-            'return_url' => 'tkt-slctr-return-url-',
288
-        );
289
-        // let's track the total number of tickets ordered.'
290
-        $valid_data['total_tickets'] = 0;
291
-        // cycle through $inputs_to_clean array
292
-        foreach ($inputs_to_clean as $what => $input_to_clean) {
293
-            // check for POST data
294
-            if ($this->request->requestParamIsSet($input_to_clean . $id)) {
295
-                // grab value
296
-                $input_value = $this->request->getRequestParam($input_to_clean . $id);
297
-                switch ($what) {
298
-                    // integers
299
-                    case 'event_id':
300
-                        $valid_data[ $what ] = absint($input_value);
301
-                        // get event via the event id we put in the form
302
-                        break;
303
-                    case 'rows':
304
-                    case 'max_atndz':
305
-                        $valid_data[ $what ] = absint($input_value);
306
-                        break;
307
-                    // arrays of integers
308
-                    case 'qty':
309
-                        /** @var array $row_qty */
310
-                        $row_qty = $input_value;
311
-                        // if qty is coming from a radio button input, then we need to assemble an array of rows
312
-                        if (! is_array($row_qty)) {
313
-                            /** @var string $row_qty */
314
-                            // get number of rows
315
-                            $rows = $this->request->requestParamIsSet('tkt-slctr-rows-' . $id)
316
-                                ? absint($this->request->getRequestParam('tkt-slctr-rows-' . $id))
317
-                                : 1;
318
-                            // explode integers by the dash
319
-                            $row_qty = explode('-', $row_qty);
320
-                            $row = isset($row_qty[0]) ? absint($row_qty[0]) : 1;
321
-                            $qty = isset($row_qty[1]) ? absint($row_qty[1]) : 0;
322
-                            $row_qty = array($row => $qty);
323
-                            for ($x = 1; $x <= $rows; $x++) {
324
-                                if (! isset($row_qty[ $x ])) {
325
-                                    $row_qty[ $x ] = 0;
326
-                                }
327
-                            }
328
-                        }
329
-                        ksort($row_qty);
330
-                        // cycle thru values
331
-                        foreach ($row_qty as $qty) {
332
-                            $qty = absint($qty);
333
-                            // sanitize as integers
334
-                            $valid_data[ $what ][] = $qty;
335
-                            $valid_data['total_tickets'] += $qty;
336
-                        }
337
-                        break;
338
-                    // array of integers
339
-                    case 'ticket_id':
340
-                        // cycle thru values
341
-                        foreach ((array) $input_value as $key => $value) {
342
-                            // allow only integers
343
-                            $valid_data[ $what ][ $key ] = absint($value);
344
-                        }
345
-                        break;
346
-                    case 'return_url':
347
-                        // grab and sanitize return-url
348
-                        $input_value = esc_url_raw($input_value);
349
-                        // was the request coming from an iframe ? if so, then:
350
-                        if (strpos($input_value, 'event_list=iframe')) {
351
-                            // get anchor fragment
352
-                            $input_value = explode('#', $input_value);
353
-                            $input_value = end($input_value);
354
-                            // use event list url instead, but append anchor
355
-                            $input_value = EEH_Event_View::event_archive_url() . '#' . $input_value;
356
-                        }
357
-                        $valid_data[ $what ] = $input_value;
358
-                        break;
359
-                }    // end switch $what
360
-            }
361
-        }    // end foreach $inputs_to_clean
362
-        return $valid_data;
363
-    }
259
+	/**
260
+	 * validate_post_data
261
+	 *
262
+	 * @param int $id
263
+	 * @return array|FALSE
264
+	 */
265
+	private function validatePostData($id = 0)
266
+	{
267
+		if (! $id) {
268
+			EE_Error::add_error(
269
+				esc_html__('The event id provided was not valid.', 'event_espresso'),
270
+				__FILE__,
271
+				__FUNCTION__,
272
+				__LINE__
273
+			);
274
+			return false;
275
+		}
276
+		// start with an empty array()
277
+		$valid_data = array();
278
+		// grab valid id
279
+		$valid_data['id'] = $id;
280
+		// array of other form names
281
+		$inputs_to_clean = array(
282
+			'event_id'   => 'tkt-slctr-event-id',
283
+			'max_atndz'  => 'tkt-slctr-max-atndz-',
284
+			'rows'       => 'tkt-slctr-rows-',
285
+			'qty'        => 'tkt-slctr-qty-',
286
+			'ticket_id'  => 'tkt-slctr-ticket-id-',
287
+			'return_url' => 'tkt-slctr-return-url-',
288
+		);
289
+		// let's track the total number of tickets ordered.'
290
+		$valid_data['total_tickets'] = 0;
291
+		// cycle through $inputs_to_clean array
292
+		foreach ($inputs_to_clean as $what => $input_to_clean) {
293
+			// check for POST data
294
+			if ($this->request->requestParamIsSet($input_to_clean . $id)) {
295
+				// grab value
296
+				$input_value = $this->request->getRequestParam($input_to_clean . $id);
297
+				switch ($what) {
298
+					// integers
299
+					case 'event_id':
300
+						$valid_data[ $what ] = absint($input_value);
301
+						// get event via the event id we put in the form
302
+						break;
303
+					case 'rows':
304
+					case 'max_atndz':
305
+						$valid_data[ $what ] = absint($input_value);
306
+						break;
307
+					// arrays of integers
308
+					case 'qty':
309
+						/** @var array $row_qty */
310
+						$row_qty = $input_value;
311
+						// if qty is coming from a radio button input, then we need to assemble an array of rows
312
+						if (! is_array($row_qty)) {
313
+							/** @var string $row_qty */
314
+							// get number of rows
315
+							$rows = $this->request->requestParamIsSet('tkt-slctr-rows-' . $id)
316
+								? absint($this->request->getRequestParam('tkt-slctr-rows-' . $id))
317
+								: 1;
318
+							// explode integers by the dash
319
+							$row_qty = explode('-', $row_qty);
320
+							$row = isset($row_qty[0]) ? absint($row_qty[0]) : 1;
321
+							$qty = isset($row_qty[1]) ? absint($row_qty[1]) : 0;
322
+							$row_qty = array($row => $qty);
323
+							for ($x = 1; $x <= $rows; $x++) {
324
+								if (! isset($row_qty[ $x ])) {
325
+									$row_qty[ $x ] = 0;
326
+								}
327
+							}
328
+						}
329
+						ksort($row_qty);
330
+						// cycle thru values
331
+						foreach ($row_qty as $qty) {
332
+							$qty = absint($qty);
333
+							// sanitize as integers
334
+							$valid_data[ $what ][] = $qty;
335
+							$valid_data['total_tickets'] += $qty;
336
+						}
337
+						break;
338
+					// array of integers
339
+					case 'ticket_id':
340
+						// cycle thru values
341
+						foreach ((array) $input_value as $key => $value) {
342
+							// allow only integers
343
+							$valid_data[ $what ][ $key ] = absint($value);
344
+						}
345
+						break;
346
+					case 'return_url':
347
+						// grab and sanitize return-url
348
+						$input_value = esc_url_raw($input_value);
349
+						// was the request coming from an iframe ? if so, then:
350
+						if (strpos($input_value, 'event_list=iframe')) {
351
+							// get anchor fragment
352
+							$input_value = explode('#', $input_value);
353
+							$input_value = end($input_value);
354
+							// use event list url instead, but append anchor
355
+							$input_value = EEH_Event_View::event_archive_url() . '#' . $input_value;
356
+						}
357
+						$valid_data[ $what ] = $input_value;
358
+						break;
359
+				}    // end switch $what
360
+			}
361
+		}    // end foreach $inputs_to_clean
362
+		return $valid_data;
363
+	}
364 364
 
365 365
 
366
-    /**
367
-     * @param array $valid
368
-     */
369
-    private function maxAttendeesViolation(array $valid)
370
-    {
371
-        // ordering too many tickets !!!
372
-        $total_tickets_string = esc_html(
373
-            _n(
374
-                'You have attempted to purchase %s ticket.',
375
-                'You have attempted to purchase %s tickets.',
376
-                $valid['total_tickets'],
377
-                'event_espresso'
378
-            )
379
-        );
380
-        $limit_error_1 = sprintf($total_tickets_string, $valid['total_tickets']);
381
-        // dev only message
382
-        $max_attendees_string = esc_html(
383
-            _n(
384
-                'The registration limit for this event is %s ticket per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.',
385
-                'The registration limit for this event is %s tickets per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.',
386
-                $valid['max_atndz'],
387
-                'event_espresso'
388
-            )
389
-        );
390
-        $limit_error_2 = sprintf($max_attendees_string, $valid['max_atndz'], $valid['max_atndz']);
391
-        EE_Error::add_error($limit_error_1 . '<br/>' . $limit_error_2, __FILE__, __FUNCTION__, __LINE__);
392
-    }
366
+	/**
367
+	 * @param array $valid
368
+	 */
369
+	private function maxAttendeesViolation(array $valid)
370
+	{
371
+		// ordering too many tickets !!!
372
+		$total_tickets_string = esc_html(
373
+			_n(
374
+				'You have attempted to purchase %s ticket.',
375
+				'You have attempted to purchase %s tickets.',
376
+				$valid['total_tickets'],
377
+				'event_espresso'
378
+			)
379
+		);
380
+		$limit_error_1 = sprintf($total_tickets_string, $valid['total_tickets']);
381
+		// dev only message
382
+		$max_attendees_string = esc_html(
383
+			_n(
384
+				'The registration limit for this event is %s ticket per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.',
385
+				'The registration limit for this event is %s tickets per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.',
386
+				$valid['max_atndz'],
387
+				'event_espresso'
388
+			)
389
+		);
390
+		$limit_error_2 = sprintf($max_attendees_string, $valid['max_atndz'], $valid['max_atndz']);
391
+		EE_Error::add_error($limit_error_1 . '<br/>' . $limit_error_2, __FILE__, __FUNCTION__, __LINE__);
392
+	}
393 393
 
394 394
 
395
-    /**
396
-     * @param array $valid
397
-     * @return int|TRUE
398
-     * @throws EE_Error
399
-     * @throws InvalidArgumentException
400
-     * @throws InvalidDataTypeException
401
-     * @throws InvalidInterfaceException
402
-     */
403
-    private function addTicketsToCart(array $valid)
404
-    {
405
-        $tickets_added = 0;
406
-        $tickets_selected = false;
407
-        if ($valid['total_tickets'] > 0) {
408
-            // load cart using factory because we don't want to do so until actually needed
409
-            $this->cart = CartFactory::getCart();
410
-            // cycle thru the number of data rows sent from the event listing
411
-            for ($x = 0; $x < $valid['rows']; $x++) {
412
-                // does this row actually contain a ticket quantity?
413
-                if (isset($valid['qty'][ $x ]) && $valid['qty'][ $x ] > 0) {
414
-                    // YES we have a ticket quantity
415
-                    $tickets_selected = true;
416
-                    $valid_ticket = false;
417
-                    // \EEH_Debug_Tools::printr(
418
-                    //     $valid['ticket_id'][ $x ],
419
-                    //     '$valid[\'ticket_id\'][ $x ]',
420
-                    //     __FILE__, __LINE__
421
-                    // );
422
-                    if (isset($valid['ticket_id'][ $x ])) {
423
-                        // get ticket via the ticket id we put in the form
424
-                        $ticket = $this->ticket_model->get_one_by_ID($valid['ticket_id'][ $x ]);
425
-                        if ($ticket instanceof EE_Ticket) {
426
-                            $valid_ticket = true;
427
-                            $tickets_added += $this->addTicketToCart(
428
-                                $ticket,
429
-                                $valid['qty'][ $x ]
430
-                            );
431
-                        }
432
-                    }
433
-                    if ($valid_ticket !== true) {
434
-                        // nothing added to cart retrieved
435
-                        EE_Error::add_error(
436
-                            sprintf(
437
-                                esc_html__(
438
-                                    'A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.',
439
-                                    'event_espresso'
440
-                                ),
441
-                                '<br/>'
442
-                            ),
443
-                            __FILE__,
444
-                            __FUNCTION__,
445
-                            __LINE__
446
-                        );
447
-                    }
448
-                    if (EE_Error::has_error()) {
449
-                        break;
450
-                    }
451
-                }
452
-            }
453
-        }
454
-        do_action(
455
-            'AHEE__EE_Ticket_Selector__process_ticket_selections__after_tickets_added_to_cart',
456
-            $this->cart,
457
-            $this
458
-        );
459
-        if (! apply_filters('FHEE__EED_Ticket_Selector__process_ticket_selections__tckts_slctd', $tickets_selected)) {
460
-            // no ticket quantities were selected
461
-            EE_Error::add_error(
462
-                esc_html__('You need to select a ticket quantity before you can proceed.', 'event_espresso'),
463
-                __FILE__,
464
-                __FUNCTION__,
465
-                __LINE__
466
-            );
467
-        }
468
-        return $tickets_added;
469
-    }
395
+	/**
396
+	 * @param array $valid
397
+	 * @return int|TRUE
398
+	 * @throws EE_Error
399
+	 * @throws InvalidArgumentException
400
+	 * @throws InvalidDataTypeException
401
+	 * @throws InvalidInterfaceException
402
+	 */
403
+	private function addTicketsToCart(array $valid)
404
+	{
405
+		$tickets_added = 0;
406
+		$tickets_selected = false;
407
+		if ($valid['total_tickets'] > 0) {
408
+			// load cart using factory because we don't want to do so until actually needed
409
+			$this->cart = CartFactory::getCart();
410
+			// cycle thru the number of data rows sent from the event listing
411
+			for ($x = 0; $x < $valid['rows']; $x++) {
412
+				// does this row actually contain a ticket quantity?
413
+				if (isset($valid['qty'][ $x ]) && $valid['qty'][ $x ] > 0) {
414
+					// YES we have a ticket quantity
415
+					$tickets_selected = true;
416
+					$valid_ticket = false;
417
+					// \EEH_Debug_Tools::printr(
418
+					//     $valid['ticket_id'][ $x ],
419
+					//     '$valid[\'ticket_id\'][ $x ]',
420
+					//     __FILE__, __LINE__
421
+					// );
422
+					if (isset($valid['ticket_id'][ $x ])) {
423
+						// get ticket via the ticket id we put in the form
424
+						$ticket = $this->ticket_model->get_one_by_ID($valid['ticket_id'][ $x ]);
425
+						if ($ticket instanceof EE_Ticket) {
426
+							$valid_ticket = true;
427
+							$tickets_added += $this->addTicketToCart(
428
+								$ticket,
429
+								$valid['qty'][ $x ]
430
+							);
431
+						}
432
+					}
433
+					if ($valid_ticket !== true) {
434
+						// nothing added to cart retrieved
435
+						EE_Error::add_error(
436
+							sprintf(
437
+								esc_html__(
438
+									'A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.',
439
+									'event_espresso'
440
+								),
441
+								'<br/>'
442
+							),
443
+							__FILE__,
444
+							__FUNCTION__,
445
+							__LINE__
446
+						);
447
+					}
448
+					if (EE_Error::has_error()) {
449
+						break;
450
+					}
451
+				}
452
+			}
453
+		}
454
+		do_action(
455
+			'AHEE__EE_Ticket_Selector__process_ticket_selections__after_tickets_added_to_cart',
456
+			$this->cart,
457
+			$this
458
+		);
459
+		if (! apply_filters('FHEE__EED_Ticket_Selector__process_ticket_selections__tckts_slctd', $tickets_selected)) {
460
+			// no ticket quantities were selected
461
+			EE_Error::add_error(
462
+				esc_html__('You need to select a ticket quantity before you can proceed.', 'event_espresso'),
463
+				__FILE__,
464
+				__FUNCTION__,
465
+				__LINE__
466
+			);
467
+		}
468
+		return $tickets_added;
469
+	}
470 470
 
471 471
 
472
-    /**
473
-     * adds a ticket to the cart
474
-     *
475
-     * @param EE_Ticket $ticket
476
-     * @param int       $qty
477
-     * @return TRUE on success, FALSE on fail
478
-     * @throws InvalidArgumentException
479
-     * @throws InvalidInterfaceException
480
-     * @throws InvalidDataTypeException
481
-     * @throws EE_Error
482
-     */
483
-    private function addTicketToCart(EE_Ticket $ticket, $qty = 1)
484
-    {
485
-        // get the number of spaces left for this datetime ticket
486
-        $available_spaces = $this->tracker->ticketDatetimeAvailability($ticket);
487
-        // compare available spaces against the number of tickets being purchased
488
-        if ($available_spaces >= $qty) {
489
-            // allow addons to prevent a ticket from being added to cart
490
-            if (! apply_filters(
491
-                'FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart',
492
-                true,
493
-                $ticket,
494
-                $qty,
495
-                $available_spaces
496
-            )) {
497
-                return false;
498
-            }
499
-            $qty = absint(apply_filters('FHEE__EE_Ticket_Selector___add_ticket_to_cart__ticket_qty', $qty, $ticket));
500
-            // add event to cart
501
-            if ($this->cart->add_ticket_to_cart($ticket, $qty)) {
502
-                $this->tracker->recalculateTicketDatetimeAvailability($ticket, $qty);
503
-                return true;
504
-            }
505
-            return false;
506
-        }
507
-        $this->tracker->processAvailabilityError($ticket, $qty, $this->cart->all_ticket_quantity_count());
508
-        return false;
509
-    }
472
+	/**
473
+	 * adds a ticket to the cart
474
+	 *
475
+	 * @param EE_Ticket $ticket
476
+	 * @param int       $qty
477
+	 * @return TRUE on success, FALSE on fail
478
+	 * @throws InvalidArgumentException
479
+	 * @throws InvalidInterfaceException
480
+	 * @throws InvalidDataTypeException
481
+	 * @throws EE_Error
482
+	 */
483
+	private function addTicketToCart(EE_Ticket $ticket, $qty = 1)
484
+	{
485
+		// get the number of spaces left for this datetime ticket
486
+		$available_spaces = $this->tracker->ticketDatetimeAvailability($ticket);
487
+		// compare available spaces against the number of tickets being purchased
488
+		if ($available_spaces >= $qty) {
489
+			// allow addons to prevent a ticket from being added to cart
490
+			if (! apply_filters(
491
+				'FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart',
492
+				true,
493
+				$ticket,
494
+				$qty,
495
+				$available_spaces
496
+			)) {
497
+				return false;
498
+			}
499
+			$qty = absint(apply_filters('FHEE__EE_Ticket_Selector___add_ticket_to_cart__ticket_qty', $qty, $ticket));
500
+			// add event to cart
501
+			if ($this->cart->add_ticket_to_cart($ticket, $qty)) {
502
+				$this->tracker->recalculateTicketDatetimeAvailability($ticket, $qty);
503
+				return true;
504
+			}
505
+			return false;
506
+		}
507
+		$this->tracker->processAvailabilityError($ticket, $qty, $this->cart->all_ticket_quantity_count());
508
+		return false;
509
+	}
510 510
 
511 511
 
512
-    /**
513
-     * @param $tickets_added
514
-     * @return bool
515
-     * @throws InvalidInterfaceException
516
-     * @throws InvalidDataTypeException
517
-     * @throws EE_Error
518
-     * @throws InvalidArgumentException
519
-     */
520
-    private function processSuccessfulCart($tickets_added)
521
-    {
522
-        // exit('KILL REDIRECT BEFORE CART UPDATE'); // <<<<<<<<<<<<<<<<< KILL REDIRECT HERE BEFORE CART UPDATE
523
-        if (apply_filters('FHEE__EED_Ticket_Selector__process_ticket_selections__success', $tickets_added)) {
524
-            // make sure cart is loaded
525
-            if (! $this->cart instanceof EE_Cart) {
526
-                $this->cart = CartFactory::getCart();
527
-            }
528
-            do_action(
529
-                'FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout',
530
-                $this->cart,
531
-                $this
532
-            );
533
-            $this->cart->recalculate_all_cart_totals();
534
-            $this->cart->save_cart(false);
535
-            // exit('KILL REDIRECT AFTER CART UPDATE'); // <<<<<<<<  OR HERE TO KILL REDIRECT AFTER CART UPDATE
536
-            // just return TRUE for registrations being made from admin
537
-            if ($this->request->isAdmin() || $this->request->isFrontAjax()) {
538
-                return true;
539
-            }
540
-            EEH_URL::safeRedirectAndExit(
541
-                apply_filters(
542
-                    'FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url',
543
-                    $this->core_config->reg_page_url()
544
-                )
545
-            );
546
-        }
547
-        if (! EE_Error::has_error() && ! EE_Error::has_error(true, 'attention')) {
548
-            // nothing added to cart
549
-            EE_Error::add_attention(
550
-                esc_html__('No tickets were added for the event', 'event_espresso'),
551
-                __FILE__,
552
-                __FUNCTION__,
553
-                __LINE__
554
-            );
555
-        }
556
-        return false;
557
-    }
512
+	/**
513
+	 * @param $tickets_added
514
+	 * @return bool
515
+	 * @throws InvalidInterfaceException
516
+	 * @throws InvalidDataTypeException
517
+	 * @throws EE_Error
518
+	 * @throws InvalidArgumentException
519
+	 */
520
+	private function processSuccessfulCart($tickets_added)
521
+	{
522
+		// exit('KILL REDIRECT BEFORE CART UPDATE'); // <<<<<<<<<<<<<<<<< KILL REDIRECT HERE BEFORE CART UPDATE
523
+		if (apply_filters('FHEE__EED_Ticket_Selector__process_ticket_selections__success', $tickets_added)) {
524
+			// make sure cart is loaded
525
+			if (! $this->cart instanceof EE_Cart) {
526
+				$this->cart = CartFactory::getCart();
527
+			}
528
+			do_action(
529
+				'FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout',
530
+				$this->cart,
531
+				$this
532
+			);
533
+			$this->cart->recalculate_all_cart_totals();
534
+			$this->cart->save_cart(false);
535
+			// exit('KILL REDIRECT AFTER CART UPDATE'); // <<<<<<<<  OR HERE TO KILL REDIRECT AFTER CART UPDATE
536
+			// just return TRUE for registrations being made from admin
537
+			if ($this->request->isAdmin() || $this->request->isFrontAjax()) {
538
+				return true;
539
+			}
540
+			EEH_URL::safeRedirectAndExit(
541
+				apply_filters(
542
+					'FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url',
543
+					$this->core_config->reg_page_url()
544
+				)
545
+			);
546
+		}
547
+		if (! EE_Error::has_error() && ! EE_Error::has_error(true, 'attention')) {
548
+			// nothing added to cart
549
+			EE_Error::add_attention(
550
+				esc_html__('No tickets were added for the event', 'event_espresso'),
551
+				__FILE__,
552
+				__FUNCTION__,
553
+				__LINE__
554
+			);
555
+		}
556
+		return false;
557
+	}
558 558
 }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     public function cancelTicketSelections()
119 119
     {
120 120
         // check nonce
121
-        if (! $this->processTicketSelectorNonce('cancel_ticket_selections')) {
121
+        if ( ! $this->processTicketSelectorNonce('cancel_ticket_selections')) {
122 122
             return false;
123 123
         }
124 124
         $this->session->clear_session(__CLASS__, __FUNCTION__);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             );
131 131
         }
132 132
         EEH_URL::safeRedirectAndExit(
133
-            site_url('/' . $this->core_config->event_cpt_slug . '/')
133
+            site_url('/'.$this->core_config->event_cpt_slug.'/')
134 134
         );
135 135
         return true;
136 136
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     private function processTicketSelectorNonce($nonce_name, $id = '')
147 147
     {
148 148
         $nonce_name_with_id = ! empty($id) ? "{$nonce_name}_nonce_{$id}" : "{$nonce_name}_nonce";
149
-        if (! $this->request->isAdmin()
149
+        if ( ! $this->request->isAdmin()
150 150
             && (
151 151
                 ! $this->request->is_set($nonce_name_with_id)
152 152
                 || ! wp_verify_nonce(
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     private function getEventId()
237 237
     {
238 238
         // do we have an event id?
239
-        if (! $this->request->requestParamIsSet('tkt-slctr-event-id')) {
239
+        if ( ! $this->request->requestParamIsSet('tkt-slctr-event-id')) {
240 240
             // $_POST['tkt-slctr-event-id'] was not set ?!?!?!?
241 241
             EE_Error::add_error(
242 242
                 sprintf(
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      */
265 265
     private function validatePostData($id = 0)
266 266
     {
267
-        if (! $id) {
267
+        if ( ! $id) {
268 268
             EE_Error::add_error(
269 269
                 esc_html__('The event id provided was not valid.', 'event_espresso'),
270 270
                 __FILE__,
@@ -291,29 +291,29 @@  discard block
 block discarded – undo
291 291
         // cycle through $inputs_to_clean array
292 292
         foreach ($inputs_to_clean as $what => $input_to_clean) {
293 293
             // check for POST data
294
-            if ($this->request->requestParamIsSet($input_to_clean . $id)) {
294
+            if ($this->request->requestParamIsSet($input_to_clean.$id)) {
295 295
                 // grab value
296
-                $input_value = $this->request->getRequestParam($input_to_clean . $id);
296
+                $input_value = $this->request->getRequestParam($input_to_clean.$id);
297 297
                 switch ($what) {
298 298
                     // integers
299 299
                     case 'event_id':
300
-                        $valid_data[ $what ] = absint($input_value);
300
+                        $valid_data[$what] = absint($input_value);
301 301
                         // get event via the event id we put in the form
302 302
                         break;
303 303
                     case 'rows':
304 304
                     case 'max_atndz':
305
-                        $valid_data[ $what ] = absint($input_value);
305
+                        $valid_data[$what] = absint($input_value);
306 306
                         break;
307 307
                     // arrays of integers
308 308
                     case 'qty':
309 309
                         /** @var array $row_qty */
310 310
                         $row_qty = $input_value;
311 311
                         // if qty is coming from a radio button input, then we need to assemble an array of rows
312
-                        if (! is_array($row_qty)) {
312
+                        if ( ! is_array($row_qty)) {
313 313
                             /** @var string $row_qty */
314 314
                             // get number of rows
315
-                            $rows = $this->request->requestParamIsSet('tkt-slctr-rows-' . $id)
316
-                                ? absint($this->request->getRequestParam('tkt-slctr-rows-' . $id))
315
+                            $rows = $this->request->requestParamIsSet('tkt-slctr-rows-'.$id)
316
+                                ? absint($this->request->getRequestParam('tkt-slctr-rows-'.$id))
317 317
                                 : 1;
318 318
                             // explode integers by the dash
319 319
                             $row_qty = explode('-', $row_qty);
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
                             $qty = isset($row_qty[1]) ? absint($row_qty[1]) : 0;
322 322
                             $row_qty = array($row => $qty);
323 323
                             for ($x = 1; $x <= $rows; $x++) {
324
-                                if (! isset($row_qty[ $x ])) {
325
-                                    $row_qty[ $x ] = 0;
324
+                                if ( ! isset($row_qty[$x])) {
325
+                                    $row_qty[$x] = 0;
326 326
                                 }
327 327
                             }
328 328
                         }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
                         foreach ($row_qty as $qty) {
332 332
                             $qty = absint($qty);
333 333
                             // sanitize as integers
334
-                            $valid_data[ $what ][] = $qty;
334
+                            $valid_data[$what][] = $qty;
335 335
                             $valid_data['total_tickets'] += $qty;
336 336
                         }
337 337
                         break;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                         // cycle thru values
341 341
                         foreach ((array) $input_value as $key => $value) {
342 342
                             // allow only integers
343
-                            $valid_data[ $what ][ $key ] = absint($value);
343
+                            $valid_data[$what][$key] = absint($value);
344 344
                         }
345 345
                         break;
346 346
                     case 'return_url':
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
                             $input_value = explode('#', $input_value);
353 353
                             $input_value = end($input_value);
354 354
                             // use event list url instead, but append anchor
355
-                            $input_value = EEH_Event_View::event_archive_url() . '#' . $input_value;
355
+                            $input_value = EEH_Event_View::event_archive_url().'#'.$input_value;
356 356
                         }
357
-                        $valid_data[ $what ] = $input_value;
357
+                        $valid_data[$what] = $input_value;
358 358
                         break;
359 359
                 }    // end switch $what
360 360
             }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
             )
389 389
         );
390 390
         $limit_error_2 = sprintf($max_attendees_string, $valid['max_atndz'], $valid['max_atndz']);
391
-        EE_Error::add_error($limit_error_1 . '<br/>' . $limit_error_2, __FILE__, __FUNCTION__, __LINE__);
391
+        EE_Error::add_error($limit_error_1.'<br/>'.$limit_error_2, __FILE__, __FUNCTION__, __LINE__);
392 392
     }
393 393
 
394 394
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             // cycle thru the number of data rows sent from the event listing
411 411
             for ($x = 0; $x < $valid['rows']; $x++) {
412 412
                 // does this row actually contain a ticket quantity?
413
-                if (isset($valid['qty'][ $x ]) && $valid['qty'][ $x ] > 0) {
413
+                if (isset($valid['qty'][$x]) && $valid['qty'][$x] > 0) {
414 414
                     // YES we have a ticket quantity
415 415
                     $tickets_selected = true;
416 416
                     $valid_ticket = false;
@@ -419,14 +419,14 @@  discard block
 block discarded – undo
419 419
                     //     '$valid[\'ticket_id\'][ $x ]',
420 420
                     //     __FILE__, __LINE__
421 421
                     // );
422
-                    if (isset($valid['ticket_id'][ $x ])) {
422
+                    if (isset($valid['ticket_id'][$x])) {
423 423
                         // get ticket via the ticket id we put in the form
424
-                        $ticket = $this->ticket_model->get_one_by_ID($valid['ticket_id'][ $x ]);
424
+                        $ticket = $this->ticket_model->get_one_by_ID($valid['ticket_id'][$x]);
425 425
                         if ($ticket instanceof EE_Ticket) {
426 426
                             $valid_ticket = true;
427 427
                             $tickets_added += $this->addTicketToCart(
428 428
                                 $ticket,
429
-                                $valid['qty'][ $x ]
429
+                                $valid['qty'][$x]
430 430
                             );
431 431
                         }
432 432
                     }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             $this->cart,
457 457
             $this
458 458
         );
459
-        if (! apply_filters('FHEE__EED_Ticket_Selector__process_ticket_selections__tckts_slctd', $tickets_selected)) {
459
+        if ( ! apply_filters('FHEE__EED_Ticket_Selector__process_ticket_selections__tckts_slctd', $tickets_selected)) {
460 460
             // no ticket quantities were selected
461 461
             EE_Error::add_error(
462 462
                 esc_html__('You need to select a ticket quantity before you can proceed.', 'event_espresso'),
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
         // compare available spaces against the number of tickets being purchased
488 488
         if ($available_spaces >= $qty) {
489 489
             // allow addons to prevent a ticket from being added to cart
490
-            if (! apply_filters(
490
+            if ( ! apply_filters(
491 491
                 'FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart',
492 492
                 true,
493 493
                 $ticket,
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
         // exit('KILL REDIRECT BEFORE CART UPDATE'); // <<<<<<<<<<<<<<<<< KILL REDIRECT HERE BEFORE CART UPDATE
523 523
         if (apply_filters('FHEE__EED_Ticket_Selector__process_ticket_selections__success', $tickets_added)) {
524 524
             // make sure cart is loaded
525
-            if (! $this->cart instanceof EE_Cart) {
525
+            if ( ! $this->cart instanceof EE_Cart) {
526 526
                 $this->cart = CartFactory::getCart();
527 527
             }
528 528
             do_action(
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
                 )
545 545
             );
546 546
         }
547
-        if (! EE_Error::has_error() && ! EE_Error::has_error(true, 'attention')) {
547
+        if ( ! EE_Error::has_error() && ! EE_Error::has_error(true, 'attention')) {
548 548
             // nothing added to cart
549 549
             EE_Error::add_attention(
550 550
                 esc_html__('No tickets were added for the event', 'event_espresso'),
Please login to merge, or discard this patch.
widgets/EspressoWidget.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,28 +13,28 @@
 block discarded – undo
13 13
 {
14 14
 
15 15
 
16
-    /**
17
-     * @param string $name
18
-     * @param array  $widget_options
19
-     * @param array  $control_options
20
-     */
21
-    public function __construct($name = '', array $widget_options = array(), array $control_options = array())
22
-    {
23
-        $id_base = EspressoWidget::getIdBase(get_class($this));
24
-        $control_options['id_base'] = $id_base;
25
-        $control_options['height'] = isset($control_options['height']) ? $control_options['height'] : 300;
26
-        $control_options['width'] = isset($control_options['width']) ? $control_options['width'] : 350;
27
-        // Register widget with WordPress
28
-        parent::__construct($id_base, $name, $widget_options, $control_options);
29
-    }
16
+	/**
17
+	 * @param string $name
18
+	 * @param array  $widget_options
19
+	 * @param array  $control_options
20
+	 */
21
+	public function __construct($name = '', array $widget_options = array(), array $control_options = array())
22
+	{
23
+		$id_base = EspressoWidget::getIdBase(get_class($this));
24
+		$control_options['id_base'] = $id_base;
25
+		$control_options['height'] = isset($control_options['height']) ? $control_options['height'] : 300;
26
+		$control_options['width'] = isset($control_options['width']) ? $control_options['width'] : 350;
27
+		// Register widget with WordPress
28
+		parent::__construct($id_base, $name, $widget_options, $control_options);
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @param string $widget_class
34
-     * @return string
35
-     */
36
-    public static function getIdBase($widget_class)
37
-    {
38
-        return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)) . '-widget';
39
-    }
32
+	/**
33
+	 * @param string $widget_class
34
+	 * @return string
35
+	 */
36
+	public static function getIdBase($widget_class)
37
+	{
38
+		return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)) . '-widget';
39
+	}
40 40
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,6 +35,6 @@
 block discarded – undo
35 35
      */
36 36
     public static function getIdBase($widget_class)
37 37
     {
38
-        return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)) . '-widget';
38
+        return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)).'-widget';
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorRowStandard.php 2 patches
Indentation   +355 added lines, -355 removed lines patch added patch discarded remove patch
@@ -17,359 +17,359 @@
 block discarded – undo
17 17
 class TicketSelectorRowStandard extends TicketSelectorRow
18 18
 {
19 19
 
20
-    /**
21
-     * @var TicketDetails $ticket_details
22
-     */
23
-    protected $ticket_details;
24
-
25
-    /**
26
-     * @var \EE_Ticket_Selector_Config $template_settings
27
-     */
28
-    protected $template_settings;
29
-
30
-    /**
31
-     * @var EE_Tax_Config $tax_settings
32
-     */
33
-    protected $tax_settings;
34
-
35
-    /**
36
-     * @var boolean $prices_displayed_including_taxes
37
-     */
38
-    protected $prices_displayed_including_taxes;
39
-
40
-    /**
41
-     * @var int $row
42
-     */
43
-    protected $row;
44
-
45
-    /**
46
-     * @var int $cols
47
-     */
48
-    protected $cols;
49
-
50
-    /**
51
-     * @var boolean $hidden_input_qty
52
-     */
53
-    protected $hidden_input_qty;
54
-
55
-    /**
56
-     * @var string $ticket_datetime_classes
57
-     */
58
-    protected $ticket_datetime_classes;
59
-
60
-
61
-    /**
62
-     * TicketDetails constructor.
63
-     *
64
-     * @param TicketDetails $ticket_details
65
-     * @param EE_Tax_Config $tax_settings
66
-     * @param int           $total_tickets
67
-     * @param int           $max_attendees
68
-     * @param int           $row
69
-     * @param int           $cols
70
-     * @param boolean       $required_ticket_sold_out
71
-     * @param string        $event_status
72
-     * @param string        $ticket_datetime_classes
73
-     * @throws EE_Error
74
-     * @throws UnexpectedEntityException
75
-     */
76
-    public function __construct(
77
-        TicketDetails $ticket_details,
78
-        EE_Tax_Config $tax_settings,
79
-        $total_tickets,
80
-        $max_attendees,
81
-        $row,
82
-        $cols,
83
-        $required_ticket_sold_out,
84
-        $event_status,
85
-        $ticket_datetime_classes
86
-    ) {
87
-        $this->ticket_details = $ticket_details;
88
-        $this->template_settings = $ticket_details->getTemplateSettings();
89
-        $this->tax_settings = $tax_settings;
90
-        $this->row = $row;
91
-        $this->cols = $cols;
92
-        $this->ticket_datetime_classes = $ticket_datetime_classes;
93
-        parent::__construct(
94
-            $ticket_details->getTicket(),
95
-            $max_attendees,
96
-            $ticket_details->getDateFormat(),
97
-            $event_status,
98
-            $required_ticket_sold_out,
99
-            $total_tickets
100
-        );
101
-    }
102
-
103
-
104
-    /**
105
-     * other ticket rows will need to know if a required ticket is sold out,
106
-     * so that they are not offered for sale
107
-     *
108
-     * @return boolean
109
-     */
110
-    public function getRequiredTicketSoldOut()
111
-    {
112
-        return $this->required_ticket_sold_out;
113
-    }
114
-
115
-
116
-    /**
117
-     * @return int
118
-     */
119
-    public function getCols()
120
-    {
121
-        return $this->cols;
122
-    }
123
-
124
-
125
-    /**
126
-     * getHtml
127
-     *
128
-     * @return string
129
-     * @throws EE_Error
130
-     */
131
-    public function getHtml()
132
-    {
133
-        $this->min = 0;
134
-        $this->max = $this->ticket->max();
135
-        $remaining = $this->ticket->remaining();
136
-        if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
137
-            $this->setTicketMinAndMax($remaining);
138
-        } else {
139
-            // set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
140
-            $this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
141
-                ? $this->ticket->start_date()
142
-                : $this->required_ticket_sold_out;
143
-        }
144
-        $this->setTicketPriceDetails();
145
-        $this->setTicketStatusClasses($remaining);
146
-        $filtered_row_html = $this->getFilteredRowHtml();
147
-        if ($filtered_row_html !== false) {
148
-            return $filtered_row_html;
149
-        }
150
-        $ticket_selector_row_html = EEH_HTML::tr(
151
-            '',
152
-            '',
153
-            "tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} "
154
-            . espresso_get_object_css_class($this->ticket)
155
-        );
156
-        $filtered_row_content = $this->getFilteredRowContents();
157
-        if ($filtered_row_content !== false && $this->max_attendees === 1) {
158
-            return $ticket_selector_row_html
159
-                   . $filtered_row_content
160
-                   . $this->ticketQtyAndIdHiddenInputs()
161
-                   . EEH_HTML::trx();
162
-        }
163
-        if ($filtered_row_content !== false) {
164
-            return $ticket_selector_row_html
165
-                   . $filtered_row_content
166
-                   . EEH_HTML::trx();
167
-        }
168
-        $this->hidden_input_qty = $this->max_attendees > 1;
169
-
170
-        $ticket_selector_row_html .= $this->ticketNameTableCell();
171
-        $ticket_selector_row_html .= $this->ticketPriceTableCell();
172
-        $ticket_selector_row_html .= EEH_HTML::td(
173
-            '',
174
-            '',
175
-            'tckt-slctr-tbl-td-qty cntr',
176
-            '',
177
-            'headers="quantity-' . $this->EVT_ID . '"'
178
-        );
179
-        $this->setTicketStatusDisplay($remaining);
180
-        if (empty($this->ticket_status_display)) {
181
-            if ($this->max_attendees === 1) {
182
-                // only ONE attendee is allowed to register at a time
183
-                $ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
184
-            } elseif ($this->max > 0) {
185
-                $ticket_selector_row_html .= $this->ticketQuantitySelector();
186
-            }
187
-        }
188
-        $ticket_selector_row_html .= $this->ticket_status_display;
189
-        $ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
190
-        $ticket_selector_row_html .= $this->ticket_details->display(
191
-            $this->ticket_price,
192
-            $remaining,
193
-            $this->cols
194
-        );
195
-        $ticket_selector_row_html .= EEH_HTML::tdx();
196
-        $ticket_selector_row_html .= EEH_HTML::trx();
197
-
198
-
199
-        $this->row++;
200
-        return $ticket_selector_row_html;
201
-    }
202
-
203
-
204
-    /**
205
-     * getTicketPriceDetails
206
-     *
207
-     * @return void
208
-     * @throws EE_Error
209
-     */
210
-    protected function setTicketPriceDetails()
211
-    {
212
-        $this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
213
-            ? $this->ticket->get_ticket_total_with_taxes()
214
-            : $this->ticket->get_ticket_subtotal();
215
-        $this->ticket_bundle = false;
216
-        $ticket_min = $this->ticket->min();
217
-        // for ticket bundles, set min and max qty the same
218
-        if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
219
-            $this->ticket_price *= $ticket_min;
220
-            $this->ticket_bundle = true;
221
-        }
222
-        $this->ticket_price = apply_filters(
223
-            'FHEE__ticket_selector_chart_template__ticket_price',
224
-            $this->ticket_price,
225
-            $this->ticket
226
-        );
227
-    }
228
-
229
-
230
-    /**
231
-     * ticketNameTableCell
232
-     *
233
-     * @return string
234
-     * @throws EE_Error
235
-     */
236
-    protected function ticketNameTableCell()
237
-    {
238
-        $html = EEH_HTML::td(
239
-            '',
240
-            '',
241
-            'tckt-slctr-tbl-td-name',
242
-            '',
243
-            'headers="details-' . $this->EVT_ID . '"'
244
-        );
245
-        $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
246
-        $html .= $this->ticket_details->getShowHideLinks();
247
-        if ($this->ticket->required()) {
248
-            $html .= EEH_HTML::p(
249
-                apply_filters(
250
-                    'FHEE__ticket_selector_chart_template__ticket_required_message',
251
-                    esc_html__('This ticket is required and must be purchased.', 'event_espresso')
252
-                ),
253
-                '',
254
-                'ticket-required-pg'
255
-            );
256
-        }
257
-        $html .= EEH_HTML::tdx();
258
-        return $html;
259
-    }
260
-
261
-
262
-    /**
263
-     * ticketPriceTableCell
264
-     *
265
-     * @return string
266
-     * @throws EE_Error
267
-     */
268
-    protected function ticketPriceTableCell()
269
-    {
270
-        $html = '';
271
-        if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
272
-            $html .= EEH_HTML::td(
273
-                '',
274
-                '',
275
-                'tckt-slctr-tbl-td-price jst-rght',
276
-                '',
277
-                'headers="price-' . $this->EVT_ID . '"'
278
-            );
279
-            $html .= \EEH_Template::format_currency($this->ticket_price);
280
-            $html .= $this->ticket->taxable()
281
-                ? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text')
282
-                : '';
283
-            $html .= '&nbsp;';
284
-            // phpcs:disable WordPress.WP.I18n.NoEmptyStrings
285
-            $html .= EEH_HTML::span(
286
-                $this->ticket_bundle
287
-                    ? apply_filters(
288
-                        'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
289
-                        __(' / bundle', 'event_espresso')
290
-                    )
291
-                    : apply_filters(
292
-                        'FHEE__ticket_selector_chart_template__per_ticket_text',
293
-                        __('', 'event_espresso')
294
-                    ),
295
-                '',
296
-                'smaller-text no-bold'
297
-            );
298
-            $html .= '&nbsp;';
299
-            $html .= EEH_HTML::tdx();
300
-            $this->cols++;
301
-        }
302
-        return $html;
303
-    }
304
-
305
-
306
-    /**
307
-     * onlyOneAttendeeCanRegister
308
-     *
309
-     * @return string
310
-     */
311
-    protected function onlyOneAttendeeCanRegister()
312
-    {
313
-        // display submit button since we have tickets available
314
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
315
-        $this->hidden_input_qty = false;
316
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
317
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
318
-        $html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
319
-        $html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
320
-        $html .= ' id="' . $id . '"';
321
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
322
-        $html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
323
-        $html .= ' title=""/>';
324
-        return $html;
325
-    }
326
-
327
-
328
-    /**
329
-     * ticketQuantitySelector
330
-     *
331
-     * @return string
332
-     * @throws EE_Error
333
-     */
334
-    protected function ticketQuantitySelector()
335
-    {
336
-        // display submit button since we have tickets available
337
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
338
-        $this->hidden_input_qty = false;
339
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
340
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
341
-        $html .= esc_html__('Quantity', 'event_espresso') . '</label>';
342
-        $html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
343
-        $html .= ' id="' . $id . '"';
344
-        $html .= ' class="ticket-selector-tbl-qty-slct">';
345
-        // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
346
-        if ($this->min !== 0 && ! $this->ticket->required()) {
347
-            $html .= '<option value="0">&nbsp;0&nbsp;</option>';
348
-        }
349
-        // offer ticket quantities from the min to the max
350
-        for ($i = $this->min; $i <= $this->max; $i++) {
351
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
352
-        }
353
-        $html .= '</select>';
354
-        return $html;
355
-    }
356
-
357
-
358
-    /**
359
-     * getHiddenInputs
360
-     *
361
-     * @return string
362
-     * @throws EE_Error
363
-     */
364
-    protected function ticketQtyAndIdHiddenInputs()
365
-    {
366
-        $html = '';
367
-        // depending on group reg we need to change the format for qty
368
-        if ($this->hidden_input_qty) {
369
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
370
-        }
371
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
372
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
373
-        return $html;
374
-    }
20
+	/**
21
+	 * @var TicketDetails $ticket_details
22
+	 */
23
+	protected $ticket_details;
24
+
25
+	/**
26
+	 * @var \EE_Ticket_Selector_Config $template_settings
27
+	 */
28
+	protected $template_settings;
29
+
30
+	/**
31
+	 * @var EE_Tax_Config $tax_settings
32
+	 */
33
+	protected $tax_settings;
34
+
35
+	/**
36
+	 * @var boolean $prices_displayed_including_taxes
37
+	 */
38
+	protected $prices_displayed_including_taxes;
39
+
40
+	/**
41
+	 * @var int $row
42
+	 */
43
+	protected $row;
44
+
45
+	/**
46
+	 * @var int $cols
47
+	 */
48
+	protected $cols;
49
+
50
+	/**
51
+	 * @var boolean $hidden_input_qty
52
+	 */
53
+	protected $hidden_input_qty;
54
+
55
+	/**
56
+	 * @var string $ticket_datetime_classes
57
+	 */
58
+	protected $ticket_datetime_classes;
59
+
60
+
61
+	/**
62
+	 * TicketDetails constructor.
63
+	 *
64
+	 * @param TicketDetails $ticket_details
65
+	 * @param EE_Tax_Config $tax_settings
66
+	 * @param int           $total_tickets
67
+	 * @param int           $max_attendees
68
+	 * @param int           $row
69
+	 * @param int           $cols
70
+	 * @param boolean       $required_ticket_sold_out
71
+	 * @param string        $event_status
72
+	 * @param string        $ticket_datetime_classes
73
+	 * @throws EE_Error
74
+	 * @throws UnexpectedEntityException
75
+	 */
76
+	public function __construct(
77
+		TicketDetails $ticket_details,
78
+		EE_Tax_Config $tax_settings,
79
+		$total_tickets,
80
+		$max_attendees,
81
+		$row,
82
+		$cols,
83
+		$required_ticket_sold_out,
84
+		$event_status,
85
+		$ticket_datetime_classes
86
+	) {
87
+		$this->ticket_details = $ticket_details;
88
+		$this->template_settings = $ticket_details->getTemplateSettings();
89
+		$this->tax_settings = $tax_settings;
90
+		$this->row = $row;
91
+		$this->cols = $cols;
92
+		$this->ticket_datetime_classes = $ticket_datetime_classes;
93
+		parent::__construct(
94
+			$ticket_details->getTicket(),
95
+			$max_attendees,
96
+			$ticket_details->getDateFormat(),
97
+			$event_status,
98
+			$required_ticket_sold_out,
99
+			$total_tickets
100
+		);
101
+	}
102
+
103
+
104
+	/**
105
+	 * other ticket rows will need to know if a required ticket is sold out,
106
+	 * so that they are not offered for sale
107
+	 *
108
+	 * @return boolean
109
+	 */
110
+	public function getRequiredTicketSoldOut()
111
+	{
112
+		return $this->required_ticket_sold_out;
113
+	}
114
+
115
+
116
+	/**
117
+	 * @return int
118
+	 */
119
+	public function getCols()
120
+	{
121
+		return $this->cols;
122
+	}
123
+
124
+
125
+	/**
126
+	 * getHtml
127
+	 *
128
+	 * @return string
129
+	 * @throws EE_Error
130
+	 */
131
+	public function getHtml()
132
+	{
133
+		$this->min = 0;
134
+		$this->max = $this->ticket->max();
135
+		$remaining = $this->ticket->remaining();
136
+		if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
137
+			$this->setTicketMinAndMax($remaining);
138
+		} else {
139
+			// set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
140
+			$this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
141
+				? $this->ticket->start_date()
142
+				: $this->required_ticket_sold_out;
143
+		}
144
+		$this->setTicketPriceDetails();
145
+		$this->setTicketStatusClasses($remaining);
146
+		$filtered_row_html = $this->getFilteredRowHtml();
147
+		if ($filtered_row_html !== false) {
148
+			return $filtered_row_html;
149
+		}
150
+		$ticket_selector_row_html = EEH_HTML::tr(
151
+			'',
152
+			'',
153
+			"tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} "
154
+			. espresso_get_object_css_class($this->ticket)
155
+		);
156
+		$filtered_row_content = $this->getFilteredRowContents();
157
+		if ($filtered_row_content !== false && $this->max_attendees === 1) {
158
+			return $ticket_selector_row_html
159
+				   . $filtered_row_content
160
+				   . $this->ticketQtyAndIdHiddenInputs()
161
+				   . EEH_HTML::trx();
162
+		}
163
+		if ($filtered_row_content !== false) {
164
+			return $ticket_selector_row_html
165
+				   . $filtered_row_content
166
+				   . EEH_HTML::trx();
167
+		}
168
+		$this->hidden_input_qty = $this->max_attendees > 1;
169
+
170
+		$ticket_selector_row_html .= $this->ticketNameTableCell();
171
+		$ticket_selector_row_html .= $this->ticketPriceTableCell();
172
+		$ticket_selector_row_html .= EEH_HTML::td(
173
+			'',
174
+			'',
175
+			'tckt-slctr-tbl-td-qty cntr',
176
+			'',
177
+			'headers="quantity-' . $this->EVT_ID . '"'
178
+		);
179
+		$this->setTicketStatusDisplay($remaining);
180
+		if (empty($this->ticket_status_display)) {
181
+			if ($this->max_attendees === 1) {
182
+				// only ONE attendee is allowed to register at a time
183
+				$ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
184
+			} elseif ($this->max > 0) {
185
+				$ticket_selector_row_html .= $this->ticketQuantitySelector();
186
+			}
187
+		}
188
+		$ticket_selector_row_html .= $this->ticket_status_display;
189
+		$ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
190
+		$ticket_selector_row_html .= $this->ticket_details->display(
191
+			$this->ticket_price,
192
+			$remaining,
193
+			$this->cols
194
+		);
195
+		$ticket_selector_row_html .= EEH_HTML::tdx();
196
+		$ticket_selector_row_html .= EEH_HTML::trx();
197
+
198
+
199
+		$this->row++;
200
+		return $ticket_selector_row_html;
201
+	}
202
+
203
+
204
+	/**
205
+	 * getTicketPriceDetails
206
+	 *
207
+	 * @return void
208
+	 * @throws EE_Error
209
+	 */
210
+	protected function setTicketPriceDetails()
211
+	{
212
+		$this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
213
+			? $this->ticket->get_ticket_total_with_taxes()
214
+			: $this->ticket->get_ticket_subtotal();
215
+		$this->ticket_bundle = false;
216
+		$ticket_min = $this->ticket->min();
217
+		// for ticket bundles, set min and max qty the same
218
+		if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
219
+			$this->ticket_price *= $ticket_min;
220
+			$this->ticket_bundle = true;
221
+		}
222
+		$this->ticket_price = apply_filters(
223
+			'FHEE__ticket_selector_chart_template__ticket_price',
224
+			$this->ticket_price,
225
+			$this->ticket
226
+		);
227
+	}
228
+
229
+
230
+	/**
231
+	 * ticketNameTableCell
232
+	 *
233
+	 * @return string
234
+	 * @throws EE_Error
235
+	 */
236
+	protected function ticketNameTableCell()
237
+	{
238
+		$html = EEH_HTML::td(
239
+			'',
240
+			'',
241
+			'tckt-slctr-tbl-td-name',
242
+			'',
243
+			'headers="details-' . $this->EVT_ID . '"'
244
+		);
245
+		$html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
246
+		$html .= $this->ticket_details->getShowHideLinks();
247
+		if ($this->ticket->required()) {
248
+			$html .= EEH_HTML::p(
249
+				apply_filters(
250
+					'FHEE__ticket_selector_chart_template__ticket_required_message',
251
+					esc_html__('This ticket is required and must be purchased.', 'event_espresso')
252
+				),
253
+				'',
254
+				'ticket-required-pg'
255
+			);
256
+		}
257
+		$html .= EEH_HTML::tdx();
258
+		return $html;
259
+	}
260
+
261
+
262
+	/**
263
+	 * ticketPriceTableCell
264
+	 *
265
+	 * @return string
266
+	 * @throws EE_Error
267
+	 */
268
+	protected function ticketPriceTableCell()
269
+	{
270
+		$html = '';
271
+		if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
272
+			$html .= EEH_HTML::td(
273
+				'',
274
+				'',
275
+				'tckt-slctr-tbl-td-price jst-rght',
276
+				'',
277
+				'headers="price-' . $this->EVT_ID . '"'
278
+			);
279
+			$html .= \EEH_Template::format_currency($this->ticket_price);
280
+			$html .= $this->ticket->taxable()
281
+				? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text')
282
+				: '';
283
+			$html .= '&nbsp;';
284
+			// phpcs:disable WordPress.WP.I18n.NoEmptyStrings
285
+			$html .= EEH_HTML::span(
286
+				$this->ticket_bundle
287
+					? apply_filters(
288
+						'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
289
+						__(' / bundle', 'event_espresso')
290
+					)
291
+					: apply_filters(
292
+						'FHEE__ticket_selector_chart_template__per_ticket_text',
293
+						__('', 'event_espresso')
294
+					),
295
+				'',
296
+				'smaller-text no-bold'
297
+			);
298
+			$html .= '&nbsp;';
299
+			$html .= EEH_HTML::tdx();
300
+			$this->cols++;
301
+		}
302
+		return $html;
303
+	}
304
+
305
+
306
+	/**
307
+	 * onlyOneAttendeeCanRegister
308
+	 *
309
+	 * @return string
310
+	 */
311
+	protected function onlyOneAttendeeCanRegister()
312
+	{
313
+		// display submit button since we have tickets available
314
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
315
+		$this->hidden_input_qty = false;
316
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
317
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
318
+		$html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
319
+		$html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
320
+		$html .= ' id="' . $id . '"';
321
+		$html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
322
+		$html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
323
+		$html .= ' title=""/>';
324
+		return $html;
325
+	}
326
+
327
+
328
+	/**
329
+	 * ticketQuantitySelector
330
+	 *
331
+	 * @return string
332
+	 * @throws EE_Error
333
+	 */
334
+	protected function ticketQuantitySelector()
335
+	{
336
+		// display submit button since we have tickets available
337
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
338
+		$this->hidden_input_qty = false;
339
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
340
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
341
+		$html .= esc_html__('Quantity', 'event_espresso') . '</label>';
342
+		$html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
343
+		$html .= ' id="' . $id . '"';
344
+		$html .= ' class="ticket-selector-tbl-qty-slct">';
345
+		// this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
346
+		if ($this->min !== 0 && ! $this->ticket->required()) {
347
+			$html .= '<option value="0">&nbsp;0&nbsp;</option>';
348
+		}
349
+		// offer ticket quantities from the min to the max
350
+		for ($i = $this->min; $i <= $this->max; $i++) {
351
+			$html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
352
+		}
353
+		$html .= '</select>';
354
+		return $html;
355
+	}
356
+
357
+
358
+	/**
359
+	 * getHiddenInputs
360
+	 *
361
+	 * @return string
362
+	 * @throws EE_Error
363
+	 */
364
+	protected function ticketQtyAndIdHiddenInputs()
365
+	{
366
+		$html = '';
367
+		// depending on group reg we need to change the format for qty
368
+		if ($this->hidden_input_qty) {
369
+			$html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
370
+		}
371
+		$html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
372
+		$html .= ' value="' . $this->ticket->ID() . '"/>';
373
+		return $html;
374
+	}
375 375
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             '',
175 175
             'tckt-slctr-tbl-td-qty cntr',
176 176
             '',
177
-            'headers="quantity-' . $this->EVT_ID . '"'
177
+            'headers="quantity-'.$this->EVT_ID.'"'
178 178
         );
179 179
         $this->setTicketStatusDisplay($remaining);
180 180
         if (empty($this->ticket_status_display)) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             '',
241 241
             'tckt-slctr-tbl-td-name',
242 242
             '',
243
-            'headers="details-' . $this->EVT_ID . '"'
243
+            'headers="details-'.$this->EVT_ID.'"'
244 244
         );
245 245
         $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
246 246
         $html .= $this->ticket_details->getShowHideLinks();
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 '',
275 275
                 'tckt-slctr-tbl-td-price jst-rght',
276 276
                 '',
277
-                'headers="price-' . $this->EVT_ID . '"'
277
+                'headers="price-'.$this->EVT_ID.'"'
278 278
             );
279 279
             $html .= \EEH_Template::format_currency($this->ticket_price);
280 280
             $html .= $this->ticket->taxable()
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
         // display submit button since we have tickets available
314 314
         add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
315 315
         $this->hidden_input_qty = false;
316
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
317
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
318
-        $html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
319
-        $html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
320
-        $html .= ' id="' . $id . '"';
321
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
316
+        $id = 'ticket-selector-tbl-qty-slct-'.$this->EVT_ID.'-'.$this->row;
317
+        $html = '<label class="ee-a11y-screen-reader-text" for="'.$id.'">';
318
+        $html .= esc_html__('Select this ticket', 'event_espresso').'</label>';
319
+        $html .= '<input type="radio" name="tkt-slctr-qty-'.$this->EVT_ID.'"';
320
+        $html .= ' id="'.$id.'"';
321
+        $html .= ' class="ticket-selector-tbl-qty-slct" value="'.$this->row.'-1"';
322 322
         $html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
323 323
         $html .= ' title=""/>';
324 324
         return $html;
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
         // display submit button since we have tickets available
337 337
         add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
338 338
         $this->hidden_input_qty = false;
339
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
340
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
341
-        $html .= esc_html__('Quantity', 'event_espresso') . '</label>';
342
-        $html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
343
-        $html .= ' id="' . $id . '"';
339
+        $id = 'ticket-selector-tbl-qty-slct-'.$this->EVT_ID.'-'.$this->row;
340
+        $html = '<label class="ee-a11y-screen-reader-text" for="'.$id.'">';
341
+        $html .= esc_html__('Quantity', 'event_espresso').'</label>';
342
+        $html .= '<select name="tkt-slctr-qty-'.$this->EVT_ID.'[]"';
343
+        $html .= ' id="'.$id.'"';
344 344
         $html .= ' class="ticket-selector-tbl-qty-slct">';
345 345
         // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
346 346
         if ($this->min !== 0 && ! $this->ticket->required()) {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
         }
349 349
         // offer ticket quantities from the min to the max
350 350
         for ($i = $this->min; $i <= $this->max; $i++) {
351
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
351
+            $html .= '<option value="'.$i.'">&nbsp;'.$i.'&nbsp;</option>';
352 352
         }
353 353
         $html .= '</select>';
354 354
         return $html;
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
         $html = '';
367 367
         // depending on group reg we need to change the format for qty
368 368
         if ($this->hidden_input_qty) {
369
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
369
+            $html .= '<input type="hidden" name="tkt-slctr-qty-'.$this->EVT_ID.'[]" value="0"/>';
370 370
         }
371
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
372
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
371
+        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-'.$this->EVT_ID.'[]"';
372
+        $html .= ' value="'.$this->ticket->ID().'"/>';
373 373
         return $html;
374 374
     }
375 375
 }
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorIframeEmbedButton.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@
 block discarded – undo
14 14
 class TicketSelectorIframeEmbedButton extends IframeEmbedButton
15 15
 {
16 16
 
17
-    /**
18
-     * TicketSelectorIframeEmbedButton constructor.
19
-     */
20
-    public function __construct()
21
-    {
22
-        parent::__construct(
23
-            esc_html__('Ticket Selector', 'event_espresso'),
24
-            'ticket_selector'
25
-        );
26
-    }
17
+	/**
18
+	 * TicketSelectorIframeEmbedButton constructor.
19
+	 */
20
+	public function __construct()
21
+	{
22
+		parent::__construct(
23
+			esc_html__('Ticket Selector', 'event_espresso'),
24
+			'ticket_selector'
25
+		);
26
+	}
27 27
 
28 28
 
29
-    /**
30
-     * Adds an iframe embed code button to the Event editor.
31
-     */
32
-    public function addEventEditorIframeEmbedButton()
33
-    {
34
-        // add button for iframe code to event editor.
35
-        $this->addEventEditorIframeEmbedButtonFilter();
36
-    }
29
+	/**
30
+	 * Adds an iframe embed code button to the Event editor.
31
+	 */
32
+	public function addEventEditorIframeEmbedButton()
33
+	{
34
+		// add button for iframe code to event editor.
35
+		$this->addEventEditorIframeEmbedButtonFilter();
36
+	}
37 37
 }
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorStandard.php 2 patches
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -14,121 +14,121 @@
 block discarded – undo
14 14
 class TicketSelectorStandard extends TicketSelector
15 15
 {
16 16
 
17
-    /**
18
-     * @var string $date_format
19
-     */
20
-    protected $date_format;
17
+	/**
18
+	 * @var string $date_format
19
+	 */
20
+	protected $date_format;
21 21
 
22
-    /**
23
-     * @var string $time_format
24
-     */
25
-    protected $time_format;
22
+	/**
23
+	 * @var string $time_format
24
+	 */
25
+	protected $time_format;
26 26
 
27
-    /**
28
-     * @var \EE_Ticket_Selector_Config $ticket_selector_config
29
-     */
30
-    protected $ticket_selector_config;
27
+	/**
28
+	 * @var \EE_Ticket_Selector_Config $ticket_selector_config
29
+	 */
30
+	protected $ticket_selector_config;
31 31
 
32
-    /**
33
-     * @var \EE_Tax_Config $tax_config
34
-     */
35
-    protected $tax_config;
32
+	/**
33
+	 * @var \EE_Tax_Config $tax_config
34
+	 */
35
+	protected $tax_config;
36 36
 
37 37
 
38
-    /**
39
-     * TicketSelectorSimple constructor.
40
-     *
41
-     * @param \EE_Event                  $event
42
-     * @param \EE_Ticket[]               $tickets
43
-     * @param int                        $max_attendees
44
-     * @param array                      $template_args
45
-     * @param string                     $date_format
46
-     * @param string                     $time_format
47
-     * @param \EE_Ticket_Selector_Config $ticket_selector_config
48
-     * @param \EE_Tax_Config             $tax_config
49
-     */
50
-    public function __construct(
51
-        \EE_Event $event,
52
-        array $tickets,
53
-        $max_attendees,
54
-        array $template_args,
55
-        $date_format = 'Y-m-d',
56
-        $time_format = 'g:i a',
57
-        \EE_Ticket_Selector_Config $ticket_selector_config = null,
58
-        \EE_Tax_Config $tax_config = null
59
-    ) {
60
-        $this->date_format = $date_format;
61
-        $this->time_format = $time_format;
62
-        // get EE_Ticket_Selector_Config and TicketDetails
63
-        $this->ticket_selector_config = isset(\EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector)
64
-            ? \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector
65
-            : new \EE_Ticket_Selector_Config();
66
-        // $template_settings->setDatetimeSelectorThreshold(2);
67
-        // \EEH_Debug_Tools::printr($template_settings->getShowDatetimeSelector(), 'getShowDatetimeSelector', __FILE__, __LINE__);
68
-        // \EEH_Debug_Tools::printr($template_settings->getDatetimeSelectorThreshold(), 'getDatetimeSelectorThreshold', __FILE__, __LINE__);
69
-        $this->tax_config = isset(\EE_Registry::instance()->CFG->tax_settings)
70
-            ? \EE_Registry::instance()->CFG->tax_settings
71
-            : new \EE_Tax_Config();
72
-        parent::__construct($event, $tickets, $max_attendees, $template_args);
73
-    }
38
+	/**
39
+	 * TicketSelectorSimple constructor.
40
+	 *
41
+	 * @param \EE_Event                  $event
42
+	 * @param \EE_Ticket[]               $tickets
43
+	 * @param int                        $max_attendees
44
+	 * @param array                      $template_args
45
+	 * @param string                     $date_format
46
+	 * @param string                     $time_format
47
+	 * @param \EE_Ticket_Selector_Config $ticket_selector_config
48
+	 * @param \EE_Tax_Config             $tax_config
49
+	 */
50
+	public function __construct(
51
+		\EE_Event $event,
52
+		array $tickets,
53
+		$max_attendees,
54
+		array $template_args,
55
+		$date_format = 'Y-m-d',
56
+		$time_format = 'g:i a',
57
+		\EE_Ticket_Selector_Config $ticket_selector_config = null,
58
+		\EE_Tax_Config $tax_config = null
59
+	) {
60
+		$this->date_format = $date_format;
61
+		$this->time_format = $time_format;
62
+		// get EE_Ticket_Selector_Config and TicketDetails
63
+		$this->ticket_selector_config = isset(\EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector)
64
+			? \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector
65
+			: new \EE_Ticket_Selector_Config();
66
+		// $template_settings->setDatetimeSelectorThreshold(2);
67
+		// \EEH_Debug_Tools::printr($template_settings->getShowDatetimeSelector(), 'getShowDatetimeSelector', __FILE__, __LINE__);
68
+		// \EEH_Debug_Tools::printr($template_settings->getDatetimeSelectorThreshold(), 'getDatetimeSelectorThreshold', __FILE__, __LINE__);
69
+		$this->tax_config = isset(\EE_Registry::instance()->CFG->tax_settings)
70
+			? \EE_Registry::instance()->CFG->tax_settings
71
+			: new \EE_Tax_Config();
72
+		parent::__construct($event, $tickets, $max_attendees, $template_args);
73
+	}
74 74
 
75 75
 
76
-    /**
77
-     * sets any and all template args that are required for this Ticket Selector
78
-     *
79
-     * @return void
80
-     * @throws \EE_Error
81
-     */
82
-    protected function addTemplateArgs()
83
-    {
84
-        $row = 1;
85
-        $ticket_row_html = '';
86
-        $required_ticket_sold_out = false;
87
-        // flag to indicate that at least one taxable ticket has been encountered
88
-        $taxable_tickets = false;
89
-        $datetime_selector = null;
90
-        $this->template_args['datetime_selector'] = '';
91
-        if ($this->ticket_selector_config->getShowDatetimeSelector()
92
-            !== \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR
93
-        ) {
94
-            $datetime_selector = new DatetimeSelector(
95
-                $this->event,
96
-                $this->tickets,
97
-                $this->ticket_selector_config,
98
-                $this->date_format,
99
-                $this->time_format
100
-            );
101
-            $this->template_args['datetime_selector'] = $datetime_selector->getDatetimeSelector();
102
-        }
103
-        $total_tickets = count($this->tickets);
104
-        // loop through tickets
105
-        foreach ($this->tickets as $TKT_ID => $ticket) {
106
-            if ($ticket instanceof \EE_Ticket) {
107
-                $cols = 2;
108
-                $taxable_tickets = $ticket->taxable() ? true : $taxable_tickets;
109
-                $ticket_selector_row = new TicketSelectorRowStandard(
110
-                    new TicketDetails($ticket, $this->ticket_selector_config, $this->template_args),
111
-                    $this->tax_config,
112
-                    $total_tickets,
113
-                    $this->max_attendees,
114
-                    $row,
115
-                    $cols,
116
-                    $required_ticket_sold_out,
117
-                    $this->template_args['event_status'],
118
-                    $datetime_selector instanceof DatetimeSelector
119
-                        ? $datetime_selector->getTicketDatetimeClasses($ticket)
120
-                        : ''
121
-                );
122
-                $ticket_row_html .= $ticket_selector_row->getHtml();
123
-                $required_ticket_sold_out = $ticket_selector_row->getRequiredTicketSoldOut();
124
-                $row++;
125
-            }
126
-        }
127
-        $this->template_args['row'] = $row;
128
-        $this->template_args['ticket_row_html'] = $ticket_row_html;
129
-        $this->template_args['taxable_tickets'] = $taxable_tickets;
130
-        $this->template_args['prices_displayed_including_taxes'] = $this->tax_config->prices_displayed_including_taxes;
131
-        $this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH . 'standard_ticket_selector.template.php';
132
-        remove_all_filters('FHEE__EE_Ticket_Selector__hide_ticket_selector');
133
-    }
76
+	/**
77
+	 * sets any and all template args that are required for this Ticket Selector
78
+	 *
79
+	 * @return void
80
+	 * @throws \EE_Error
81
+	 */
82
+	protected function addTemplateArgs()
83
+	{
84
+		$row = 1;
85
+		$ticket_row_html = '';
86
+		$required_ticket_sold_out = false;
87
+		// flag to indicate that at least one taxable ticket has been encountered
88
+		$taxable_tickets = false;
89
+		$datetime_selector = null;
90
+		$this->template_args['datetime_selector'] = '';
91
+		if ($this->ticket_selector_config->getShowDatetimeSelector()
92
+			!== \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR
93
+		) {
94
+			$datetime_selector = new DatetimeSelector(
95
+				$this->event,
96
+				$this->tickets,
97
+				$this->ticket_selector_config,
98
+				$this->date_format,
99
+				$this->time_format
100
+			);
101
+			$this->template_args['datetime_selector'] = $datetime_selector->getDatetimeSelector();
102
+		}
103
+		$total_tickets = count($this->tickets);
104
+		// loop through tickets
105
+		foreach ($this->tickets as $TKT_ID => $ticket) {
106
+			if ($ticket instanceof \EE_Ticket) {
107
+				$cols = 2;
108
+				$taxable_tickets = $ticket->taxable() ? true : $taxable_tickets;
109
+				$ticket_selector_row = new TicketSelectorRowStandard(
110
+					new TicketDetails($ticket, $this->ticket_selector_config, $this->template_args),
111
+					$this->tax_config,
112
+					$total_tickets,
113
+					$this->max_attendees,
114
+					$row,
115
+					$cols,
116
+					$required_ticket_sold_out,
117
+					$this->template_args['event_status'],
118
+					$datetime_selector instanceof DatetimeSelector
119
+						? $datetime_selector->getTicketDatetimeClasses($ticket)
120
+						: ''
121
+				);
122
+				$ticket_row_html .= $ticket_selector_row->getHtml();
123
+				$required_ticket_sold_out = $ticket_selector_row->getRequiredTicketSoldOut();
124
+				$row++;
125
+			}
126
+		}
127
+		$this->template_args['row'] = $row;
128
+		$this->template_args['ticket_row_html'] = $ticket_row_html;
129
+		$this->template_args['taxable_tickets'] = $taxable_tickets;
130
+		$this->template_args['prices_displayed_including_taxes'] = $this->tax_config->prices_displayed_including_taxes;
131
+		$this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH . 'standard_ticket_selector.template.php';
132
+		remove_all_filters('FHEE__EE_Ticket_Selector__hide_ticket_selector');
133
+	}
134 134
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
128 128
         $this->template_args['ticket_row_html'] = $ticket_row_html;
129 129
         $this->template_args['taxable_tickets'] = $taxable_tickets;
130 130
         $this->template_args['prices_displayed_including_taxes'] = $this->tax_config->prices_displayed_including_taxes;
131
-        $this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH . 'standard_ticket_selector.template.php';
131
+        $this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH.'standard_ticket_selector.template.php';
132 132
         remove_all_filters('FHEE__EE_Ticket_Selector__hide_ticket_selector');
133 133
     }
134 134
 }
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorRowSimple.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -14,26 +14,26 @@
 block discarded – undo
14 14
 class TicketSelectorRowSimple extends TicketSelectorRow
15 15
 {
16 16
 
17
-    /**
18
-     * @throws EE_Error
19
-     */
20
-    public function setupTicketStatusDisplay()
21
-    {
22
-        $remaining = $this->ticket->remaining();
23
-        $this->setTicketMinAndMax($remaining);
24
-        $this->setTicketStatusClasses($remaining);
25
-        $this->setTicketStatusDisplay($remaining);
26
-    }
17
+	/**
18
+	 * @throws EE_Error
19
+	 */
20
+	public function setupTicketStatusDisplay()
21
+	{
22
+		$remaining = $this->ticket->remaining();
23
+		$this->setTicketMinAndMax($remaining);
24
+		$this->setTicketStatusClasses($remaining);
25
+		$this->setTicketStatusDisplay($remaining);
26
+	}
27 27
 
28 28
 
29
-    public function getTicketDescription()
30
-    {
31
-        $filtered_row_content = $this->getFilteredRowContents();
32
-        if ($filtered_row_content !== false) {
33
-            remove_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
34
-            add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_false');
35
-            return $filtered_row_content;
36
-        }
37
-        return $this->ticket->description();
38
-    }
29
+	public function getTicketDescription()
30
+	{
31
+		$filtered_row_content = $this->getFilteredRowContents();
32
+		if ($filtered_row_content !== false) {
33
+			remove_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
34
+			add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_false');
35
+			return $filtered_row_content;
36
+		}
37
+		return $this->ticket->description();
38
+	}
39 39
 }
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorIframe.php 2 patches
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -22,81 +22,81 @@
 block discarded – undo
22 22
 class TicketSelectorIframe extends Iframe
23 23
 {
24 24
 
25
-    /**
26
-     * TicketSelectorIframe constructor.
27
-     *
28
-     * @throws InvalidArgumentException
29
-     * @throws InvalidInterfaceException
30
-     * @throws InvalidDataTypeException
31
-     * @throws DomainException
32
-     * @throws EE_Error
33
-     * @throws ReflectionException
34
-     */
35
-    public function __construct()
36
-    {
37
-        EE_Registry::instance()->REQ->set_espresso_page(true);
38
-        /** @type \EEM_Event $EEM_Event */
39
-        $EEM_Event = EE_Registry::instance()->load_model('Event');
40
-        $event = $EEM_Event->get_one_by_ID(
41
-            EE_Registry::instance()->REQ->get('event', 0)
42
-        );
43
-        $ticket_selector = new DisplayTicketSelector();
44
-        $ticket_selector->setIframe(true);
45
-        parent::__construct(
46
-            esc_html__('Ticket Selector', 'event_espresso'),
47
-            $ticket_selector->display($event)
48
-        );
49
-        $this->addStylesheets(
50
-            apply_filters(
51
-                'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
52
-                array(
53
-                    'ticket_selector_embed' => TICKET_SELECTOR_ASSETS_URL
54
-                                               . 'ticket_selector_embed.css?ver='
55
-                                               . EVENT_ESPRESSO_VERSION,
56
-                    'ticket_selector'       => TICKET_SELECTOR_ASSETS_URL
57
-                                               . 'ticket_selector.css?ver='
58
-                                               . EVENT_ESPRESSO_VERSION,
59
-                ),
60
-                $this
61
-            )
62
-        );
63
-        if (! apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__load_theme_css', false, $this)) {
64
-            $this->addStylesheets(array('site_theme' => ''));
65
-        }
66
-        $this->addScripts(
67
-            apply_filters(
68
-                'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
69
-                array(
70
-                    'ticket_selector_iframe_embed' => TICKET_SELECTOR_ASSETS_URL
71
-                                                      . 'ticket_selector_iframe_embed.js?ver='
72
-                                                      . EVENT_ESPRESSO_VERSION,
73
-                ),
74
-                $this
75
-            )
76
-        );
77
-        $js_attributes = apply_filters(
78
-            'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes',
79
-            array(),
80
-            $this
81
-        );
82
-        if (! empty($js_attributes)) {
83
-            $this->addScriptAttributes($js_attributes);
84
-        }
85
-        $this->addLocalizedVars(
86
-            apply_filters(
87
-                'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__localized_vars',
88
-                array(
89
-                    'ticket_selector_iframe' => true,
90
-                    'EEDTicketSelectorMsg'   => __(
91
-                        'Please choose at least one ticket before continuing.',
92
-                        'event_espresso'
93
-                    ),
94
-                )
95
-            )
96
-        );
97
-        do_action(
98
-            'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete',
99
-            $this
100
-        );
101
-    }
25
+	/**
26
+	 * TicketSelectorIframe constructor.
27
+	 *
28
+	 * @throws InvalidArgumentException
29
+	 * @throws InvalidInterfaceException
30
+	 * @throws InvalidDataTypeException
31
+	 * @throws DomainException
32
+	 * @throws EE_Error
33
+	 * @throws ReflectionException
34
+	 */
35
+	public function __construct()
36
+	{
37
+		EE_Registry::instance()->REQ->set_espresso_page(true);
38
+		/** @type \EEM_Event $EEM_Event */
39
+		$EEM_Event = EE_Registry::instance()->load_model('Event');
40
+		$event = $EEM_Event->get_one_by_ID(
41
+			EE_Registry::instance()->REQ->get('event', 0)
42
+		);
43
+		$ticket_selector = new DisplayTicketSelector();
44
+		$ticket_selector->setIframe(true);
45
+		parent::__construct(
46
+			esc_html__('Ticket Selector', 'event_espresso'),
47
+			$ticket_selector->display($event)
48
+		);
49
+		$this->addStylesheets(
50
+			apply_filters(
51
+				'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
52
+				array(
53
+					'ticket_selector_embed' => TICKET_SELECTOR_ASSETS_URL
54
+											   . 'ticket_selector_embed.css?ver='
55
+											   . EVENT_ESPRESSO_VERSION,
56
+					'ticket_selector'       => TICKET_SELECTOR_ASSETS_URL
57
+											   . 'ticket_selector.css?ver='
58
+											   . EVENT_ESPRESSO_VERSION,
59
+				),
60
+				$this
61
+			)
62
+		);
63
+		if (! apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__load_theme_css', false, $this)) {
64
+			$this->addStylesheets(array('site_theme' => ''));
65
+		}
66
+		$this->addScripts(
67
+			apply_filters(
68
+				'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
69
+				array(
70
+					'ticket_selector_iframe_embed' => TICKET_SELECTOR_ASSETS_URL
71
+													  . 'ticket_selector_iframe_embed.js?ver='
72
+													  . EVENT_ESPRESSO_VERSION,
73
+				),
74
+				$this
75
+			)
76
+		);
77
+		$js_attributes = apply_filters(
78
+			'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes',
79
+			array(),
80
+			$this
81
+		);
82
+		if (! empty($js_attributes)) {
83
+			$this->addScriptAttributes($js_attributes);
84
+		}
85
+		$this->addLocalizedVars(
86
+			apply_filters(
87
+				'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__localized_vars',
88
+				array(
89
+					'ticket_selector_iframe' => true,
90
+					'EEDTicketSelectorMsg'   => __(
91
+						'Please choose at least one ticket before continuing.',
92
+						'event_espresso'
93
+					),
94
+				)
95
+			)
96
+		);
97
+		do_action(
98
+			'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete',
99
+			$this
100
+		);
101
+	}
102 102
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 $this
61 61
             )
62 62
         );
63
-        if (! apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__load_theme_css', false, $this)) {
63
+        if ( ! apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__load_theme_css', false, $this)) {
64 64
             $this->addStylesheets(array('site_theme' => ''));
65 65
         }
66 66
         $this->addScripts(
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             array(),
80 80
             $this
81 81
         );
82
-        if (! empty($js_attributes)) {
82
+        if ( ! empty($js_attributes)) {
83 83
             $this->addScriptAttributes($js_attributes);
84 84
         }
85 85
         $this->addLocalizedVars(
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorRow.php 1 patch
Indentation   +364 added lines, -364 removed lines patch added patch discarded remove patch
@@ -18,368 +18,368 @@
 block discarded – undo
18 18
 abstract class TicketSelectorRow
19 19
 {
20 20
 
21
-    /**
22
-     * @var EE_Ticket $ticket
23
-     */
24
-    protected $ticket;
25
-
26
-    /**
27
-     * @var int $total_tickets
28
-     */
29
-    protected $total_tickets;
30
-
31
-    /**
32
-     * @var int $max_attendees
33
-     */
34
-    protected $max_attendees;
35
-
36
-    /**
37
-     * @var string $date_format
38
-     */
39
-    protected $date_format;
40
-
41
-    /**
42
-     * @var int $EVT_ID
43
-     */
44
-    protected $EVT_ID;
45
-
46
-    /**
47
-     * @var string $event_status
48
-     */
49
-    protected $event_status;
50
-
51
-    /**
52
-     * @var boolean $required_ticket_sold_out
53
-     */
54
-    protected $required_ticket_sold_out;
55
-
56
-    /**
57
-     * @var string $ticket_status_display
58
-     */
59
-    protected $ticket_status_display;
60
-
61
-    /**
62
-     * @var int $max
63
-     */
64
-    protected $max = 0;
65
-
66
-    /**
67
-     * @var int $min
68
-     */
69
-    protected $min = 0;
70
-
71
-    /**
72
-     * @var float $ticket_price
73
-     */
74
-    protected $ticket_price = 0.00;
75
-
76
-    /**
77
-     * @var bool $ticket_bundle
78
-     */
79
-    protected $ticket_bundle = false;
80
-
81
-    /**
82
-     * @var string $ticket_status_id
83
-     */
84
-    protected $ticket_status_id = EE_Ticket::sold_out;
85
-
86
-    /**
87
-     * @var string $ticket_status_html
88
-     */
89
-    protected $ticket_status_html = 'ticket-sales-sold-out';
90
-
91
-    /**
92
-     * @var string $status_class
93
-     */
94
-    protected $status_class = 'ticket-sales-sold-out lt-grey-text';
95
-
96
-
97
-    /**
98
-     * @param EE_Ticket $ticket
99
-     * @param int       $max_attendees
100
-     * @param string    $date_format
101
-     * @param string    $event_status
102
-     * @param bool      $required_ticket_sold_out
103
-     * @param int       $total_tickets
104
-     * @throws EE_Error
105
-     * @throws UnexpectedEntityException
106
-     */
107
-    public function __construct(
108
-        EE_Ticket $ticket,
109
-        $max_attendees,
110
-        $date_format,
111
-        $event_status,
112
-        $required_ticket_sold_out = false,
113
-        $total_tickets = 1
114
-    ) {
115
-        $this->ticket = $ticket;
116
-        $this->max_attendees = $max_attendees;
117
-        $this->date_format = $date_format;
118
-        $this->EVT_ID = $this->ticket->get_event_ID();
119
-        $this->event_status = $event_status;
120
-        $this->required_ticket_sold_out = $required_ticket_sold_out;
121
-        $this->total_tickets = $total_tickets;
122
-    }
123
-
124
-
125
-    /**
126
-     * getTicketStatusClasses
127
-     *
128
-     * @param int $remaining
129
-     * @return void
130
-     * @throws EE_Error
131
-     */
132
-    protected function setTicketStatusClasses($remaining = 0)
133
-    {
134
-        // if a previous required ticket with the same sale start date is sold out,
135
-        // then mark this ticket as sold out as well.
136
-        // tickets that go on sale at a later date than the required ticket  will NOT be affected
137
-        $this->ticket_status_id = $this->required_ticket_sold_out !== false
138
-                                  && $this->required_ticket_sold_out === $this->ticket->start_date()
139
-            ? EE_Ticket::sold_out
140
-            : $this->ticket->ticket_status();
141
-        $this->ticket_status_id = $this->event_status === EE_Datetime::sold_out
142
-            ? EE_Ticket::sold_out
143
-            : $this->ticket_status_id;
144
-        // check ticket status
145
-        switch ($this->ticket_status_id) {
146
-            // sold_out
147
-            case EE_Ticket::sold_out:
148
-                $ticket_status_class = 'ticket-sales-sold-out';
149
-                $this->status_class = 'ticket-sales-sold-out lt-grey-text';
150
-                break;
151
-            // expired
152
-            case EE_Ticket::expired:
153
-                $ticket_status_class = 'ticket-sales-expired';
154
-                $this->status_class = 'ticket-sales-expired lt-grey-text';
155
-                break;
156
-            // archived
157
-            case EE_Ticket::archived:
158
-                $ticket_status_class = 'archived-ticket';
159
-                $this->status_class = 'archived-ticket hidden';
160
-                break;
161
-            // pending
162
-            case EE_Ticket::pending:
163
-                $ticket_status_class = 'ticket-pending';
164
-                $this->status_class = 'ticket-pending';
165
-                break;
166
-            // on sale
167
-            case EE_Ticket::onsale:
168
-            default:
169
-                $ticket_status_class = 'ticket-on-sale';
170
-                $this->status_class = 'ticket-on-sale';
171
-                break;
172
-        }
173
-        $this->ticket_status_html = EEH_HTML::span(
174
-            $this->ticket->ticket_status(true, ($remaining > 0)),
175
-            "{$ticket_status_class}-{$this->ticket->ID()}",
176
-            $ticket_status_class
177
-        );
178
-    }
179
-
180
-
181
-    /**
182
-     * @return string
183
-     */
184
-    public function getTicketStatusDisplay()
185
-    {
186
-        return $this->ticket_status_display;
187
-    }
188
-
189
-
190
-    /**
191
-     * setTicketStatusDisplay
192
-     *
193
-     * @param int $remaining
194
-     * @throws EE_Error
195
-     */
196
-    protected function setTicketStatusDisplay($remaining)
197
-    {
198
-        $this->ticket_status_display = '';
199
-        // now depending on the ticket and other circumstances...
200
-        if ($this->max_attendees === 0) {
201
-            // registration is CLOSED because admin set max attendees to ZERO
202
-            $this->ticket_status_display = $this->registrationClosed();
203
-        } elseif ($this->ticket_status_id === EE_Ticket::sold_out || $remaining === 0) {
204
-            // SOLD OUT - no tickets remaining
205
-            $this->ticket_status_display = $this->ticketsSoldOut();
206
-        } elseif ($this->ticket_status_id === EE_Ticket::expired || $this->ticket_status_id === EE_Ticket::archived) {
207
-            // expired or archived ticket
208
-            $this->ticket_status_display = $this->ticket_status_html;
209
-        } elseif ($this->ticket_status_id === EE_Ticket::pending) {
210
-            // ticket not on sale yet
211
-            $this->ticket_status_display = $this->ticketsSalesPending();
212
-        } elseif ($this->ticket->min() > $remaining) {
213
-            // min qty purchasable is less than tickets available
214
-            $this->ticket_status_display = $this->notEnoughTicketsAvailable();
215
-        }
216
-    }
217
-
218
-
219
-    /**
220
-     * registrationClosed
221
-     */
222
-    protected function registrationClosed()
223
-    {
224
-        return EEH_HTML::span(
225
-            apply_filters(
226
-                'FHEE__ticket_selector_chart_template__ticket_closed_msg',
227
-                __('Closed', 'event_espresso')
228
-            ),
229
-            '',
230
-            'sold-out'
231
-        );
232
-    }
233
-
234
-
235
-    /**
236
-     * ticketsSoldOut
237
-     */
238
-    protected function ticketsSoldOut()
239
-    {
240
-        return EEH_HTML::span(
241
-            apply_filters(
242
-                'FHEE__ticket_selector_chart_template__ticket_sold_out_msg',
243
-                __('Sold&nbsp;Out', 'event_espresso')
244
-            ),
245
-            '',
246
-            'sold-out'
247
-        );
248
-    }
249
-
250
-
251
-    /**
252
-     * ticketsSalesPending
253
-     *
254
-     * @throws EE_Error
255
-     */
256
-    protected function ticketsSalesPending()
257
-    {
258
-        return EEH_HTML::span(
259
-            EEH_HTML::span(
260
-                apply_filters(
261
-                    'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg',
262
-                    __('Goes&nbsp;On&nbsp;Sale', 'event_espresso')
263
-                ),
264
-                '',
265
-                'ticket-pending'
266
-            )
267
-            . EEH_HTML::br()
268
-            . EEH_HTML::span(
269
-                $this->ticket->get_i18n_datetime(
270
-                    'TKT_start_date',
271
-                    apply_filters(
272
-                        'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format',
273
-                        $this->date_format
274
-                    )
275
-                ),
276
-                '',
277
-                'small-text'
278
-            ),
279
-            '',
280
-            'ticket-pending-pg'
281
-        );
282
-    }
283
-
284
-
285
-    /**
286
-     * notEnoughTicketsAvailable
287
-     */
288
-    protected function notEnoughTicketsAvailable()
289
-    {
290
-        return EEH_HTML::div(
291
-            EEH_HTML::span(
292
-                apply_filters(
293
-                    'FHEE__ticket_selector_chart_template__ticket_not_available_msg',
294
-                    __('Not Available', 'event_espresso')
295
-                ),
296
-                '',
297
-                'archived-ticket small-text'
298
-            )
299
-            . EEH_HTML::br(),
300
-            '',
301
-            'archived-ticket-pg'
302
-        );
303
-    }
304
-
305
-
306
-    /**
307
-     * setTicketMinAndMax
308
-     *
309
-     * @param int $remaining
310
-     * @return void
311
-     * @throws EE_Error
312
-     */
313
-    protected function setTicketMinAndMax($remaining)
314
-    {
315
-        // offer the number of $tickets_remaining or $this->max_attendees, whichever is smaller
316
-        $this->max = min($remaining, $this->max_attendees);
317
-        // but... we also want to restrict the number of tickets by the ticket max setting,
318
-        // however, the max still can't be higher than what was just set above
319
-        $this->max = $this->ticket->max() > 0
320
-            ? min($this->ticket->max(), $this->max)
321
-            : $this->max;
322
-        // and we also want to restrict the minimum number of tickets by the ticket min setting
323
-        $this->min = $this->ticket->min() > 0
324
-            ? $this->ticket->min()
325
-            : 0;
326
-        // and if the ticket is required, then make sure that min qty is at least 1
327
-        $this->min = $this->ticket->required()
328
-            ? max($this->min, 1)
329
-            : $this->min;
330
-    }
331
-
332
-
333
-    /**
334
-     * Allow plugins to hook in and abort the generation and display of this row to do
335
-     * something elseif they want.
336
-     * For an addon to abort things, all they have to do is register a filter with this hook, and
337
-     * return a value that is NOT false.  Whatever is returned gets echoed instead of the
338
-     * current row.
339
-     *
340
-     * @return string|bool
341
-     */
342
-    protected function getFilteredRowHtml()
343
-    {
344
-        return apply_filters(
345
-            'FHEE__ticket_selector_chart_template__do_ticket_entire_row',
346
-            false,
347
-            $this->ticket,
348
-            $this->max,
349
-            $this->min,
350
-            $this->required_ticket_sold_out,
351
-            $this->ticket_price,
352
-            $this->ticket_bundle,
353
-            $this->ticket_status_html,
354
-            $this->status_class,
355
-            $this
356
-        );
357
-    }
358
-
359
-
360
-    /**
361
-     * Allow plugins to hook in and abort the generation and display of the contents of this
362
-     * row to do something elseif they want.
363
-     * For an addon to abort things, all they have to do is register a filter with this hook, and
364
-     * return a value that is NOT false.  Whatever is returned gets echoed instead of the
365
-     * current row.
366
-     *
367
-     * @return string|bool
368
-     */
369
-    protected function getFilteredRowContents()
370
-    {
371
-        return apply_filters(
372
-            'FHEE__ticket_selector_chart_template__do_ticket_inside_row',
373
-            false,
374
-            $this->ticket,
375
-            $this->max,
376
-            $this->min,
377
-            $this->required_ticket_sold_out,
378
-            $this->ticket_price,
379
-            $this->ticket_bundle,
380
-            $this->ticket_status_html,
381
-            $this->status_class,
382
-            $this
383
-        );
384
-    }
21
+	/**
22
+	 * @var EE_Ticket $ticket
23
+	 */
24
+	protected $ticket;
25
+
26
+	/**
27
+	 * @var int $total_tickets
28
+	 */
29
+	protected $total_tickets;
30
+
31
+	/**
32
+	 * @var int $max_attendees
33
+	 */
34
+	protected $max_attendees;
35
+
36
+	/**
37
+	 * @var string $date_format
38
+	 */
39
+	protected $date_format;
40
+
41
+	/**
42
+	 * @var int $EVT_ID
43
+	 */
44
+	protected $EVT_ID;
45
+
46
+	/**
47
+	 * @var string $event_status
48
+	 */
49
+	protected $event_status;
50
+
51
+	/**
52
+	 * @var boolean $required_ticket_sold_out
53
+	 */
54
+	protected $required_ticket_sold_out;
55
+
56
+	/**
57
+	 * @var string $ticket_status_display
58
+	 */
59
+	protected $ticket_status_display;
60
+
61
+	/**
62
+	 * @var int $max
63
+	 */
64
+	protected $max = 0;
65
+
66
+	/**
67
+	 * @var int $min
68
+	 */
69
+	protected $min = 0;
70
+
71
+	/**
72
+	 * @var float $ticket_price
73
+	 */
74
+	protected $ticket_price = 0.00;
75
+
76
+	/**
77
+	 * @var bool $ticket_bundle
78
+	 */
79
+	protected $ticket_bundle = false;
80
+
81
+	/**
82
+	 * @var string $ticket_status_id
83
+	 */
84
+	protected $ticket_status_id = EE_Ticket::sold_out;
85
+
86
+	/**
87
+	 * @var string $ticket_status_html
88
+	 */
89
+	protected $ticket_status_html = 'ticket-sales-sold-out';
90
+
91
+	/**
92
+	 * @var string $status_class
93
+	 */
94
+	protected $status_class = 'ticket-sales-sold-out lt-grey-text';
95
+
96
+
97
+	/**
98
+	 * @param EE_Ticket $ticket
99
+	 * @param int       $max_attendees
100
+	 * @param string    $date_format
101
+	 * @param string    $event_status
102
+	 * @param bool      $required_ticket_sold_out
103
+	 * @param int       $total_tickets
104
+	 * @throws EE_Error
105
+	 * @throws UnexpectedEntityException
106
+	 */
107
+	public function __construct(
108
+		EE_Ticket $ticket,
109
+		$max_attendees,
110
+		$date_format,
111
+		$event_status,
112
+		$required_ticket_sold_out = false,
113
+		$total_tickets = 1
114
+	) {
115
+		$this->ticket = $ticket;
116
+		$this->max_attendees = $max_attendees;
117
+		$this->date_format = $date_format;
118
+		$this->EVT_ID = $this->ticket->get_event_ID();
119
+		$this->event_status = $event_status;
120
+		$this->required_ticket_sold_out = $required_ticket_sold_out;
121
+		$this->total_tickets = $total_tickets;
122
+	}
123
+
124
+
125
+	/**
126
+	 * getTicketStatusClasses
127
+	 *
128
+	 * @param int $remaining
129
+	 * @return void
130
+	 * @throws EE_Error
131
+	 */
132
+	protected function setTicketStatusClasses($remaining = 0)
133
+	{
134
+		// if a previous required ticket with the same sale start date is sold out,
135
+		// then mark this ticket as sold out as well.
136
+		// tickets that go on sale at a later date than the required ticket  will NOT be affected
137
+		$this->ticket_status_id = $this->required_ticket_sold_out !== false
138
+								  && $this->required_ticket_sold_out === $this->ticket->start_date()
139
+			? EE_Ticket::sold_out
140
+			: $this->ticket->ticket_status();
141
+		$this->ticket_status_id = $this->event_status === EE_Datetime::sold_out
142
+			? EE_Ticket::sold_out
143
+			: $this->ticket_status_id;
144
+		// check ticket status
145
+		switch ($this->ticket_status_id) {
146
+			// sold_out
147
+			case EE_Ticket::sold_out:
148
+				$ticket_status_class = 'ticket-sales-sold-out';
149
+				$this->status_class = 'ticket-sales-sold-out lt-grey-text';
150
+				break;
151
+			// expired
152
+			case EE_Ticket::expired:
153
+				$ticket_status_class = 'ticket-sales-expired';
154
+				$this->status_class = 'ticket-sales-expired lt-grey-text';
155
+				break;
156
+			// archived
157
+			case EE_Ticket::archived:
158
+				$ticket_status_class = 'archived-ticket';
159
+				$this->status_class = 'archived-ticket hidden';
160
+				break;
161
+			// pending
162
+			case EE_Ticket::pending:
163
+				$ticket_status_class = 'ticket-pending';
164
+				$this->status_class = 'ticket-pending';
165
+				break;
166
+			// on sale
167
+			case EE_Ticket::onsale:
168
+			default:
169
+				$ticket_status_class = 'ticket-on-sale';
170
+				$this->status_class = 'ticket-on-sale';
171
+				break;
172
+		}
173
+		$this->ticket_status_html = EEH_HTML::span(
174
+			$this->ticket->ticket_status(true, ($remaining > 0)),
175
+			"{$ticket_status_class}-{$this->ticket->ID()}",
176
+			$ticket_status_class
177
+		);
178
+	}
179
+
180
+
181
+	/**
182
+	 * @return string
183
+	 */
184
+	public function getTicketStatusDisplay()
185
+	{
186
+		return $this->ticket_status_display;
187
+	}
188
+
189
+
190
+	/**
191
+	 * setTicketStatusDisplay
192
+	 *
193
+	 * @param int $remaining
194
+	 * @throws EE_Error
195
+	 */
196
+	protected function setTicketStatusDisplay($remaining)
197
+	{
198
+		$this->ticket_status_display = '';
199
+		// now depending on the ticket and other circumstances...
200
+		if ($this->max_attendees === 0) {
201
+			// registration is CLOSED because admin set max attendees to ZERO
202
+			$this->ticket_status_display = $this->registrationClosed();
203
+		} elseif ($this->ticket_status_id === EE_Ticket::sold_out || $remaining === 0) {
204
+			// SOLD OUT - no tickets remaining
205
+			$this->ticket_status_display = $this->ticketsSoldOut();
206
+		} elseif ($this->ticket_status_id === EE_Ticket::expired || $this->ticket_status_id === EE_Ticket::archived) {
207
+			// expired or archived ticket
208
+			$this->ticket_status_display = $this->ticket_status_html;
209
+		} elseif ($this->ticket_status_id === EE_Ticket::pending) {
210
+			// ticket not on sale yet
211
+			$this->ticket_status_display = $this->ticketsSalesPending();
212
+		} elseif ($this->ticket->min() > $remaining) {
213
+			// min qty purchasable is less than tickets available
214
+			$this->ticket_status_display = $this->notEnoughTicketsAvailable();
215
+		}
216
+	}
217
+
218
+
219
+	/**
220
+	 * registrationClosed
221
+	 */
222
+	protected function registrationClosed()
223
+	{
224
+		return EEH_HTML::span(
225
+			apply_filters(
226
+				'FHEE__ticket_selector_chart_template__ticket_closed_msg',
227
+				__('Closed', 'event_espresso')
228
+			),
229
+			'',
230
+			'sold-out'
231
+		);
232
+	}
233
+
234
+
235
+	/**
236
+	 * ticketsSoldOut
237
+	 */
238
+	protected function ticketsSoldOut()
239
+	{
240
+		return EEH_HTML::span(
241
+			apply_filters(
242
+				'FHEE__ticket_selector_chart_template__ticket_sold_out_msg',
243
+				__('Sold&nbsp;Out', 'event_espresso')
244
+			),
245
+			'',
246
+			'sold-out'
247
+		);
248
+	}
249
+
250
+
251
+	/**
252
+	 * ticketsSalesPending
253
+	 *
254
+	 * @throws EE_Error
255
+	 */
256
+	protected function ticketsSalesPending()
257
+	{
258
+		return EEH_HTML::span(
259
+			EEH_HTML::span(
260
+				apply_filters(
261
+					'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg',
262
+					__('Goes&nbsp;On&nbsp;Sale', 'event_espresso')
263
+				),
264
+				'',
265
+				'ticket-pending'
266
+			)
267
+			. EEH_HTML::br()
268
+			. EEH_HTML::span(
269
+				$this->ticket->get_i18n_datetime(
270
+					'TKT_start_date',
271
+					apply_filters(
272
+						'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format',
273
+						$this->date_format
274
+					)
275
+				),
276
+				'',
277
+				'small-text'
278
+			),
279
+			'',
280
+			'ticket-pending-pg'
281
+		);
282
+	}
283
+
284
+
285
+	/**
286
+	 * notEnoughTicketsAvailable
287
+	 */
288
+	protected function notEnoughTicketsAvailable()
289
+	{
290
+		return EEH_HTML::div(
291
+			EEH_HTML::span(
292
+				apply_filters(
293
+					'FHEE__ticket_selector_chart_template__ticket_not_available_msg',
294
+					__('Not Available', 'event_espresso')
295
+				),
296
+				'',
297
+				'archived-ticket small-text'
298
+			)
299
+			. EEH_HTML::br(),
300
+			'',
301
+			'archived-ticket-pg'
302
+		);
303
+	}
304
+
305
+
306
+	/**
307
+	 * setTicketMinAndMax
308
+	 *
309
+	 * @param int $remaining
310
+	 * @return void
311
+	 * @throws EE_Error
312
+	 */
313
+	protected function setTicketMinAndMax($remaining)
314
+	{
315
+		// offer the number of $tickets_remaining or $this->max_attendees, whichever is smaller
316
+		$this->max = min($remaining, $this->max_attendees);
317
+		// but... we also want to restrict the number of tickets by the ticket max setting,
318
+		// however, the max still can't be higher than what was just set above
319
+		$this->max = $this->ticket->max() > 0
320
+			? min($this->ticket->max(), $this->max)
321
+			: $this->max;
322
+		// and we also want to restrict the minimum number of tickets by the ticket min setting
323
+		$this->min = $this->ticket->min() > 0
324
+			? $this->ticket->min()
325
+			: 0;
326
+		// and if the ticket is required, then make sure that min qty is at least 1
327
+		$this->min = $this->ticket->required()
328
+			? max($this->min, 1)
329
+			: $this->min;
330
+	}
331
+
332
+
333
+	/**
334
+	 * Allow plugins to hook in and abort the generation and display of this row to do
335
+	 * something elseif they want.
336
+	 * For an addon to abort things, all they have to do is register a filter with this hook, and
337
+	 * return a value that is NOT false.  Whatever is returned gets echoed instead of the
338
+	 * current row.
339
+	 *
340
+	 * @return string|bool
341
+	 */
342
+	protected function getFilteredRowHtml()
343
+	{
344
+		return apply_filters(
345
+			'FHEE__ticket_selector_chart_template__do_ticket_entire_row',
346
+			false,
347
+			$this->ticket,
348
+			$this->max,
349
+			$this->min,
350
+			$this->required_ticket_sold_out,
351
+			$this->ticket_price,
352
+			$this->ticket_bundle,
353
+			$this->ticket_status_html,
354
+			$this->status_class,
355
+			$this
356
+		);
357
+	}
358
+
359
+
360
+	/**
361
+	 * Allow plugins to hook in and abort the generation and display of the contents of this
362
+	 * row to do something elseif they want.
363
+	 * For an addon to abort things, all they have to do is register a filter with this hook, and
364
+	 * return a value that is NOT false.  Whatever is returned gets echoed instead of the
365
+	 * current row.
366
+	 *
367
+	 * @return string|bool
368
+	 */
369
+	protected function getFilteredRowContents()
370
+	{
371
+		return apply_filters(
372
+			'FHEE__ticket_selector_chart_template__do_ticket_inside_row',
373
+			false,
374
+			$this->ticket,
375
+			$this->max,
376
+			$this->min,
377
+			$this->required_ticket_sold_out,
378
+			$this->ticket_price,
379
+			$this->ticket_bundle,
380
+			$this->ticket_status_html,
381
+			$this->status_class,
382
+			$this
383
+		);
384
+	}
385 385
 }
Please login to merge, or discard this patch.