-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathUser.php
More file actions
134 lines (110 loc) · 2.88 KB
/
Copy pathUser.php
File metadata and controls
134 lines (110 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
declare(strict_types=1);
namespace PHPCensor\Model\Base;
use PHPCensor\Model;
/**
* @package PHP Censor
* @subpackage Application
*
* @author Dan Cryer <dan@block8.co.uk>
* @author Dmitry Khomutov <poisoncorpsee@gmail.com>
*/
class User extends Model
{
protected array $data = [
'id' => null,
'email' => null,
'hash' => null,
'is_admin' => 0,
'name' => null,
'language' => null,
'per_page' => null,
'provider_key' => 'internal',
'provider_data' => null,
'remember_key' => null,
];
protected array $dataTypes = [
'is_admin' => 'boolean',
'per_page' => 'integer',
'provider_data' => 'array'
];
public function getEmail(): ?string
{
return $this->getDataItem('email');
}
public function setEmail(string $value): bool
{
return $this->setDataItem('email', $value);
}
public function getHash(): ?string
{
return $this->getDataItem('hash');
}
public function setHash(string $value): bool
{
return $this->setDataItem('hash', $value);
}
public function getIsAdmin(): bool
{
return $this->getDataItem('is_admin');
}
public function setIsAdmin(bool $value): bool
{
return $this->setDataItem('is_admin', $value);
}
public function getName(): ?string
{
return $this->getDataItem('name');
}
public function setName(string $value): bool
{
return $this->setDataItem('name', $value);
}
public function getLanguage(): ?string
{
return $this->getDataItem('language');
}
public function setLanguage(?string $value): bool
{
return $this->setDataItem('language', $value);
}
public function getPerPage(): ?int
{
return $this->getDataItem('per_page');
}
public function setPerPage(?int $value): bool
{
return $this->setDataItem('per_page', $value);
}
public function getProviderKey(): ?string
{
return $this->getDataItem('provider_key');
}
public function setProviderKey(string $value): bool
{
return $this->setDataItem('provider_key', $value);
}
/**
* @return mixed
*/
public function getProviderData(string $key = null)
{
$data = $this->getDataItem('provider_data');
if ($key === null) {
return $data;
}
return $data[$key] ?? null;
}
public function setProviderData(array $value): bool
{
return $this->setDataItem('provider_data', $value);
}
public function getRememberKey(): ?string
{
return $this->getDataItem('remember_key');
}
public function setRememberKey(?string $value): bool
{
return $this->setDataItem('remember_key', $value);
}
}