Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
2 / 2 |
RememberMeToken | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
11 | |
100.00% |
2 / 2 |
setSeries | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getSeries | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setValue | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getValue | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setLastused | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getLastused | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setClass | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getClass | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setUsername | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getUsername | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
schemaDef | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
1 | <?php |
2 | |
3 | // {{{ License |
4 | |
5 | // This file is part of GNU social - https://www.gnu.org/software/social |
6 | // |
7 | // GNU social is free software: you can redistribute it and/or modify |
8 | // it under the terms of the GNU Affero General Public License as published by |
9 | // the Free Software Foundation, either version 3 of the License, or |
10 | // (at your option) any later version. |
11 | // |
12 | // GNU social is distributed in the hope that it will be useful, |
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | // GNU Affero General Public License for more details. |
16 | // |
17 | // You should have received a copy of the GNU Affero General Public License |
18 | // along with GNU social. If not, see <http://www.gnu.org/licenses/>. |
19 | |
20 | // }}} |
21 | |
22 | namespace App\Entity; |
23 | |
24 | use App\Core\Entity; |
25 | use DateTimeInterface; |
26 | |
27 | /** |
28 | * Entity for the remember_me token |
29 | * |
30 | * @category DB |
31 | * @package GNUsocial |
32 | * |
33 | * @author Hugo Sales <hugo@hsal.es> |
34 | * @copyright 2020-2021 Free Software Foundation, Inc http://www.fsf.org |
35 | * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later |
36 | */ |
37 | class RememberMeToken extends Entity |
38 | { |
39 | // {{{ Autocode |
40 | // @codeCoverageIgnoreStart |
41 | private string $series; |
42 | private string $value; |
43 | private \DateTimeInterface $lastused; |
44 | private string $class; |
45 | private string $username; |
46 | |
47 | public function setSeries(string $series): self |
48 | { |
49 | $this->series = $series; |
50 | return $this; |
51 | } |
52 | |
53 | public function getSeries(): string |
54 | { |
55 | return $this->series; |
56 | } |
57 | |
58 | public function setValue(string $value): self |
59 | { |
60 | $this->value = $value; |
61 | return $this; |
62 | } |
63 | |
64 | public function getValue(): string |
65 | { |
66 | return $this->value; |
67 | } |
68 | |
69 | public function setLastused(DateTimeInterface $lastused): self |
70 | { |
71 | $this->lastused = $lastused; |
72 | return $this; |
73 | } |
74 | |
75 | public function getLastused(): DateTimeInterface |
76 | { |
77 | return $this->lastused; |
78 | } |
79 | |
80 | public function setClass(string $class): self |
81 | { |
82 | $this->class = $class; |
83 | return $this; |
84 | } |
85 | |
86 | public function getClass(): string |
87 | { |
88 | return $this->class; |
89 | } |
90 | |
91 | public function setUsername(string $username): self |
92 | { |
93 | $this->username = $username; |
94 | return $this; |
95 | } |
96 | |
97 | public function getUsername(): string |
98 | { |
99 | return $this->username; |
100 | } |
101 | |
102 | // @codeCoverageIgnoreEnd |
103 | // }}} Autocode |
104 | |
105 | public static function schemaDef(): array |
106 | { |
107 | $def = [ |
108 | 'name' => 'rememberme_token', |
109 | 'fields' => [ |
110 | 'series' => ['type' => 'char', 'length' => 88, 'not null' => true], |
111 | 'value' => ['type' => 'char', 'length' => 88, 'not null' => true], |
112 | 'lastused' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP'], |
113 | 'class' => ['type' => 'varchar', 'length' => 100, 'not null' => true], |
114 | 'username' => ['type' => 'varchar', 'length' => 64, 'not null' => true], |
115 | ], |
116 | 'primary key' => ['series'], |
117 | ]; |
118 | |
119 | return $def; |
120 | } |
121 | } |