Completed
Branch BUG-10916-capabilities-dude (8430d3)
by
unknown
46:50 queued 34:40
created

TicketSelectorRowSimple   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setupTicketStatusDisplay() 0 7 1
A getTicketDescription() 0 10 2
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