1 | <?php |
||
15 | class ConfirmationToken |
||
16 | { |
||
17 | const TYPE_CONFIRM_EMAIl = 'confirm_email'; |
||
18 | |||
19 | /** |
||
20 | * @ORM\Id() |
||
21 | * @ORM\GeneratedValue() |
||
22 | * @ORM\Column(type="integer") |
||
23 | */ |
||
24 | private $id; |
||
25 | |||
26 | /** |
||
27 | * @var $user User |
||
28 | * @ORM\ManyToOne(targetEntity="App\Users\Entity\User") |
||
29 | */ |
||
30 | private $user; |
||
31 | |||
32 | /** |
||
33 | * @ORM\Column(type="string", length=32, unique=true) |
||
34 | */ |
||
35 | private $token; |
||
36 | |||
37 | /** |
||
38 | * @ORM\Column(type="string", length=256) |
||
39 | */ |
||
40 | private $type; |
||
41 | |||
42 | /** |
||
43 | * @ORM\Column(type="datetime", nullable=true) |
||
44 | */ |
||
45 | private $expires_at; |
||
46 | |||
47 | public function __construct(User $user, $type) |
||
57 | 5 | ||
58 | 5 | public function getValidTypes(): array |
|
62 | |||
63 | /** |
||
64 | 5 | * @param \DateTimeInterface $expires_at |
|
65 | * @return ConfirmationToken |
||
66 | 5 | */ |
|
67 | 5 | public function setExpiresAt(\DateTimeInterface $expires_at) |
|
72 | |||
73 | /** |
||
74 | * @return mixed |
||
75 | */ |
||
76 | public function getId() |
||
80 | |||
81 | 1 | /** |
|
82 | * @return User |
||
83 | 1 | */ |
|
84 | public function getUser(): User |
||
88 | |||
89 | 5 | /** |
|
90 | * @return mixed |
||
91 | 5 | */ |
|
92 | public function getToken() |
||
96 | |||
97 | /** |
||
98 | * @return mixed |
||
99 | */ |
||
100 | public function getType() |
||
104 | |||
105 | /** |
||
106 | * @return mixed |
||
107 | */ |
||
108 | public function getExpiresAt() |
||
112 | } |