1111use Exception ;
1212use Frontend \App \Common \AbstractEntity ;
1313use Frontend \App \Common \UuidOrderedTimeGenerator ;
14+ use Frontend \User \Repository \UserRepository ;
1415
1516use function bin2hex ;
1617use function random_bytes ;
1718
18- /**
19- * @ORM\Entity(repositoryClass="Frontend\User\Repository\UserRepository")
20- * @ORM\Table(name="user")
21- * @ORM\HasLifecycleCallbacks()
22- */
19+ #[ORM \Entity(repositoryClass: UserRepository::class)]
20+ #[ORM \Table(name: 'user ' )]
21+ #[ORM \HasLifecycleCallbacks]
2322class User extends AbstractEntity implements UserInterface
2423{
2524 public const STATUS_PENDING = 'pending ' ;
@@ -37,41 +36,39 @@ class User extends AbstractEntity implements UserInterface
3736 self ::IS_DELETED_NO ,
3837 ];
3938
40- /** @ ORM\OneToOne(targetEntity="Frontend\User\Entity\ UserDetail" , cascade={" persist", " remove"}, mappedBy="user") */
39+ #[ ORM \OneToOne(mappedBy: ' user ' , targetEntity: UserDetail::class , cascade: [ ' persist ' , ' remove ' ])]
4140 protected UserDetail $ detail ;
4241
43- /** @ ORM\OneToOne(targetEntity="Frontend\User\Entity\ UserAvatar" , cascade={" persist", " remove"}, mappedBy="user") */
42+ #[ ORM \OneToOne(mappedBy: ' user ' , targetEntity: UserAvatar::class , cascade: [ ' persist ' , ' remove ' ])]
4443 protected ?UserAvatar $ avatar ;
4544
46- /** @ ORM\Column(name=" identity" , type=" string" , length= 191, nullable=false, unique= true) */
45+ #[ ORM \Column(name: ' identity ' , type: ' string ' , length: 191 , unique: true , nullable: false )]
4746 protected string $ identity ;
4847
49- /** @ ORM\Column(name=" password" , type=" string" , length= 191, nullable= false) */
48+ #[ ORM \Column(name: ' password ' , type: ' string ' , length: 191 , nullable: false )]
5049 protected string $ password ;
5150
52- /** @ ORM\Column(name=" status" , type=" string" , length= 20, columnDefinition= "ENUM('pending', 'active')") */
51+ #[ ORM \Column(name: ' status ' , type: ' string ' , length: 20 , columnDefinition: "ENUM('pending', 'active') " )]
5352 protected string $ status = self ::STATUS_PENDING ;
5453
55- /** @ ORM\Column(name=" isDeleted" , type=" boolean") */
54+ #[ ORM \Column(name: ' isDeleted ' , type: ' boolean ' )]
5655 protected bool $ isDeleted = self ::IS_DELETED_NO ;
5756
58- /** @ ORM\Column(name=" hash" , type=" string" , length= 64, nullable=false, unique= true) */
57+ #[ ORM \Column(name: ' hash ' , type: ' string ' , length: 64 , unique: true , nullable: false )]
5958 protected string $ hash ;
6059
61- /**
62- * @ORM\ManyToMany(targetEntity="Frontend\User\Entity\UserRole")
63- * @ORM\JoinTable(
64- * name="user_roles",
65- * joinColumns={@ORM\JoinColumn(name="userUuid", referencedColumnName="uuid")},
66- * inverseJoinColumns={@ORM\JoinColumn(name="roleUuid", referencedColumnName="uuid")}
67- * )
68- */
60+ #[ORM \ManyToMany(targetEntity: UserRole::class)]
61+ #[ORM \JoinTable(name: 'user_roles ' )]
62+ #[ORM \JoinColumn(name: 'userUuid ' , referencedColumnName: 'uuid ' )]
63+ #[ORM \InverseJoinColumn(name: 'roleUuid ' , referencedColumnName: 'uuid ' )]
6964 protected Collection $ roles ;
7065
71- /**
72- * @ORM\OneToMany(targetEntity="UserResetPassword",
73- * cascade={"persist", "remove"}, mappedBy="user", fetch="EXTRA_LAZY")
74- */
66+ #[ORM \OneToMany(
67+ mappedBy: 'user ' ,
68+ targetEntity: UserResetPassword::class,
69+ cascade: ['persist ' , 'remove ' ],
70+ fetch: 'EXTRA_LAZY '
71+ )]
7572 protected Collection $ resetPasswords ;
7673
7774 /**
0 commit comments