mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Allow to create Attachments for all entity types using the API
This fixes issue #502
This commit is contained in:
parent
16b3d58242
commit
ce768764cc
14 changed files with 47 additions and 9 deletions
|
@ -42,8 +42,10 @@ declare(strict_types=1);
|
|||
namespace App\Entity\Attachments;
|
||||
|
||||
use App\Entity\LabelSystem\LabelProfile;
|
||||
use App\Serializer\OverrideClassDenormalizer;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Serializer\Attribute\Context;
|
||||
|
||||
/**
|
||||
* A attachment attached to a user element.
|
||||
|
@ -60,5 +62,6 @@ class LabelAttachment extends Attachment
|
|||
*/
|
||||
#[ORM\ManyToOne(targetEntity: LabelProfile::class, inversedBy: 'attachments')]
|
||||
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
|
||||
#[Context(denormalizationContext: [OverrideClassDenormalizer::CONTEXT_KEY => self::ALLOWED_ELEMENT_CLASS])]
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue