OpzionitabelleRepository::findOpzioniTabella()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 13
ccs 9
cts 9
cp 1
crap 1
rs 10
c 0
b 0
f 0
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