Completed
Branch EDTR/master (0d7008)
by
unknown
34:37 queued 26:06
created

TicketLoader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getQuery() 0 4 1
A getWhereParams() 0 7 1
1
<?php
2
3
namespace EventEspresso\core\domain\services\graphql\data\loaders;
4
5
use EEM_Ticket;
6
use EventEspresso\core\exceptions\InvalidDataTypeException;
7
use EventEspresso\core\exceptions\InvalidInterfaceException;
8
use InvalidArgumentException;
9
10
/**
11
 * Class TickeLoader
12
 */
13
class TicketLoader extends AbstractLoader
14
{
15
    /**
16
     * @return EE_Base_Class
17
     * @throws EE_Error
18
     * @throws InvalidArgumentException
19
     * @throws InvalidDataTypeException
20
     * @throws InvalidInterfaceException
21
     */
22
    protected function getQuery()
23
    {
24
        return EEM_Ticket::instance();
25
    }
26
27
    /**
28
     * @param array $keys
29
     *
30
     * @return array
31
     * @throws EE_Error
32
     * @throws InvalidArgumentException
33
     * @throws InvalidDataTypeException
34
     * @throws InvalidInterfaceException
35
     */
36
    protected function getWhereParams(array $keys)
37
    {
38
        return [
39
            'TKT_ID'      => ['IN', $keys],
40
            'TKT_deleted' => ['IN', [true, false]]
41
        ];
42
    }
43
}
44