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