Skip to content

Commit f96ca27

Browse files
committed
fix: set fetchJoinCollection to false for ticket repo
1 parent 471a8ff commit f96ca27

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

app/Repositories/DoctrineRepository.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Doctrine\ORM\EntityManagerInterface;
1818
use Doctrine\ORM\EntityRepository;
1919
use Doctrine\ORM\LazyCriteriaCollection;
20+
use Doctrine\ORM\Mapping\ClassMetadata;
2021
use Doctrine\ORM\NativeQuery;
2122
use Doctrine\ORM\Query;
2223
use Doctrine\ORM\Query\ResultSetMappingBuilder;
@@ -39,6 +40,12 @@
3940
*/
4041
abstract class DoctrineRepository extends EntityRepository implements IBaseRepository
4142
{
43+
protected $fetchJoinCollection = true;
44+
45+
public function __construct(EntityManagerInterface $em, ClassMetadata $class)
46+
{
47+
parent::__construct($em, $class);
48+
}
4249

4350
/**
4451
* @var string
@@ -518,7 +525,7 @@ protected function getAllAbstractByPage
518525
->setFirstResult($paging_info->getOffset())
519526
->setMaxResults($paging_info->getPerPage());
520527

521-
$paginator = new Paginator($query, $fetchJoinCollection = true);
528+
$paginator = new Paginator($query, $this->fetchJoinCollection);
522529
$total = $paginator->count();
523530
$data = array();
524531

@@ -534,4 +541,4 @@ protected function getAllAbstractByPage
534541
$data
535542
);
536543
}
537-
}
544+
}

app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use App\Http\Utils\Filters\DoctrineNotInFilterMapping;
1717
use App\Repositories\SilverStripeDoctrineRepository;
1818
use Doctrine\DBAL\LockMode;
19+
use Doctrine\ORM\EntityManagerInterface;
20+
use Doctrine\ORM\Mapping\ClassMetadata;
1921
use Doctrine\ORM\QueryBuilder;
2022
use models\summit\IOrderConstants;
2123
use models\summit\ISummitAttendeeTicketRepository;
@@ -39,6 +41,12 @@ final class DoctrineSummitAttendeeTicketRepository
3941
extends SilverStripeDoctrineRepository
4042
implements ISummitAttendeeTicketRepository
4143
{
44+
public function __construct(EntityManagerInterface $em, ClassMetadata $class)
45+
{
46+
parent::__construct($em, $class);
47+
$this->fetchJoinCollection = false;
48+
}
49+
4250

4351
/** @var array<string, array{0:string,1:'join'|'leftJoin',2:array<int,string>}> */
4452
private array $joinCatalog = [

0 commit comments

Comments
 (0)