1 | <?php |
||
15 | class Token implements ClaimedResourceInterface |
||
16 | { |
||
17 | /** |
||
18 | * @ORM\Id() |
||
19 | * @ORM\GeneratedValue() |
||
20 | * @ORM\Column(type="integer") |
||
21 | * @var integer |
||
22 | */ |
||
23 | private $id; |
||
24 | /** |
||
25 | * @ORM\Column(type="string", nullable=false, unique=true) |
||
26 | * @var string |
||
27 | */ |
||
28 | private $token; |
||
29 | /** |
||
30 | * @ORM\Column(type="boolean", nullable=false) |
||
31 | * @var boolean |
||
32 | */ |
||
33 | private $active = false; |
||
34 | /** |
||
35 | * @ORM\Column(type="datetime") |
||
36 | * @var \DateTime |
||
37 | */ |
||
38 | private $createdAt; |
||
39 | /** |
||
40 | * @ORM\Column(type="datetime", nullable=false) |
||
41 | * @var \DateTime |
||
42 | */ |
||
43 | private $due; |
||
44 | /** |
||
45 | * @ORM\ManyToOne(targetEntity="\SlayerBirden\DataFlowServer\Domain\Entities\User") |
||
46 | * @ORM\JoinColumn(onDelete="CASCADE") |
||
47 | * @var User |
||
48 | */ |
||
49 | private $owner; |
||
50 | /** |
||
51 | * @ORM\OneToMany(targetEntity="\SlayerBirden\DataFlowServer\Authentication\Entities\Grant", mappedBy="token") |
||
52 | * @var Grant[]|Collection |
||
53 | */ |
||
54 | private $grants; |
||
55 | |||
56 | /** |
||
57 | * @return int |
||
58 | */ |
||
59 | 30 | public function getId(): int |
|
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 30 | public function getToken(): string |
|
71 | |||
72 | /** |
||
73 | * @param string $token |
||
74 | */ |
||
75 | 24 | public function setToken(string $token): void |
|
79 | |||
80 | /** |
||
81 | * @return bool |
||
82 | */ |
||
83 | 142 | public function isActive(): bool |
|
87 | |||
88 | /** |
||
89 | * @param bool $active |
||
90 | */ |
||
91 | 46 | public function setActive(bool $active): void |
|
95 | |||
96 | /** |
||
97 | * @return \DateTime |
||
98 | */ |
||
99 | 30 | public function getCreatedAt(): \DateTime |
|
103 | |||
104 | /** |
||
105 | * @param \DateTime $createdAt |
||
106 | */ |
||
107 | 28 | public function setCreatedAt(\DateTime $createdAt): void |
|
111 | |||
112 | /** |
||
113 | * @return \DateTime |
||
114 | */ |
||
115 | 140 | public function getDue(): \DateTime |
|
119 | |||
120 | /** |
||
121 | * @param \DateTime $due |
||
122 | */ |
||
123 | 40 | public function setDue(\DateTime $due): void |
|
127 | |||
128 | /** |
||
129 | * @return User |
||
130 | */ |
||
131 | 134 | public function getOwner(): User |
|
135 | |||
136 | /** |
||
137 | * @param User $owner |
||
138 | */ |
||
139 | 30 | public function setOwner(User $owner): void |
|
143 | |||
144 | /** |
||
145 | * @return Collection|Grant[] |
||
146 | */ |
||
147 | 136 | public function getGrants(): Collection |
|
151 | |||
152 | /** |
||
153 | * @param Collection|Grant[] $grants |
||
154 | */ |
||
155 | 28 | public function setGrants(Collection $grants): void |
|
159 | } |
||
160 |