1 | <?php |
||
11 | class AuthCode |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @var integer |
||
16 | * @Id |
||
17 | * @Column(type="integer", length=11) |
||
18 | * @GeneratedValue |
||
19 | */ |
||
20 | private $id; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | * @Column(type="string",length=40) |
||
25 | */ |
||
26 | private $code; |
||
27 | |||
28 | /** |
||
29 | * @var int |
||
30 | * @Column(type="integer",length=11) |
||
31 | */ |
||
32 | private $clientId; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | * @Column(type="integer",length=11, nullable=true) |
||
37 | */ |
||
38 | private $userId; |
||
39 | |||
40 | /** |
||
41 | * @var DateTime |
||
42 | * @Column(type="datetime") |
||
43 | */ |
||
44 | private $expires; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | * @Column(type="string",length=255) |
||
49 | */ |
||
50 | private $redirectUri; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | * @Column(type="string",length=50) |
||
55 | */ |
||
56 | private $scope; |
||
57 | |||
58 | /** |
||
59 | * @var Client |
||
60 | 6 | * @ManyToOne(targetEntity="OAuth\Client") |
|
61 | * @JoinColumn(name="client", referencedColumnName="id") |
||
62 | 6 | */ |
|
63 | 6 | private $client; |
|
64 | |||
65 | /** |
||
66 | * @var User |
||
67 | * @ManyToOne(targetEntity="OAuth\User") |
||
68 | 1 | * @JoinColumn(name="user", referencedColumnName="id") |
|
69 | */ |
||
70 | 1 | private $user; |
|
71 | |||
72 | /** |
||
73 | * Get id |
||
74 | * |
||
75 | * @return integer |
||
76 | 1 | */ |
|
77 | public function getId() |
||
81 | |||
82 | /** |
||
83 | * Set code |
||
84 | * |
||
85 | 1 | * @param string $code |
|
86 | * @return AuthCode |
||
87 | 1 | */ |
|
88 | 1 | public function setCode($code) |
|
93 | |||
94 | /** |
||
95 | * Get code |
||
96 | 1 | * |
|
97 | * @return string |
||
98 | 1 | */ |
|
99 | public function getCode() |
||
103 | |||
104 | /** |
||
105 | * Set client_id |
||
106 | 1 | * |
|
107 | * @param int $clientId |
||
108 | 1 | * @return AuthCode |
|
109 | */ |
||
110 | public function setClientId($clientId) |
||
115 | |||
116 | 1 | /** |
|
117 | * Get client_id |
||
118 | 1 | * |
|
119 | 1 | * @return int |
|
120 | */ |
||
121 | public function getClientId() |
||
125 | |||
126 | 1 | /** |
|
127 | * Set user_id |
||
128 | 1 | * |
|
129 | 1 | * @param string $userId |
|
130 | * @return AuthCode |
||
131 | */ |
||
132 | public function setUserId($userId) |
||
137 | |||
138 | 1 | /** |
|
139 | * Get user_identifier |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public function getUserId() |
||
147 | |||
148 | 1 | /** |
|
149 | * Set expires |
||
150 | * |
||
151 | * @param \DateTime $expires |
||
152 | * @return AuthCode |
||
153 | */ |
||
154 | public function setExpires($expires) |
||
159 | 1 | ||
160 | /** |
||
161 | * Get expires |
||
162 | * |
||
163 | * @return \DateTime |
||
164 | 1 | */ |
|
165 | public function getExpires() |
||
169 | |||
170 | /** |
||
171 | * Set redirect_uri |
||
172 | 1 | * |
|
173 | * @param string $redirectUri |
||
174 | 1 | * @return AuthCode |
|
175 | 1 | */ |
|
176 | public function setRedirectUri($redirectUri) |
||
181 | |||
182 | /** |
||
183 | * Get redirect_uri |
||
184 | * |
||
185 | * @return string |
||
186 | */ |
||
187 | public function getRedirectUri() |
||
191 | |||
192 | /** |
||
193 | * Set scope |
||
194 | * |
||
195 | * @param string $scope |
||
196 | * @return AuthCode |
||
197 | */ |
||
198 | public function setScope($scope) |
||
203 | |||
204 | /** |
||
205 | * Get scope |
||
206 | * |
||
207 | * @return string |
||
208 | */ |
||
209 | public function getScope() |
||
213 | |||
214 | /** |
||
215 | * Set client |
||
216 | * |
||
217 | * @param Client $client |
||
218 | * @return AuthCode |
||
219 | */ |
||
220 | public function setClient(Client $client = null) |
||
225 | |||
226 | /** |
||
227 | * Get client |
||
228 | * |
||
229 | * @return Client |
||
230 | */ |
||
231 | public function getClient() |
||
235 | |||
236 | /** |
||
237 | * Set user |
||
238 | * |
||
239 | * @param User $user |
||
240 | * @return AuthCode |
||
241 | */ |
||
242 | public function setUser(User $user = null) |
||
247 | |||
248 | /** |
||
249 | * Get user |
||
250 | * |
||
251 | * @return User |
||
252 | */ |
||
253 | public function getUser() |
||
257 | |||
258 | /** |
||
259 | * @return array |
||
260 | */ |
||
261 | public function toArray() |
||
271 | |||
272 | /** |
||
273 | * @param $params |
||
274 | * @return AuthCode |
||
275 | */ |
||
276 | public static function fromArray($params) |
||
284 | } |