mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-24 04:44:35 +02:00
Started to move doctrine annotations to attributes (rector automated)
This commit is contained in:
parent
bb1285c35c
commit
0bc4699cdc
73 changed files with 483 additions and 604 deletions
|
@ -28,18 +28,17 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* An attachment attached to a user element.
|
||||
*
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
#[UniqueEntity(['name', 'attachment_type', 'element'])]
|
||||
#[ORM\Entity]
|
||||
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").
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: 'App\Entity\UserSystem\User', inversedBy: 'attachments')]
|
||||
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue