Passed
Push — master ( 76abd2...ab5d59 )
by Julito
10:01
created

AccessUrlRepository::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
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 Chamilo\CoreBundle\Entity\AccessUrl;
7
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
8
use Doctrine\Common\Persistence\ManagerRegistry;
9
10
/**
11
 * Class AccessUrlRepository.
12
 *
13
 * @package Chamilo\CoreBundle\Repository
14
 */
15
class AccessUrlRepository extends ServiceEntityRepository
16
{
17
    /**
18
     * AccessUrlRepository constructor.
19
     *
20
     * @param ManagerRegistry $registry
21
     */
22
    public function __construct(ManagerRegistry $registry)
23
    {
24
        parent::__construct($registry, AccessUrl::class);
25
    }
26
27
    /**
28
     * Select the first access_url ID in the list as a default setting for
29
     * the creation of new users.
30
     *
31
     * @return mixed
32
     */
33
    public function getFirstId()
34
    {
35
        $qb = $this->createQueryBuilder('a');
36
        $qb->select('MIN (a.id)');
37
        $q = $qb->getQuery();
38
39
        return $q->execute();
40
    }
41
}
42