Browse Source

Merge from 1.11.x

jmontoyaa 7 years ago
parent
commit
9213340ebb
1 changed files with 26 additions and 0 deletions
  1. 26 0
      src/Chamilo/CoreBundle/Entity/Repository/AccessUrlRepository.php

+ 26 - 0
src/Chamilo/CoreBundle/Entity/Repository/AccessUrlRepository.php

@@ -0,0 +1,26 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+namespace Chamilo\CoreBundle\Entity\Repository;
+
+use Doctrine\ORM\EntityRepository;
+
+/**
+ * Class AccessUrlRepository
+ * @package Chamilo\CoreBundle\Entity\Repository
+ */
+class AccessUrlRepository extends EntityRepository
+{
+    /**
+     * Select the first access_url ID in the list as a default setting for
+     * the creation of new users.
+     * @return mixed
+     */
+    public function getFirstId()
+    {
+        $qb = $this->createQueryBuilder('a');
+        $qb->select('MIN (a.id)');
+        $q = $qb->getQuery();
+        return $q->execute();
+    }
+}