OpzionitabelleRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 9
dl 0
loc 20
ccs 9
cts 9
cp 1
rs 10
c 1
b 1
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A findOpzioniTabella() 0 13 1
1
<?php
2
3
namespace Cdf\BiCoreBundle\Repository;
4
5
use Doctrine\ORM\EntityRepository;
6
use Cdf\BiCoreBundle\Entity\Opzionitabelle;
7
8
class OpzionitabelleRepository extends EntityRepository
9
{
10
    /**
11
     *
12
     * @param string $tabella
13
     * @return array<Opzionitabelle>
14
     */
15 12
    public function findOpzioniTabella(string $tabella): array
16
    {
17 12
        $em = $this->getEntityManager();
18
        /* @var $qb \Doctrine\ORM\QueryBuilder */
19 12
        $qb = $em->createQueryBuilder();
20 12
        $qb->select(array('t'));
21 12
        $qb->from(Opzionitabelle::class, 't');
22 12
        $qb->where("(t.nometabella = '*' OR t.nometabella = :tabella)");
23 12
        $qb->setParameter('tabella', $tabella);
24
        //$opzioni = $qb->getQuery()->useQueryCache(true)->useResultCache(true, null, 'Opzionitabella')->getResult();
25 12
        $opzioni = $qb->getQuery()->getResult();
26
27 12
        return $opzioni;
28
    }
29
}
30