1 | <?php |
||
12 | class AccessToken implements AccessTokenEntityInterface |
||
13 | { |
||
14 | use AccessTokenTrait; |
||
15 | |||
16 | /** |
||
17 | * @var ScopeEntityInterface[] |
||
18 | */ |
||
19 | protected $scopes = []; |
||
20 | |||
21 | /** |
||
22 | * @var DateTime |
||
23 | */ |
||
24 | protected $expiryDateTime; |
||
25 | |||
26 | /** |
||
27 | * @var string|int |
||
28 | */ |
||
29 | protected $userIdentifier; |
||
30 | |||
31 | /** |
||
32 | * @var ClientEntityInterface |
||
33 | */ |
||
34 | protected $client; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $identifier; |
||
40 | |||
41 | /** |
||
42 | * @return mixed |
||
43 | */ |
||
44 | public function getIdentifier() |
||
48 | |||
49 | /** |
||
50 | * @param mixed $identifier |
||
51 | */ |
||
52 | public function setIdentifier($identifier) |
||
56 | |||
57 | /** |
||
58 | * Associate a scope with the token. |
||
59 | * |
||
60 | * @param ScopeEntityInterface $scope |
||
61 | */ |
||
62 | public function addScope(ScopeEntityInterface $scope) |
||
66 | |||
67 | /** |
||
68 | * Return an array of scopes associated with the token. |
||
69 | * |
||
70 | * @return ScopeEntityInterface[] |
||
71 | */ |
||
72 | public function getScopes() |
||
76 | |||
77 | /** |
||
78 | * Get the token's expiry date time. |
||
79 | * |
||
80 | * @return DateTime |
||
81 | */ |
||
82 | public function getExpiryDateTime() |
||
86 | |||
87 | /** |
||
88 | * Set the date time when the token expires. |
||
89 | * |
||
90 | * @param DateTime $dateTime |
||
91 | */ |
||
92 | public function setExpiryDateTime(DateTime $dateTime) |
||
96 | |||
97 | /** |
||
98 | * Set the identifier of the user associated with the token. |
||
99 | * |
||
100 | * @param string|int $identifier The identifier of the user |
||
101 | */ |
||
102 | public function setUserIdentifier($identifier) |
||
106 | |||
107 | /** |
||
108 | * Get the token user's identifier. |
||
109 | * |
||
110 | * @return string|int |
||
111 | */ |
||
112 | public function getUserIdentifier() |
||
116 | |||
117 | /** |
||
118 | * Get the client that the token was issued to. |
||
119 | * |
||
120 | * @return ClientEntityInterface |
||
121 | */ |
||
122 | public function getClient() |
||
126 | |||
127 | /** |
||
128 | * Set the client that the token was issued to. |
||
129 | * |
||
130 | * @param ClientEntityInterface $client |
||
131 | */ |
||
132 | public function setClient(ClientEntityInterface $client) |
||
136 | } |