Completed
Push — master ( 5e4ebc...f96e76 )
by Florian
13s queued 11s
created

OrganisationRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
c 1
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findActive() 0 7 1
A findHidden() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the vseth-semesterly-reports project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Repository;
13
14
use App\Entity\Organisation;
15
use Doctrine\ORM\EntityRepository;
16
17
class OrganisationRepository extends EntityRepository
18
{
19
    /**
20
     * @return Organisation[]
21
     */
22
    public function findHidden()
23
    {
24
        $qb = $this->createQueryBuilder('u');
25
        $qb->where('u.hiddenAt IS NOT NULL')
26
            ->orderBy('u.name', 'ASC');
27
28
        return $qb->getQuery()->getResult();
29
    }
30
31
    /**
32
     * @return Organisation[]
33
     */
34
    public function findActive()
35
    {
36
        $qb = $this->createQueryBuilder('u');
37
        $qb->where('u.hiddenAt IS NULL')
38
            ->orderBy('u.name', 'ASC');
39
40
        return $qb->getQuery()->getResult();
41
    }
42
}
43