1 | <?php |
||
20 | class UserSession extends Base |
||
21 | { |
||
22 | /** |
||
23 | * Refresh current session if necessary. |
||
24 | * |
||
25 | * @param int $user_id |
||
26 | */ |
||
27 | public function refresh($user_id) |
||
33 | |||
34 | /** |
||
35 | * Update user session. |
||
36 | * |
||
37 | * @param array $user |
||
38 | */ |
||
39 | public function initialize(array $user) |
||
54 | |||
55 | /** |
||
56 | * Get user properties. |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | public function getAll() |
||
64 | |||
65 | /** |
||
66 | * Get user application role. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getRole() |
||
74 | |||
75 | /** |
||
76 | * Return true if the user has validated the 2FA key. |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function isPostAuthenticationValidated() |
||
84 | |||
85 | /** |
||
86 | * Validate 2FA for the current session. |
||
87 | */ |
||
88 | public function validatePostAuthentication() |
||
92 | |||
93 | /** |
||
94 | * Return true if the user has 2FA enabled. |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function hasPostAuthentication() |
||
102 | |||
103 | /** |
||
104 | * Disable 2FA for the current session. |
||
105 | */ |
||
106 | public function disablePostAuthentication() |
||
110 | |||
111 | /** |
||
112 | * Return true if the logged user is admin. |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | public function isAdmin() |
||
120 | |||
121 | /** |
||
122 | * Get the connected user id. |
||
123 | * |
||
124 | * @return int |
||
125 | */ |
||
126 | public function getId() |
||
130 | |||
131 | /** |
||
132 | * Get username. |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | public function getUsername() |
||
140 | |||
141 | /** |
||
142 | * Check is the user is connected. |
||
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | public function isLogged() |
||
150 | |||
151 | /** |
||
152 | * Get project filters from the session. |
||
153 | * |
||
154 | * @param int $project_id |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | public function getFilters($project_id) |
||
162 | |||
163 | /** |
||
164 | * Save project filters in the session. |
||
165 | * |
||
166 | * @param int $project_id |
||
167 | * @param string $filters |
||
168 | */ |
||
169 | public function setFilters($project_id, $filters) |
||
173 | |||
174 | /** |
||
175 | * Get recent projects from the session. |
||
176 | * |
||
177 | * @return array |
||
178 | */ |
||
179 | public function getRecentProjects() |
||
183 | |||
184 | /** |
||
185 | * Save recent project in the session. |
||
186 | * |
||
187 | * @param int $project_id |
||
188 | * @param string $filters |
||
189 | */ |
||
190 | public function setRecentProject($project_id) |
||
200 | } |
||
201 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.