1 | <?php |
||
20 | class User extends AbstractEntity implements JWTUserInterface, UserInterface |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * @var UserRole |
||
25 | * |
||
26 | * @ORM\OneToOne(targetEntity="UserRole", cascade={"persist"}) |
||
27 | * @ORM\JoinColumn(name="roles", referencedColumnName="id", nullable=true) |
||
28 | */ |
||
29 | protected $roles; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | * |
||
34 | * @ORM\Column(name="salt", type="string", length=255, nullable=true) |
||
35 | */ |
||
36 | protected $salt; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | * |
||
41 | * @ORM\Column(name="password", type="string", length=255) |
||
42 | */ |
||
43 | protected $password; |
||
44 | protected $plainPassword; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | * |
||
49 | * @ORM\Column(name="email", type="string", length=255, nullable=false, unique=true) |
||
50 | */ |
||
51 | protected $email; |
||
52 | |||
53 | /** |
||
54 | * User constructor. |
||
55 | * @param array $roles |
||
56 | * @param string $email |
||
57 | */ |
||
58 | public function __construct($email, $roles) |
||
65 | |||
66 | public static function createFromPayload($username, array $payload) |
||
73 | |||
74 | public function getRoles() |
||
83 | |||
84 | /** |
||
85 | * @param array $roles |
||
86 | * |
||
87 | * @return bool |
||
88 | */ |
||
89 | public function setRoles($roles) |
||
100 | |||
101 | public function getPassword() |
||
105 | |||
106 | /** |
||
107 | * @param string $password |
||
108 | */ |
||
109 | public function setPassword($password) |
||
113 | |||
114 | public function getSalt() |
||
118 | |||
119 | public function getUsername() |
||
123 | |||
124 | public function eraseCredentials() |
||
127 | |||
128 | |||
129 | /** |
||
130 | * @param string $email |
||
131 | */ |
||
132 | public function setEmail($email) |
||
136 | |||
137 | /** |
||
138 | * @return mixed |
||
139 | */ |
||
140 | public function getPlainPassword() |
||
144 | |||
145 | /** |
||
146 | * @param mixed $plainPassword |
||
147 | */ |
||
148 | public function setPlainPassword($plainPassword) |
||
152 | |||
153 | |||
154 | } |
||
|
|||
155 |
This check marks files that end in a newline character, i.e. an empy line.