1111use Doctrine \ORM \Mapping as ORM ;
1212use Nette \Utils \Random ;
1313
14- /**
15- * @ORM\Entity(repositoryClass="UserRepository")
16- * @ORM\Table(name="`user`")
17- * @ORM\HasLifecycleCallbacks
18- */
14+ #[ORM \Entity(repositoryClass: UserRepository::class)]
15+ #[ORM \Table(name: '`user` ' )]
16+ #[ORM \HasLifecycleCallbacks]
1917class User extends AbstractEntity
2018{
2119
@@ -32,34 +30,31 @@ class User extends AbstractEntity
3230
3331 public const STATES = [self ::STATE_FRESH , self ::STATE_BLOCKED , self ::STATE_ACTIVATED ];
3432
35- /** @ ORM\Column(type=" string" , length= 255, nullable=FALSE , unique= false) */
33+ #[ ORM \Column(type: ' string ' , length: 255 , nullable: false , unique: false )]
3634 private string $ name ;
3735
38- /** @ ORM\Column(type=" string" , length= 255, nullable=FALSE , unique= false) */
36+ #[ ORM \Column(type: ' string ' , length: 255 , nullable: false , unique: false )]
3937 private string $ surname ;
4038
41- /** @ ORM\Column(type=" string" , length= 255, nullable=FALSE , unique=TRUE) */
39+ #[ ORM \Column(type: ' string ' , length: 255 , nullable: false , unique: true )]
4240 private string $ email ;
4341
44- /** @ ORM\Column(type=" string" , length= 255, nullable=FALSE , unique=TRUE) */
42+ #[ ORM \Column(type: ' string ' , length: 255 , nullable: false , unique: true )]
4543 private string $ username ;
4644
47- /** @ ORM\Column(type=" integer" , length= 10, nullable=FALSE) */
45+ #[ ORM \Column(type: ' integer ' , length: 10 , nullable: false )]
4846 private int $ state ;
4947
50- /** @ ORM\Column(type=" string" , length= 255, nullable=FALSE) */
48+ #[ ORM \Column(type: ' string ' , length: 255 , nullable: false )]
5149 private string $ password ;
5250
53- /** @ ORM\Column(type=" string" , length= 255, nullable=FALSE) */
51+ #[ ORM \Column(type: ' string ' , length: 255 , nullable: false )]
5452 private string $ role ;
5553
56- /** @ ORM\Column(type=" string" , length= 255, nullable=FALSE) */
54+ #[ ORM \Column(type: ' string ' , length: 255 , nullable: false )]
5755 private string $ apikey ;
5856
59- /**
60- * @var DateTime|NULL
61- * @ORM\Column(type="datetime", nullable=TRUE)
62- */
57+ #[ORM \Column(type: 'datetime ' , nullable: true )]
6358 private ?DateTime $ lastLoggedAt = null ;
6459
6560 public function __construct (string $ name , string $ surname , string $ email , string $ username , string $ passwordHash )
0 commit comments