|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Svycka\SocialUser\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* @author Vytautas Stankus <[email protected]> |
|
9
|
|
|
* @license MIT |
|
10
|
|
|
* |
|
11
|
|
|
* @ORM\Entity |
|
12
|
|
|
* @ORM\Table(name="social_user_providers", options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"}) |
|
13
|
|
|
*/ |
|
14
|
|
|
class SocialUser implements SocialUserInterface |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @var int |
|
18
|
|
|
* @ORM\Id |
|
19
|
|
|
* @ORM\Column(type="integer", name="id") |
|
20
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
21
|
|
|
*/ |
|
22
|
|
|
protected $id; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @var int |
|
26
|
|
|
* @ORM\Column(type="integer") |
|
27
|
|
|
*/ |
|
28
|
|
|
protected $localUser; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var string |
|
32
|
|
|
* @ORM\Column(type="string", length=191) |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $identifier; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var string |
|
38
|
|
|
* @ORM\Column(type="string", length=191) |
|
39
|
|
|
*/ |
|
40
|
|
|
protected $provider; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Get id. |
|
44
|
|
|
* |
|
45
|
|
|
* @return int |
|
46
|
|
|
*/ |
|
47
|
1 |
|
public function getId() |
|
48
|
|
|
{ |
|
49
|
1 |
|
return $this->id; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Set id. |
|
54
|
|
|
* |
|
55
|
|
|
* @param int $id |
|
56
|
|
|
*/ |
|
57
|
1 |
|
public function setId($id) |
|
58
|
|
|
{ |
|
59
|
1 |
|
$this->id = (int) $id; |
|
60
|
1 |
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @param int $user |
|
64
|
|
|
*/ |
|
65
|
9 |
|
public function setLocalUser($user) |
|
66
|
|
|
{ |
|
67
|
9 |
|
$this->localUser = $user; |
|
68
|
9 |
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @return int |
|
72
|
|
|
*/ |
|
73
|
5 |
|
public function getLocalUser() |
|
74
|
|
|
{ |
|
75
|
5 |
|
return $this->localUser; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Get user identifier from provider. |
|
80
|
|
|
* |
|
81
|
|
|
* @return string |
|
82
|
|
|
*/ |
|
83
|
9 |
|
public function getIdentifier() |
|
84
|
|
|
{ |
|
85
|
9 |
|
return $this->identifier; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* Set user identifier from provider. |
|
90
|
|
|
* |
|
91
|
|
|
* @param string $identifier |
|
92
|
|
|
*/ |
|
93
|
9 |
|
public function setIdentifier($identifier) |
|
94
|
|
|
{ |
|
95
|
9 |
|
$this->identifier = $identifier; |
|
96
|
9 |
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* Get provider identifier(name). |
|
100
|
|
|
* |
|
101
|
|
|
* @return string |
|
102
|
|
|
*/ |
|
103
|
8 |
|
public function getProvider() |
|
104
|
|
|
{ |
|
105
|
8 |
|
return $this->provider; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* Set provider identifier(name). |
|
110
|
|
|
* |
|
111
|
|
|
* @param string $provider |
|
112
|
|
|
*/ |
|
113
|
9 |
|
public function setProvider($provider) |
|
114
|
|
|
{ |
|
115
|
9 |
|
$this->provider = $provider; |
|
116
|
9 |
|
} |
|
117
|
|
|
} |
|
118
|
|
|
|