Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 12 |
CRAP | |
0.00% |
0 / 1 |
StravaLink | |
0.00% |
0 / 12 |
|
0.00% |
0 / 12 |
182 | |
0.00% |
0 / 1 |
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getAccessToken | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setAccessToken | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getExpiresAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setExpiresAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getRefreshToken | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setRefreshToken | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getStravaUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setStravaUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Olz\Entity; |
4 | |
5 | use Doctrine\ORM\Mapping as ORM; |
6 | use Olz\Entity\Users\User; |
7 | use Olz\Repository\StravaLinkRepository; |
8 | |
9 | #[ORM\Table(name: 'strava_links')] |
10 | #[ORM\Index(name: 'user_id_index', columns: ['user_id'])] |
11 | #[ORM\Entity(repositoryClass: StravaLinkRepository::class)] |
12 | class StravaLink { |
13 | #[ORM\Column(type: 'text', nullable: false)] |
14 | private string $access_token; |
15 | |
16 | #[ORM\Column(type: 'datetime', nullable: false)] |
17 | private \DateTime $expires_at; |
18 | |
19 | #[ORM\Column(type: 'text', nullable: false)] |
20 | private string $refresh_token; |
21 | |
22 | #[ORM\ManyToOne(targetEntity: User::class)] |
23 | #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false)] |
24 | private User $user; |
25 | |
26 | #[ORM\Column(type: 'text', nullable: false)] |
27 | private string $strava_user; |
28 | |
29 | #[ORM\Id] |
30 | #[ORM\Column(type: 'bigint', nullable: false)] |
31 | #[ORM\GeneratedValue] |
32 | private int|string $id; |
33 | |
34 | public function getId(): ?int { |
35 | return isset($this->id) ? intval($this->id) : null; |
36 | } |
37 | |
38 | public function setId(int $new_id): void { |
39 | $this->id = $new_id; |
40 | } |
41 | |
42 | public function getAccessToken(): string { |
43 | return $this->access_token; |
44 | } |
45 | |
46 | public function setAccessToken(string $new_access_token): void { |
47 | $this->access_token = $new_access_token; |
48 | } |
49 | |
50 | public function getExpiresAt(): \DateTime { |
51 | return $this->expires_at; |
52 | } |
53 | |
54 | public function setExpiresAt(\DateTime $new_expires_at): void { |
55 | $this->expires_at = $new_expires_at; |
56 | } |
57 | |
58 | public function getRefreshToken(): string { |
59 | return $this->refresh_token; |
60 | } |
61 | |
62 | public function setRefreshToken(string $new_refresh_token): void { |
63 | $this->refresh_token = $new_refresh_token; |
64 | } |
65 | |
66 | public function getUser(): User { |
67 | return $this->user; |
68 | } |
69 | |
70 | public function setUser(User $new_user): void { |
71 | $this->user = $new_user; |
72 | } |
73 | |
74 | public function getStravaUser(): string { |
75 | return $this->strava_user; |
76 | } |
77 | |
78 | public function setStravaUser(string $new_strava_user): void { |
79 | $this->strava_user = $new_strava_user; |
80 | } |
81 | } |