Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * Interface for representing a user account record.
5 *
6 * PHP version 8
7 *
8 * Copyright (C) Villanova University 2024.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2,
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 *
23 * @category VuFind
24 * @package  Db_Interface
25 * @author   Demian Katz <demian.katz@villanova.edu>
26 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
27 * @link     https://vufind.org Main Site
28 */
29
30namespace VuFind\Db\Entity;
31
32use DateTime;
33
34/**
35 * Interface for representing a user account record.
36 *
37 * @category VuFind
38 * @package  Db_Interface
39 * @author   Demian Katz <demian.katz@villanova.edu>
40 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
41 * @link     https://vufind.org Main Site
42 */
43interface UserEntityInterface extends EntityInterface
44{
45    /**
46     * Get identifier (returns null for an uninitialized or non-persisted object).
47     *
48     * @return ?int
49     */
50    public function getId(): ?int;
51
52    /**
53     * Username setter
54     *
55     * @param string $username Username
56     *
57     * @return UserEntityInterface
58     */
59    public function setUsername(string $username): UserEntityInterface;
60
61    /**
62     * Get username.
63     *
64     * @return string
65     */
66    public function getUsername(): string;
67
68    /**
69     * Set raw (unhashed) password (if available). This should only be used when hashing is disabled.
70     *
71     * @param string $password Password
72     *
73     * @return UserEntityInterface
74     */
75    public function setRawPassword(string $password): UserEntityInterface;
76
77    /**
78     * Get raw (unhashed) password (if available). This should only be used when hashing is disabled.
79     *
80     * @return string
81     */
82    public function getRawPassword(): string;
83
84    /**
85     * Set hashed password. This should only be used when hashing is enabled.
86     *
87     * @param ?string $hash Password hash
88     *
89     * @return UserEntityInterface
90     */
91    public function setPasswordHash(?string $hash): UserEntityInterface;
92
93    /**
94     * Get hashed password. This should only be used when hashing is enabled.
95     *
96     * @return ?string
97     */
98    public function getPasswordHash(): ?string;
99
100    /**
101     * Set firstname.
102     *
103     * @param string $firstName New first name
104     *
105     * @return UserEntityInterface
106     */
107    public function setFirstname(string $firstName): UserEntityInterface;
108
109    /**
110     * Get firstname.
111     *
112     * @return string
113     */
114    public function getFirstname(): string;
115
116    /**
117     * Set lastname.
118     *
119     * @param string $lastName New last name
120     *
121     * @return UserEntityInterface
122     */
123    public function setLastname(string $lastName): UserEntityInterface;
124
125    /**
126     * Get lastname.
127     *
128     * @return string
129     */
130    public function getLastname(): string;
131
132    /**
133     * Set email.
134     *
135     * @param string $email Email address
136     *
137     * @return UserEntityInterface
138     */
139    public function setEmail(string $email): UserEntityInterface;
140
141    /**
142     * Get email.
143     *
144     * @return string
145     */
146    public function getEmail(): string;
147
148    /**
149     * Set pending email.
150     *
151     * @param string $email New pending email
152     *
153     * @return UserEntityInterface
154     */
155    public function setPendingEmail(string $email): UserEntityInterface;
156
157    /**
158     * Get pending email.
159     *
160     * @return string
161     */
162    public function getPendingEmail(): string;
163
164    /**
165     * Catalog id setter
166     *
167     * @param ?string $catId Catalog id
168     *
169     * @return UserEntityInterface
170     */
171    public function setCatId(?string $catId): UserEntityInterface;
172
173    /**
174     * Get catalog id.
175     *
176     * @return ?string
177     */
178    public function getCatId(): ?string;
179
180    /**
181     * Catalog username setter
182     *
183     * @param ?string $catUsername Catalog username
184     *
185     * @return UserEntityInterface
186     */
187    public function setCatUsername(?string $catUsername): UserEntityInterface;
188
189    /**
190     * Get catalog username.
191     *
192     * @return ?string
193     */
194    public function getCatUsername(): ?string;
195
196    /**
197     * Home library setter
198     *
199     * @param ?string $homeLibrary Home library
200     *
201     * @return UserEntityInterface
202     */
203    public function setHomeLibrary(?string $homeLibrary): UserEntityInterface;
204
205    /**
206     * Get home library.
207     *
208     * @return ?string
209     */
210    public function getHomeLibrary(): ?string;
211
212    /**
213     * Raw catalog password setter
214     *
215     * @param ?string $catPassword Cat password
216     *
217     * @return UserEntityInterface
218     */
219    public function setRawCatPassword(?string $catPassword): UserEntityInterface;
220
221    /**
222     * Get raw catalog password.
223     *
224     * @return ?string
225     */
226    public function getRawCatPassword(): ?string;
227
228    /**
229     * Encrypted catalog password setter
230     *
231     * @param ?string $passEnc Encrypted password
232     *
233     * @return UserEntityInterface
234     */
235    public function setCatPassEnc(?string $passEnc): UserEntityInterface;
236
237    /**
238     * Get encrypted catalog password.
239     *
240     * @return ?string
241     */
242    public function getCatPassEnc(): ?string;
243
244    /**
245     * Set college.
246     *
247     * @param string $college College
248     *
249     * @return UserEntityInterface
250     */
251    public function setCollege(string $college): UserEntityInterface;
252
253    /**
254     * Get college.
255     *
256     * @return string
257     */
258    public function getCollege(): string;
259
260    /**
261     * Set major.
262     *
263     * @param string $major Major
264     *
265     * @return UserEntityInterface
266     */
267    public function setMajor(string $major): UserEntityInterface;
268
269    /**
270     * Get major.
271     *
272     * @return string
273     */
274    public function getMajor(): string;
275
276    /**
277     * Set verification hash for recovery.
278     *
279     * @param string $hash Hash value to save
280     *
281     * @return UserEntityInterface
282     */
283    public function setVerifyHash(string $hash): UserEntityInterface;
284
285    /**
286     * Get verification hash for recovery.
287     *
288     * @return string
289     */
290    public function getVerifyHash(): string;
291
292    /**
293     * Set active authentication method (if any).
294     *
295     * @param ?string $authMethod New value (null for none)
296     *
297     * @return UserEntityInterface
298     */
299    public function setAuthMethod(?string $authMethod): UserEntityInterface;
300
301    /**
302     * Get active authentication method (if any).
303     *
304     * @return ?string
305     */
306    public function getAuthMethod(): ?string;
307
308    /**
309     * Set last language.
310     *
311     * @param string $lang Last language
312     *
313     * @return UserEntityInterface
314     */
315    public function setLastLanguage(string $lang): UserEntityInterface;
316
317    /**
318     * Get last language.
319     *
320     * @return string
321     */
322    public function getLastLanguage(): string;
323
324    /**
325     * Does the user have a user-provided (true) vs. automatically looked up (false) email address?
326     *
327     * @return bool
328     */
329    public function hasUserProvidedEmail(): bool;
330
331    /**
332     * Set the flag indicating whether the email address is user-provided.
333     *
334     * @param bool $userProvided New value
335     *
336     * @return UserEntityInterface
337     */
338    public function setHasUserProvidedEmail(bool $userProvided): UserEntityInterface;
339
340    /**
341     * Last login setter.
342     *
343     * @param DateTime $dateTime Last login date
344     *
345     * @return UserEntityInterface
346     */
347    public function setLastLogin(DateTime $dateTime): UserEntityInterface;
348
349    /**
350     * Last login getter
351     *
352     * @return DateTime
353     */
354    public function getLastLogin(): DateTime;
355
356    /**
357     * Created setter
358     *
359     * @param DateTime $dateTime Last login date
360     *
361     * @return UserEntityInterface
362     */
363    public function setCreated(DateTime $dateTime): UserEntityInterface;
364
365    /**
366     * Created getter
367     *
368     * @return DateTime
369     */
370    public function getCreated(): Datetime;
371
372    /**
373     * Set email verification date (or null for unverified).
374     *
375     * @param ?DateTime $dateTime Verification date (or null)
376     *
377     * @return UserEntityInterface
378     */
379    public function setEmailVerified(?DateTime $dateTime): UserEntityInterface;
380
381    /**
382     * Get email verification date (or null for unverified).
383     *
384     * @return ?DateTime
385     */
386    public function getEmailVerified(): ?DateTime;
387}