diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index 5b7ca60f..dc8de0a0 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -63,7 +63,7 @@ class AttachmentType extends AbstractStructuralDBElement #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: AttachmentTypeAttachment::class)] + #[ORM\ManyToOne(targetEntity: AttachmentTypeAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/LabelSystem/LabelProfile.php b/src/Entity/LabelSystem/LabelProfile.php index c729b661..a504ee0f 100644 --- a/src/Entity/LabelSystem/LabelProfile.php +++ b/src/Entity/LabelSystem/LabelProfile.php @@ -70,7 +70,7 @@ class LabelProfile extends AttachmentContainingDBElement #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: AttachmentTypeAttachment::class)] + #[ORM\ManyToOne(targetEntity: AttachmentTypeAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/Parts/Category.php b/src/Entity/Parts/Category.php index 23dd345c..ac810cf8 100644 --- a/src/Entity/Parts/Category.php +++ b/src/Entity/Parts/Category.php @@ -120,7 +120,7 @@ class Category extends AbstractPartsContainingDBElement #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: CategoryAttachment::class)] + #[ORM\ManyToOne(targetEntity: CategoryAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/Parts/Footprint.php b/src/Entity/Parts/Footprint.php index ccd5bd9f..4126a63b 100644 --- a/src/Entity/Parts/Footprint.php +++ b/src/Entity/Parts/Footprint.php @@ -61,7 +61,7 @@ class Footprint extends AbstractPartsContainingDBElement #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: FootprintAttachment::class)] + #[ORM\ManyToOne(targetEntity: FootprintAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/Parts/Manufacturer.php b/src/Entity/Parts/Manufacturer.php index 373ee950..418b4084 100644 --- a/src/Entity/Parts/Manufacturer.php +++ b/src/Entity/Parts/Manufacturer.php @@ -61,7 +61,7 @@ class Manufacturer extends AbstractCompany #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: ManufacturerAttachment::class)] + #[ORM\ManyToOne(targetEntity: ManufacturerAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php index ebb7b0d0..538d4c57 100644 --- a/src/Entity/Parts/MeasurementUnit.php +++ b/src/Entity/Parts/MeasurementUnit.php @@ -92,7 +92,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: MeasurementUnitAttachment::class)] + #[ORM\ManyToOne(targetEntity: MeasurementUnitAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/Parts/Storelocation.php b/src/Entity/Parts/Storelocation.php index a519f6c1..f58f807d 100644 --- a/src/Entity/Parts/Storelocation.php +++ b/src/Entity/Parts/Storelocation.php @@ -110,7 +110,7 @@ class Storelocation extends AbstractPartsContainingDBElement #[ORM\OneToMany(targetEntity: StorelocationAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: StorelocationAttachment::class)] + #[ORM\ManyToOne(targetEntity: StorelocationAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/Parts/Supplier.php b/src/Entity/Parts/Supplier.php index b50bcd45..4dca8f36 100644 --- a/src/Entity/Parts/Supplier.php +++ b/src/Entity/Parts/Supplier.php @@ -93,7 +93,7 @@ class Supplier extends AbstractCompany #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: SupplierAttachment::class)] + #[ORM\ManyToOne(targetEntity: SupplierAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index 6ad526a7..1aec8d8a 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -86,7 +86,7 @@ class Currency extends AbstractStructuralDBElement #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: CurrencyAttachment::class)] + #[ORM\ManyToOne(targetEntity: CurrencyAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/ProjectSystem/Project.php b/src/Entity/ProjectSystem/Project.php index fd6ac8ba..4d79ee38 100644 --- a/src/Entity/ProjectSystem/Project.php +++ b/src/Entity/ProjectSystem/Project.php @@ -95,7 +95,7 @@ class Project extends AbstractStructuralDBElement #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: ProjectAttachment::class)] + #[ORM\ManyToOne(targetEntity: ProjectAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/UserSystem/Group.php b/src/Entity/UserSystem/Group.php index 31c9c26a..01e79498 100644 --- a/src/Entity/UserSystem/Group.php +++ b/src/Entity/UserSystem/Group.php @@ -78,7 +78,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: GroupAttachment::class)] + #[ORM\ManyToOne(targetEntity: GroupAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null; diff --git a/src/Entity/UserSystem/User.php b/src/Entity/UserSystem/User.php index 70121bf4..54d57d7c 100644 --- a/src/Entity/UserSystem/User.php +++ b/src/Entity/UserSystem/User.php @@ -228,7 +228,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe #[ORM\OrderBy(['name' => 'ASC'])] protected Collection $attachments; - #[ORM\OneToOne(targetEntity: UserAttachment::class)] + #[ORM\ManyToOne(targetEntity: UserAttachment::class)] #[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')] protected ?Attachment $master_picture_attachment = null;