1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PiouPiou\RibsAdminBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Entity\AccountToken |
9
|
|
|
* |
10
|
|
|
* @ORM\Entity(repositoryClass="PiouPiou\RibsAdminBundle\Repository\AccountTokenRepository") |
11
|
|
|
* @ORM\Table(name="`account_token`", |
12
|
|
|
* indexes = { |
13
|
|
|
* @ORM\Index(name="fk_user_token_account_idx", columns={"account_id"}) |
14
|
|
|
* }) |
15
|
|
|
*/ |
16
|
|
|
class AccountToken |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* @ORM\Id |
20
|
|
|
* @ORM\Column(type="integer") |
21
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
22
|
|
|
*/ |
23
|
|
|
protected $id; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @ORM\Column(type="string", length=200) |
27
|
|
|
*/ |
28
|
|
|
protected $token; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @ORM\Column(type="datetime", nullable=true) |
32
|
|
|
*/ |
33
|
|
|
protected $endToken; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @ORM\Column(type="string", length=200) |
37
|
|
|
*/ |
38
|
|
|
protected $userAgent; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @ORM\Column(type="string", length=200) |
42
|
|
|
*/ |
43
|
|
|
protected $ip; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @ORM\ManyToOne(targetEntity="Account", inversedBy="tokens") |
47
|
|
|
* @ORM\JoinColumn(name="account_id", referencedColumnName="id", nullable=false) |
48
|
|
|
*/ |
49
|
|
|
protected $account; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return mixed |
53
|
|
|
*/ |
54
|
|
|
public function getId() |
55
|
|
|
{ |
56
|
|
|
return $this->id; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @param mixed $id |
61
|
|
|
* @return AccountToken |
62
|
|
|
*/ |
63
|
|
|
public function setId($id) |
64
|
|
|
{ |
65
|
|
|
$this->id = $id; |
66
|
|
|
|
67
|
|
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return mixed |
72
|
|
|
*/ |
73
|
|
|
public function getToken() |
74
|
|
|
{ |
75
|
|
|
return $this->token; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param mixed $token |
80
|
|
|
* @return AccountToken |
81
|
|
|
*/ |
82
|
|
|
public function setToken($token) |
83
|
|
|
{ |
84
|
|
|
$this->token = $token; |
85
|
|
|
|
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return mixed |
91
|
|
|
*/ |
92
|
|
|
public function getEndToken() |
93
|
|
|
{ |
94
|
|
|
return $this->endToken; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param mixed $endToken |
99
|
|
|
* @return AccountToken |
100
|
|
|
*/ |
101
|
|
|
public function setEndToken($endToken) |
102
|
|
|
{ |
103
|
|
|
$this->endToken = $endToken; |
104
|
|
|
|
105
|
|
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return mixed |
110
|
|
|
*/ |
111
|
|
|
public function getUserAgent() |
112
|
|
|
{ |
113
|
|
|
return $this->userAgent; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param mixed $userAgent |
118
|
|
|
* @return AccountToken |
119
|
|
|
*/ |
120
|
|
|
public function setUserAgent($userAgent) |
121
|
|
|
{ |
122
|
|
|
$this->userAgent = $userAgent; |
123
|
|
|
|
124
|
|
|
return $this; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @return mixed |
129
|
|
|
*/ |
130
|
|
|
public function getIp() |
131
|
|
|
{ |
132
|
|
|
return $this->ip; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @param mixed $ip |
137
|
|
|
* @return AccountToken |
138
|
|
|
*/ |
139
|
|
|
public function setIp($ip) |
140
|
|
|
{ |
141
|
|
|
$this->ip = $ip; |
142
|
|
|
|
143
|
|
|
return $this; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* Set Account entity (many to one). |
148
|
|
|
* |
149
|
|
|
* @param Account $account |
150
|
|
|
* @return AccountToken |
151
|
|
|
*/ |
152
|
|
|
public function setAccount(Account $account = null) |
153
|
|
|
{ |
154
|
|
|
$this->account = $account; |
155
|
|
|
|
156
|
|
|
return $this; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Get Account entity (many to one). |
161
|
|
|
* |
162
|
|
|
* @return Account |
163
|
|
|
*/ |
164
|
|
|
public function getAccount() |
165
|
|
|
{ |
166
|
|
|
return $this->account; |
167
|
|
|
} |
168
|
|
|
} |
169
|
|
|
|