1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Dontdrinkandroot\Gitki\WebBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Dontdrinkandroot\GitkiBundle\Model\GitUserInterface; |
6
|
|
|
use FOS\UserBundle\Model\User as BaseUser; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* User |
10
|
|
|
*/ |
11
|
|
|
class User extends BaseUser implements GitUserInterface |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* @var string |
15
|
|
|
*/ |
16
|
|
|
private $realName; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var int |
20
|
|
|
*/ |
21
|
|
|
private $googleId; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var int |
25
|
|
|
*/ |
26
|
|
|
private $githubId; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var int |
30
|
|
|
*/ |
31
|
|
|
private $facebookId; |
32
|
|
|
|
33
|
|
|
public function __construct() |
34
|
|
|
{ |
35
|
|
|
BaseUser::__construct(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @param int $githubId |
40
|
|
|
*/ |
41
|
|
|
public function setGithubId($githubId) |
42
|
|
|
{ |
43
|
|
|
$this->githubId = $githubId; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return int |
48
|
|
|
*/ |
49
|
|
|
public function getGithubId() |
50
|
|
|
{ |
51
|
|
|
return $this->githubId; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @param int $googleId |
56
|
|
|
*/ |
57
|
|
|
public function setGoogleId($googleId) |
58
|
|
|
{ |
59
|
|
|
$this->googleId = $googleId; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return int |
64
|
|
|
*/ |
65
|
|
|
public function getGoogleId() |
66
|
|
|
{ |
67
|
|
|
return $this->googleId; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* {@inheritdoc} |
72
|
|
|
*/ |
73
|
|
|
public function getGitUserName() |
74
|
|
|
{ |
75
|
|
|
return $this->getRealName(); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* {@inheritdoc} |
80
|
|
|
*/ |
81
|
|
|
public function getGitUserEmail() |
82
|
|
|
{ |
83
|
|
|
return $this->getEmail(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return int |
88
|
|
|
*/ |
89
|
|
|
public function getFacebookId() |
90
|
|
|
{ |
91
|
|
|
return $this->facebookId; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @param int $facebookId |
96
|
|
|
*/ |
97
|
|
|
public function setFacebookId($facebookId) |
98
|
|
|
{ |
99
|
|
|
$this->facebookId = $facebookId; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return string |
104
|
|
|
*/ |
105
|
|
|
public function getRealName() |
106
|
|
|
{ |
107
|
|
|
return $this->realName; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @param string $realName |
112
|
|
|
*/ |
113
|
|
|
public function setRealName($realName) |
114
|
|
|
{ |
115
|
|
|
$this->realName = $realName; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public function __toString() |
119
|
|
|
{ |
120
|
|
|
$s = 'id=' . $this->getId(); |
121
|
|
|
$s .= ',realName=' . $this->getRealName(); |
122
|
|
|
$s .= ',email=' . $this->getEmail(); |
123
|
|
|
|
124
|
|
|
return $s; |
125
|
|
|
} |
126
|
|
|
} |
127
|
|
|
|