Jacek Kowalski
4 hours ago 6b9278a5d57091fce636dbb640b380cfb990db6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
declare(strict_types=1);
 
namespace App\Repository;
 
use App\Entity\Borrow;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
 
/**
 * @extends ServiceEntityRepository<Borrow>
 */
class BorrowRepository extends ServiceEntityRepository {
    public function __construct(ManagerRegistry $registry) {
        parent::__construct($registry, Borrow::class);
    }
 
    public function createListQueryBuilder(): QueryBuilder {
        return $this->createQueryBuilder('br')
            ->addSelect('b')
            ->join('br.book', 'b')
            ->orderBy('br.at', 'ASC');
    }
}