Completed
Branch FET-9222-rest-api-writes (8a2732)
by
unknown
55:53 queued 45:02
created

TicketSelectorRowSimple::getTicketDescription()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace EventEspresso\modules\ticket_selector;
3
4
use EE_Error;
5
6
defined('EVENT_ESPRESSO_VERSION') || exit;
7
8
9
10
/**
11
 * Class TicketSelectorRowSimple
12
 * class for loading template and resolving template args for the ticket row within a "DWMTS" ticket selector
13
 *
14
 * @package       Event Espresso
15
 * @author        Brent Christensen
16
 * @since         $VID:$
17
 */
18
class TicketSelectorRowSimple extends TicketSelectorRow
19
{
20
21
    /**
22
     * @throws EE_Error
23
     */
24
    public function setupTicketStatusDisplay()
25
    {
26
        $remaining = $this->ticket->remaining();
27
        $this->setTicketMinAndMax($remaining);
28
        $this->setTicketStatusClasses($remaining);
29
        $this->setTicketStatusDisplay($remaining);
30
    }
31
32
33
34
    public function getTicketDescription()
35
    {
36
        $filtered_row_content = $this->getFilteredRowContents();
37
        if($filtered_row_content !== false) {
38
            remove_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
39
            add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_false');
40
            return $filtered_row_content;
41
        }
42
        return $this->ticket->description();
43
    }
44
45
}
46
// End of file TicketSelectorRowSimple.php
47
// Location: EventEspresso\modules\ticket_selector/TicketSelectorRowSimple.php
48