mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 14:04:30 +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
|
@ -63,6 +63,10 @@ class AttachmentType extends AbstractStructuralDBElement
|
|||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $attachments;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: AttachmentTypeAttachment::class)]
|
||||
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
|
||||
protected ?Attachment $master_picture_attachment = null;
|
||||
|
||||
/** @var Collection<int, AttachmentTypeParameter>
|
||||
*/
|
||||
#[Assert\Valid]
|
||||
|
@ -70,9 +74,6 @@ class AttachmentType extends AbstractStructuralDBElement
|
|||
#[ORM\OrderBy(['group' => 'ASC', 'name' => 'ASC'])]
|
||||
protected Collection $parameters;
|
||||
|
||||
/**
|
||||
* @var Collection<Attachment>
|
||||
*/
|
||||
/**
|
||||
* @var Collection<Attachment>
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue