1 | <?php |
||
20 | class User implements UserInterface { |
||
21 | |||
22 | /** |
||
23 | * Holds the actual user data. |
||
24 | */ |
||
25 | private $userData; |
||
26 | |||
27 | /** |
||
28 | * The CRUDEntity fieldname of the username. |
||
29 | */ |
||
30 | protected $usernameField; |
||
31 | |||
32 | /** |
||
33 | * The fieldname of the password (hash). |
||
34 | */ |
||
35 | protected $passwordField; |
||
36 | |||
37 | /** |
||
38 | * The fieldname of the password hash salt. |
||
39 | */ |
||
40 | protected $saltField; |
||
41 | |||
42 | /** |
||
43 | * Hold password hash salt. |
||
44 | */ |
||
45 | private $roles; |
||
46 | |||
47 | /** |
||
48 | * Constructor. |
||
49 | * |
||
50 | * @param string $usernameField |
||
51 | * the username |
||
52 | * |
||
53 | * @param string $passwordField |
||
54 | * the password (hash) |
||
55 | * |
||
56 | * @param string $saltField |
||
57 | * the password hash salt |
||
58 | * |
||
59 | * @param Entity $userEntity |
||
60 | * the actual user data |
||
61 | * |
||
62 | * @param array $roles |
||
63 | * the roles |
||
64 | */ |
||
65 | public function __construct($usernameField, $passwordField, $saltField, Entity $userEntity, array $roles) { |
||
76 | |||
77 | /** |
||
78 | * Gets the roles. |
||
79 | * |
||
80 | * @return array |
||
81 | * the roles |
||
82 | */ |
||
83 | public function getRoles() { |
||
86 | |||
87 | /** |
||
88 | * Gets the password (hash). |
||
89 | * |
||
90 | * @return string |
||
91 | * the password |
||
92 | */ |
||
93 | public function getPassword() { |
||
96 | |||
97 | /** |
||
98 | * Gets the password hash salt. |
||
99 | * |
||
100 | * @return string |
||
101 | * the salt |
||
102 | */ |
||
103 | public function getSalt() { |
||
106 | |||
107 | /** |
||
108 | * Gets the username. |
||
109 | * |
||
110 | * @return string |
||
111 | * the username |
||
112 | */ |
||
113 | public function getUsername() { |
||
116 | |||
117 | /** |
||
118 | * Should erase some crucial data if needed. But nothing to do here in this |
||
119 | * implementation. |
||
120 | */ |
||
121 | public function eraseCredentials() { |
||
123 | |||
124 | /** |
||
125 | * Gets the user data. |
||
126 | * |
||
127 | * @return array |
||
128 | * the user data |
||
129 | */ |
||
130 | public function getUserData() { |
||
133 | |||
134 | } |
||
135 |