TicketRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A countOpenedTickets() 0 8 1
1
<?php
2
3
namespace Matks\Bundle\CustomerSupportBundle\Repository;
4
5
use Matks\Bundle\CustomerSupportBundle\Model\TicketInterface;
6
use Doctrine\ORM\EntityRepository;
7
8
/**
9
 * Ticket repository
10
 *
11
 * @author Mathieu Ferment <[email protected]>
12
 */
13
class TicketRepository extends EntityRepository
14
{
15
    public function countOpenedTickets()
16
    {
17
        $queryBuilder = $this->createQueryBuilder('t')
18
            ->select('COUNT(t.id)')
19
            ->where('t.status IN (:openedStatuses)')
20
            ->setParameter(':openedStatuses', [TicketInterface::STATUS_NEW, TicketInterface::STATUS_REOPENED]);
21
22
        return $queryBuilder->getQuery()->getSingleScalarResult();
23
    }
24
}
25