mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Do a extra lazy fetch on webauthn and u2f keys property of a user
In the most cases we just need the count of them and not the exact details. This just gives as a bit better performance on most requests
This commit is contained in:
parent
3a8c835880
commit
87cf4c2d08
1 changed files with 3 additions and 3 deletions
|
@ -222,7 +222,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
/**
|
||||
* @var Collection<int, UserAttachment>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: UserAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'element', targetEntity: UserAttachment::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $attachments;
|
||||
|
||||
|
@ -234,13 +234,13 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
|
||||
/** @var Collection<int, LegacyU2FKeyInterface>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: U2FKey::class, mappedBy: 'user', cascade: ['REMOVE'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'user', targetEntity: U2FKey::class, cascade: ['REMOVE'], fetch: 'EXTRA_LAZY', orphanRemoval: true)]
|
||||
protected Collection $u2fKeys;
|
||||
|
||||
/**
|
||||
* @var Collection<int, WebauthnKey>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: WebauthnKey::class, mappedBy: 'user', cascade: ['REMOVE'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'user', targetEntity: WebauthnKey::class, cascade: ['REMOVE'], fetch: 'EXTRA_LAZY', orphanRemoval: true)]
|
||||
protected Collection $webauthn_keys;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue