1 | <?php |
||
20 | class AccessTokenEntity implements AccessTokenEntityInterface |
||
21 | { |
||
22 | use AccessTokenTrait; |
||
23 | |||
24 | /** |
||
25 | * @ORM\Id() |
||
26 | * @ORM\GeneratedValue() |
||
27 | * @ORM\Column(type="integer") |
||
28 | * @var int |
||
29 | */ |
||
30 | private $id; |
||
31 | |||
32 | /** |
||
33 | * @ORM\Column(type="boolean") |
||
34 | * @var bool |
||
35 | */ |
||
36 | private $revoked = false; |
||
37 | |||
38 | /** |
||
39 | * @ORM\ManyToOne(targetEntity="Lookyman\NetteOAuth2Server\Storage\Doctrine\Client\ClientEntity", cascade={"persist"}) |
||
40 | * @ORM\JoinColumn(nullable=false) |
||
41 | * @var ClientEntity |
||
42 | */ |
||
43 | private $client; |
||
44 | |||
45 | /** |
||
46 | * @ORM\Column(type="datetimetz") |
||
47 | * @var \DateTime |
||
48 | */ |
||
49 | private $expiryDateTime; |
||
50 | |||
51 | /** |
||
52 | * @ORM\Column(type="text", nullable=true) |
||
53 | * @var string |
||
54 | */ |
||
55 | private $userIdentifier; |
||
56 | |||
57 | /** |
||
58 | * @ORM\ManyToMany(targetEntity="Lookyman\NetteOAuth2Server\Storage\Doctrine\Scope\ScopeEntity") |
||
59 | * @ORM\JoinTable(name="access_token_scope") |
||
60 | * @var Collection of ScopeEntity |
||
61 | */ |
||
62 | private $scopes; |
||
63 | |||
64 | /** |
||
65 | * @ORM\Column(type="string", length=80, unique=true) |
||
66 | * @var string |
||
67 | */ |
||
68 | private $identifier; |
||
69 | |||
70 | public function __construct() |
||
71 | { |
||
72 | $this->scopes = new ArrayCollection(); |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @return int|null |
||
77 | */ |
||
78 | public function getId() |
||
82 | |||
83 | public function __clone() |
||
87 | |||
88 | /** |
||
89 | * @return bool |
||
90 | */ |
||
91 | public function isRevoked(): bool |
||
95 | |||
96 | /** |
||
97 | * @param bool $revoked |
||
98 | */ |
||
99 | public function setRevoked(bool $revoked) |
||
103 | |||
104 | /** |
||
105 | * @return ClientEntityInterface |
||
106 | */ |
||
107 | public function getClient() |
||
111 | |||
112 | /** |
||
113 | * @return \DateTime |
||
114 | */ |
||
115 | public function getExpiryDateTime() |
||
119 | |||
120 | /** |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getUserIdentifier() |
||
127 | |||
128 | /** |
||
129 | * @return ScopeEntityInterface[] |
||
130 | */ |
||
131 | public function getScopes() |
||
135 | |||
136 | /** |
||
137 | * @return string |
||
138 | */ |
||
139 | public function getIdentifier() |
||
143 | |||
144 | /** |
||
145 | * @param string $identifier |
||
146 | */ |
||
147 | public function setIdentifier($identifier) |
||
151 | |||
152 | /** |
||
153 | * @param \DateTime $dateTime |
||
154 | */ |
||
155 | public function setExpiryDateTime(\DateTime $dateTime) |
||
159 | |||
160 | /** |
||
161 | * @param string $identifier |
||
162 | */ |
||
163 | public function setUserIdentifier($identifier) |
||
167 | |||
168 | /** |
||
169 | * @param ClientEntityInterface $client |
||
170 | */ |
||
171 | public function setClient(ClientEntityInterface $client) |
||
177 | |||
178 | /** |
||
179 | * @param ScopeEntityInterface $scope |
||
180 | */ |
||
181 | public function addScope(ScopeEntityInterface $scope) |
||
187 | } |
||
188 |