Completed
Push — master ( af42cb...3888f0 )
by Julito
13:17
created

LanguageRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A findAllPlatformSubLanguages() 0 12 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Repository;
5
6
use Doctrine\ORM\EntityRepository;
7
8
/**
9
 * Class LanguageRepository.
10
 *
11
 * @package Chamilo\CoreBundle\Repository
12
 */
13
class LanguageRepository extends EntityRepository
14
{
15
    /**
16
     * Get all the sub languages that are made available by the admin.
17
     *
18
     * @return array
19
     */
20
    public function findAllPlatformSubLanguages()
21
    {
22
        $qb = $this->createQueryBuilder('l');
23
        $qb->select('l')
24
            ->where(
25
                $qb->expr()->eq('l.available', true)
26
            )
27
            ->andWhere(
28
                $qb->expr()->isNotNull('l.parent')
29
            );
30
31
        return $qb->getQuery()->getResult();
32
    }
33
}
34