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