Passed
Push — master ( ee4256...c7999a )
by Julito
08:50
created

ExtraFieldRepository::getExtraFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\Repository;
8
9
use Chamilo\CoreBundle\Entity\ExtraField;
10
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
11
use Doctrine\Persistence\ManagerRegistry;
12
13
class ExtraFieldRepository extends ServiceEntityRepository
14
{
15
    public function __construct(ManagerRegistry $registry)
16
    {
17
        parent::__construct($registry, ExtraField::class);
18
    }
19
20
    /**
21
     * @return ExtraField[]
22
     */
23
    public function getExtraFields()
24
    {
25
        $qb = $this->createQueryBuilder('f');
26
        $qb
27
            ->where(
28
                $qb->expr()->andX(
29
                    $qb->expr()->eq('f.visibleToSelf', true)
30
                )
31
            )
32
        ;
33
34
        return $qb->getQuery()->getResult();
35
    }
36
}
37