mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-04 14:35:49 +01: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:
@@ -22,6 +22,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Entity\UserSystem;
|
||||
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use App\Entity\Attachments\AttachmentTypeAttachment;
|
||||
use App\Validator\Constraints\NoLockout;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use App\Entity\Attachments\GroupAttachment;
|
||||
@@ -76,6 +78,10 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $attachments;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: GroupAttachment::class)]
|
||||
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
|
||||
protected ?Attachment $master_picture_attachment = null;
|
||||
|
||||
#[Groups(['full'])]
|
||||
#[ORM\Embedded(class: PermissionData::class, columnPrefix: 'permissions_')]
|
||||
#[ValidPermission()]
|
||||
|
||||
Reference in New Issue
Block a user