1 | <?php |
||
7 | class LegacyUser implements UserInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var integer |
||
11 | */ |
||
12 | protected $id; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $userName; |
||
18 | |||
19 | /** |
||
20 | * LegacyUser constructor. |
||
21 | * |
||
22 | * @param int $id |
||
23 | * @param string $userName |
||
24 | */ |
||
25 | public function __construct($id, $userName) |
||
30 | |||
31 | /** |
||
32 | * Returns the roles granted to the user. |
||
33 | * |
||
34 | * <code> |
||
35 | * public function getRoles() |
||
36 | * { |
||
37 | * return array('ROLE_USER'); |
||
38 | * } |
||
39 | * </code> |
||
40 | * |
||
41 | * Alternatively, the roles might be stored on a ``roles`` property, |
||
42 | * and populated in any number of different ways when the user object |
||
43 | * is created. |
||
44 | * |
||
45 | * @return array The user roles |
||
46 | */ |
||
47 | public function getRoles() |
||
55 | |||
56 | /** |
||
57 | * Returns the password used to authenticate the user. |
||
58 | * |
||
59 | * This should be the encoded password. On authentication, a plain-text |
||
60 | * password will be salted, encoded, and then compared to this value. |
||
61 | * |
||
62 | * @return string The password |
||
63 | */ |
||
64 | public function getPassword() |
||
69 | |||
70 | /** |
||
71 | * Returns the salt that was originally used to encode the password. |
||
72 | * |
||
73 | * This can return null if the password was not encoded using a salt. |
||
74 | * |
||
75 | * @return string|null The salt |
||
76 | */ |
||
77 | public function getSalt() |
||
82 | |||
83 | /** |
||
84 | * @return int |
||
85 | */ |
||
86 | public function getId() |
||
90 | |||
91 | /** |
||
92 | * Returns the username used to authenticate the user. |
||
93 | * |
||
94 | * @return string The username |
||
95 | */ |
||
96 | public function getUsername() |
||
101 | |||
102 | /** |
||
103 | * Removes sensitive data from the user. |
||
104 | * |
||
105 | * This is important if, at any given point, sensitive information like |
||
106 | * the plain-text password is stored on this object. |
||
107 | * @return void |
||
108 | */ |
||
109 | public function eraseCredentials() |
||
113 | |||
114 | /** |
||
115 | * @param string $userName |
||
116 | * |
||
117 | * @return \AppBundle\Legacy\User\LegacyUser |
||
118 | */ |
||
119 | public function setUserName($userName) |
||
125 | |||
126 | /** |
||
127 | * @param int $id |
||
128 | * |
||
129 | * @return \AppBundle\Legacy\User\LegacyUser |
||
130 | */ |
||
131 | public function setId($id) |
||
137 | } |
||
138 |