1 | <?php |
||
22 | class User implements UserInterface |
||
23 | { |
||
24 | /** |
||
25 | * @ORM\Id() |
||
26 | * @ORM\GeneratedValue() |
||
27 | * @ORM\Column(type="integer") |
||
28 | * @Expose |
||
29 | */ |
||
30 | private $id; |
||
31 | |||
32 | /** |
||
33 | * @var $profile UserProfile |
||
34 | * @ORM\OneToOne(targetEntity="App\Users\Entity\UserProfile", cascade={"persist", "remove"}) |
||
35 | * @Expose |
||
36 | */ |
||
37 | private $profile; |
||
38 | |||
39 | /** |
||
40 | * @ORM\Column(type="string", length=255, unique=true) |
||
41 | */ |
||
42 | private $email; |
||
43 | |||
44 | /** |
||
45 | * @ORM\Column(type="integer", length=1, options={"default": 0}) |
||
46 | */ |
||
47 | private $isEmailConfirmed = 0; |
||
48 | |||
49 | /** |
||
50 | * @ORM\Column(type="string", length=255, unique=true) |
||
51 | * @Expose |
||
52 | */ |
||
53 | private $username; |
||
54 | |||
55 | /** |
||
56 | * @ORM\Embedded(class="App\Users\Entity\UserRoles", columnPrefix=false) |
||
57 | */ |
||
58 | private $roles; |
||
59 | |||
60 | /** |
||
61 | * @var string |
||
62 | */ |
||
63 | private $plainPassword; |
||
64 | |||
65 | /** |
||
66 | * @ORM\Column(type="string", length=64) |
||
67 | */ |
||
68 | private $password; |
||
69 | |||
70 | 30 | public function __construct(string $email, string $username, string $password) |
|
79 | |||
80 | 9 | public function getProfile(): UserProfile |
|
84 | |||
85 | 4 | public function getId(): ?int |
|
89 | |||
90 | 4 | public function getEmail(): string |
|
94 | |||
95 | 30 | public function setPlainPassword(string $plainPassword): self |
|
105 | |||
106 | 6 | public function getPlainPassword(): string |
|
110 | |||
111 | 8 | public function setPassword($password, UserPasswordEncoderInterface $passwordEncoder): self |
|
118 | |||
119 | 6 | public function isPasswordValid($password, UserPasswordEncoderInterface $passwordEncoder): bool |
|
123 | |||
124 | 4 | public function getPassword(): ?string |
|
128 | |||
129 | 9 | public function getSalt(): ?string |
|
133 | |||
134 | 4 | public function getUsername(): ?string |
|
138 | |||
139 | 9 | public function eraseCredentials(): self |
|
145 | |||
146 | 1 | public function confirmEmail(): self |
|
152 | |||
153 | public function changeEmail($email): self |
||
160 | |||
161 | /** |
||
162 | * @return array |
||
163 | */ |
||
164 | 7 | public function getRoles() |
|
168 | |||
169 | 10 | public function getRolesObject(): UserRoles |
|
173 | } |