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 * Entity model interface for login_token table
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  Database
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/wiki/development:plugins:database_gateways Wiki
28 */
29
30namespace VuFind\Db\Entity;
31
32use DateTime;
33
34/**
35 * Entity model interface for login_token table
36 *
37 * @category VuFind
38 * @package  Database
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/wiki/development:plugins:database_gateways Wiki
42 */
43interface LoginTokenEntityInterface extends EntityInterface
44{
45    /**
46     * Getter for ID.
47     *
48     * @return int
49     */
50    public function getId(): int;
51
52    /**
53     * Setter for User.
54     *
55     * @param UserEntityInterface $user User to set
56     *
57     * @return LoginTokenEntityInterface
58     */
59    public function setUser(UserEntityInterface $user): LoginTokenEntityInterface;
60
61    /**
62     * User getter (only null if entity has not been populated yet).
63     *
64     * @return ?UserEntityInterface
65     */
66    public function getUser(): ?UserEntityInterface;
67
68    /**
69     * Set token string.
70     *
71     * @param string $token Token
72     *
73     * @return LoginTokenEntityInterface
74     */
75    public function setToken(string $token): LoginTokenEntityInterface;
76
77    /**
78     * Get token string.
79     *
80     * @return string
81     */
82    public function getToken(): string;
83
84    /**
85     * Set series string.
86     *
87     * @param string $series Series
88     *
89     * @return LoginTokenEntityInterface
90     */
91    public function setSeries(string $series): LoginTokenEntityInterface;
92
93    /**
94     * Get series string.
95     *
96     * @return string
97     */
98    public function getSeries(): string;
99
100    /**
101     * Set last login date/time.
102     *
103     * @param DateTime $dateTime Last login date/time
104     *
105     * @return LoginTokenEntityInterface
106     */
107    public function setLastLogin(DateTime $dateTime): LoginTokenEntityInterface;
108
109    /**
110     * Get last login date/time.
111     *
112     * @return DateTime
113     */
114    public function getLastLogin(): DateTime;
115
116    /**
117     * Set browser details (or null for none).
118     *
119     * @param ?string $browser Browser details (or null for none)
120     *
121     * @return LoginTokenEntityInterface
122     */
123    public function setBrowser(?string $browser): LoginTokenEntityInterface;
124
125    /**
126     * Get browser details (or null for none).
127     *
128     * @return ?string
129     */
130    public function getBrowser(): ?string;
131
132    /**
133     * Set platform details (or null for none).
134     *
135     * @param ?string $platform Platform details (or null for none)
136     *
137     * @return LoginTokenEntityInterface
138     */
139    public function setPlatform(?string $platform): LoginTokenEntityInterface;
140
141    /**
142     * Get platform details (or null for none).
143     *
144     * @return ?string
145     */
146    public function getPlatform(): ?string;
147
148    /**
149     * Set expiration timestamp.
150     *
151     * @param int $expires Expiration timestamp
152     *
153     * @return LoginTokenEntityInterface
154     */
155    public function setExpires(int $expires): LoginTokenEntityInterface;
156
157    /**
158     * Get expiration timestamp.
159     *
160     * @return int
161     */
162    public function getExpires(): int;
163
164    /**
165     * Set last session ID (or null for none).
166     *
167     * @param ?string $sid Last session ID (or null for none)
168     *
169     * @return LoginTokenEntityInterface
170     */
171    public function setLastSessionId(?string $sid): LoginTokenEntityInterface;
172
173    /**
174     * Get last session ID (or null for none).
175     *
176     * @return ?string
177     */
178    public function getLastSessionId(): ?string;
179}