From 2f2a41f665ae309f40cdd8c4afa4a6bcca6f2abd Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sat, 6 Jan 2024 18:42:23 +0100 Subject: [PATCH] Fetch associations extra lazy --- src/Database/Record.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Database/Record.php b/src/Database/Record.php index 61fa726..093cca2 100644 --- a/src/Database/Record.php +++ b/src/Database/Record.php @@ -51,7 +51,7 @@ class Record * The associated format. */ #[ORM\Id] - #[ORM\ManyToOne(targetEntity: Format::class)] + #[ORM\ManyToOne(targetEntity: Format::class, fetch: 'EXTRA_LAZY')] #[ORM\JoinColumn(name: 'format', referencedColumnName: 'prefix')] private Format $format; @@ -72,7 +72,7 @@ class Record * * @var Collection */ - #[ORM\ManyToMany(targetEntity: Set::class, inversedBy: 'records', indexBy: 'spec', cascade: ['persist'])] + #[ORM\ManyToMany(targetEntity: Set::class, inversedBy: 'records', indexBy: 'spec', fetch: 'EXTRA_LAZY', cascade: ['persist'])] #[ORM\JoinTable(name: 'records_sets')] #[ORM\JoinColumn(name: 'record_identifier', referencedColumnName: 'identifier')] #[ORM\JoinColumn(name: 'record_format', referencedColumnName: 'format')]