|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Badger\Bundle\UserBundle\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Badger\Component\Game\Model\TagInterface; |
|
6
|
|
|
use Badger\Component\Game\Taggable\TaggableInterface; |
|
7
|
|
|
use Badger\Component\User\Model\UserInterface; |
|
8
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
9
|
|
|
use FOS\UserBundle\Model\User as BaseUser; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @license http://opensource.org/licenses/MIT The MIT License (MIT) |
|
13
|
|
|
*/ |
|
14
|
|
|
class User extends BaseUser implements UserInterface, TaggableInterface |
|
15
|
|
|
{ |
|
16
|
|
|
/** @var string */ |
|
17
|
|
|
protected $id; |
|
18
|
|
|
|
|
19
|
|
|
/** @var string */ |
|
20
|
|
|
protected $github_id; |
|
21
|
|
|
|
|
22
|
|
|
/** @var string */ |
|
23
|
|
|
protected $google_id; |
|
24
|
|
|
|
|
25
|
|
|
/** @var string */ |
|
26
|
|
|
protected $github_access_token; |
|
27
|
|
|
|
|
28
|
|
|
/** @var string */ |
|
29
|
|
|
protected $google_access_token; |
|
30
|
|
|
|
|
31
|
|
|
/** @var string */ |
|
32
|
|
|
protected $profilePicture; |
|
33
|
|
|
|
|
34
|
|
|
/** @var ArrayCollection */ |
|
35
|
|
|
protected $tags; |
|
36
|
|
|
|
|
37
|
|
|
/** @var int */ |
|
38
|
|
|
protected $nuts; |
|
39
|
|
|
|
|
40
|
|
|
/** @var \DateTime */ |
|
41
|
|
|
protected $date_registered; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* {@inheritdoc} |
|
45
|
|
|
*/ |
|
46
|
|
|
public function getGithubId() |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->github_id; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* {@inheritdoc} |
|
53
|
|
|
*/ |
|
54
|
|
|
public function setGithubId($github_id) |
|
55
|
|
|
{ |
|
56
|
|
|
$this->github_id = $github_id; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* {@inheritdoc} |
|
61
|
|
|
*/ |
|
62
|
|
|
public function getGithubAccessToken() |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->github_access_token; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* {@inheritdoc} |
|
69
|
|
|
*/ |
|
70
|
|
|
public function setGithubAccessToken($github_access_token) |
|
71
|
|
|
{ |
|
72
|
|
|
$this->github_access_token = $github_access_token; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* {@inheritdoc} |
|
77
|
|
|
*/ |
|
78
|
|
|
public function getGoogleId() |
|
79
|
|
|
{ |
|
80
|
|
|
return $this->google_id; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* {@inheritdoc} |
|
85
|
|
|
*/ |
|
86
|
|
|
public function setGoogleId($google_id) |
|
87
|
|
|
{ |
|
88
|
|
|
$this->google_id = $google_id; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* {@inheritdoc} |
|
93
|
|
|
*/ |
|
94
|
|
|
public function getGoogleAccessToken() |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->google_access_token; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* {@inheritdoc} |
|
101
|
|
|
*/ |
|
102
|
|
|
public function setGoogleAccessToken($google_access_token) |
|
103
|
|
|
{ |
|
104
|
|
|
$this->google_access_token = $google_access_token; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* {@inheritdoc} |
|
109
|
|
|
*/ |
|
110
|
|
|
public function getProfilePicture() |
|
111
|
|
|
{ |
|
112
|
|
|
return $this->profilePicture; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
/** |
|
116
|
|
|
* {@inheritdoc} |
|
117
|
|
|
*/ |
|
118
|
|
|
public function setProfilePicture($profilePicture) |
|
119
|
|
|
{ |
|
120
|
|
|
$this->profilePicture = $profilePicture; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* {@inheritdoc} |
|
125
|
|
|
*/ |
|
126
|
|
|
public function addTag(TagInterface $tag) |
|
127
|
|
|
{ |
|
128
|
|
|
$this->tags[] = $tag; |
|
129
|
|
|
|
|
130
|
|
|
return $this; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
/** |
|
134
|
|
|
* {@inheritdoc} |
|
135
|
|
|
*/ |
|
136
|
|
|
public function setTags(ArrayCollection $tags) |
|
137
|
|
|
{ |
|
138
|
|
|
$this->tags = $tags; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* {@inheritdoc} |
|
143
|
|
|
*/ |
|
144
|
|
|
public function getTags() |
|
145
|
|
|
{ |
|
146
|
|
|
return $this->tags; |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
/** |
|
150
|
|
|
* {@inheritdoc} |
|
151
|
|
|
*/ |
|
152
|
|
|
public function getNuts() |
|
153
|
|
|
{ |
|
154
|
|
|
return $this->nuts; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* {@inheritdoc} |
|
159
|
|
|
*/ |
|
160
|
|
|
public function setNuts($nuts) |
|
161
|
|
|
{ |
|
162
|
|
|
$this->nuts = $nuts; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
/** |
|
166
|
|
|
* {@inheritdoc} |
|
167
|
|
|
*/ |
|
168
|
|
|
public function addNuts($nuts) |
|
169
|
|
|
{ |
|
170
|
|
|
$this->nuts += $nuts; |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
/** |
|
174
|
|
|
* {@inheritdoc} |
|
175
|
|
|
*/ |
|
176
|
|
|
public function getDateRegistered() |
|
177
|
|
|
{ |
|
178
|
|
|
return $this->date_registered; |
|
179
|
|
|
} |
|
180
|
|
|
|
|
181
|
|
|
/** |
|
182
|
|
|
* {@inheritdoc} |
|
183
|
|
|
*/ |
|
184
|
|
|
public function setDateRegistered($registeredDate) |
|
185
|
|
|
{ |
|
186
|
|
|
$this->date_registered = $registeredDate; |
|
187
|
|
|
} |
|
188
|
|
|
} |
|
189
|
|
|
|