src/Repository/BasicPageRepository.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Repository;
  3. use App\Entity\BasicPage;
  4. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  5. use Doctrine\Persistence\ManagerRegistry;
  6. /**
  7.  * @method BasicPage|null find($id, $lockMode = null, $lockVersion = null)
  8.  * @method BasicPage|null findOneBy(array $criteria, array $orderBy = null)
  9.  * @method BasicPage[]    findAll()
  10.  * @method BasicPage[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  11.  */
  12. class BasicPageRepository extends ServiceEntityRepository
  13. {
  14.     public function __construct(ManagerRegistry $registry)
  15.     {
  16.         parent::__construct($registryBasicPage::class);
  17.     }
  18.     /**
  19.      * @return BasicPage
  20.      */
  21.     public function findFirst()
  22.     {
  23.         return $this->createQueryBuilder('b')
  24.         ->orderBy('b.id''ASC')
  25.             ->setFirstResult(0)
  26.             ->setMaxResults(1)
  27.             ->getQuery()
  28.             ->getResult()
  29.     ;
  30.     }
  31.     // /**
  32.     //  * @return BasicPage[] Returns an array of BasicPage objects
  33.     //  */
  34.     /*
  35.     public function findByExampleField($value)
  36.     {
  37.         return $this->createQueryBuilder('b')
  38.             ->andWhere('b.exampleField = :val')
  39.             ->setParameter('val', $value)
  40.             ->orderBy('b.id', 'ASC')
  41.             ->setMaxResults(10)
  42.             ->getQuery()
  43.             ->getResult()
  44.         ;
  45.     }
  46.     */
  47.     /*
  48.     public function findOneBySomeField($value): ?BasicPage
  49.     {
  50.         return $this->createQueryBuilder('b')
  51.             ->andWhere('b.exampleField = :val')
  52.             ->setParameter('val', $value)
  53.             ->getQuery()
  54.             ->getOneOrNullResult()
  55.         ;
  56.     }
  57.     */
  58. }