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