50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Repository;
|
|
|
|
use App\Entity\Conference;
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
|
|
/**
|
|
* @extends ServiceEntityRepository<Conference>
|
|
*/
|
|
class ConferenceRepository extends ServiceEntityRepository
|
|
{
|
|
public function __construct(ManagerRegistry $registry)
|
|
{
|
|
parent::__construct($registry, Conference::class);
|
|
}
|
|
|
|
public function findAll(): array
|
|
{
|
|
// Override findAll() to use custom sorting
|
|
return $this->findBy([], ['year' => 'ASC', 'city' => 'ASC']);
|
|
}
|
|
|
|
// /**
|
|
// * @return Conference[] Returns an array of Conference objects
|
|
// */
|
|
// public function findByExampleField($value): array
|
|
// {
|
|
// return $this->createQueryBuilder('c')
|
|
// ->andWhere('c.exampleField = :val')
|
|
// ->setParameter('val', $value)
|
|
// ->orderBy('c.id', 'ASC')
|
|
// ->setMaxResults(10)
|
|
// ->getQuery()
|
|
// ->getResult()
|
|
// ;
|
|
// }
|
|
|
|
// public function findOneBySomeField($value): ?Conference
|
|
// {
|
|
// return $this->createQueryBuilder('c')
|
|
// ->andWhere('c.exampleField = :val')
|
|
// ->setParameter('val', $value)
|
|
// ->getQuery()
|
|
// ->getOneOrNullResult()
|
|
// ;
|
|
// }
|
|
}
|