mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
Do the doctrine definitions of the master preview attachment in the sub classes
This makes lazy fetching works and saves some db queries.
This commit is contained in:
parent
2c6de84c9a
commit
2ddfe48aba
14 changed files with 73 additions and 6 deletions
|
@ -22,6 +22,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Entity\UserSystem;
|
||||
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use App\Entity\Attachments\AttachmentTypeAttachment;
|
||||
use App\Repository\UserRepository;
|
||||
use App\EntityListeners\TreeCacheInvalidationListener;
|
||||
use App\Validator\Constraints\NoLockout;
|
||||
|
@ -226,6 +228,10 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $attachments;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: UserAttachment::class)]
|
||||
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
|
||||
protected ?Attachment $master_picture_attachment = null;
|
||||
|
||||
/** @var \DateTimeInterface|null The time when the backup codes were generated
|
||||
*/
|
||||
#[Groups(['full'])]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue