. */ declare(strict_types=1); namespace App\Entity\Attachments; use App\Entity\Parts\Footprint; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; /** * An attachment attached to a footprint element. */ #[UniqueEntity(['name', 'attachment_type', 'element'])] #[ORM\Entity] class FootprintAttachment extends Attachment { final public const ALLOWED_ELEMENT_CLASS = Footprint::class; /** * @var Footprint|null the element this attachment is associated with */ #[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Footprint::class, inversedBy: 'attachments')] #[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')] protected ?AttachmentContainingDBElement $element = null; }