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

AccessUrlRepository::getFirstId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
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 AccessUrlRepository.
10
 *
11
 * @package Chamilo\CoreBundle\Repository
12
 */
13
class AccessUrlRepository extends EntityRepository
14
{
15
    /**
16
     * Select the first access_url ID in the list as a default setting for
17
     * the creation of new users.
18
     *
19
     * @return mixed
20
     */
21
    public function getFirstId()
22
    {
23
        $qb = $this->createQueryBuilder('a');
24
        $qb->select('MIN (a.id)');
25
        $q = $qb->getQuery();
26
27
        return $q->execute();
28
    }
29
}
30