Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 11 |
CRAP | |
0.00% |
0 / 1 |
Counter | |
0.00% |
0 / 11 |
|
0.00% |
0 / 11 |
156 | |
0.00% |
0 / 1 |
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getPage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setPage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getDateRange | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setDateRange | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getArgs | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setArgs | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getCounter | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setCounter | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
incrementCounter | |
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\Repository\CounterRepository; |
7 | |
8 | #[ORM\Table(name: 'counter')] |
9 | #[ORM\Index(name: 'date_range_page_index', columns: ['date_range', 'page'])] |
10 | #[ORM\Entity(repositoryClass: CounterRepository::class)] |
11 | class Counter { |
12 | #[ORM\Id] |
13 | #[ORM\Column(type: 'bigint', nullable: false)] |
14 | #[ORM\GeneratedValue] |
15 | private int|string $id; |
16 | |
17 | #[ORM\Column(type: 'string', nullable: true)] |
18 | private ?string $page; |
19 | |
20 | #[ORM\Column(type: 'string', nullable: true)] |
21 | private ?string $date_range; |
22 | |
23 | #[ORM\Column(type: 'text', nullable: true)] |
24 | private ?string $args; |
25 | |
26 | #[ORM\Column(type: 'integer', nullable: true)] |
27 | private ?int $counter; |
28 | // PRIMARY KEY (`id`) |
29 | |
30 | public function getId(): ?int { |
31 | return isset($this->id) ? intval($this->id) : null; |
32 | } |
33 | |
34 | public function setId(int $new_id): void { |
35 | $this->id = $new_id; |
36 | } |
37 | |
38 | public function getPage(): ?string { |
39 | return $this->page; |
40 | } |
41 | |
42 | public function setPage(?string $new_page): void { |
43 | $this->page = $new_page; |
44 | } |
45 | |
46 | public function getDateRange(): ?string { |
47 | return $this->date_range; |
48 | } |
49 | |
50 | public function setDateRange(?string $new_date_range): void { |
51 | $this->date_range = $new_date_range; |
52 | } |
53 | |
54 | public function getArgs(): ?string { |
55 | return $this->args; |
56 | } |
57 | |
58 | public function setArgs(?string $new_args): void { |
59 | $this->args = $new_args; |
60 | } |
61 | |
62 | public function getCounter(): ?int { |
63 | return $this->counter; |
64 | } |
65 | |
66 | public function setCounter(?int $new_counter): void { |
67 | $this->counter = $new_counter; |
68 | } |
69 | |
70 | public function incrementCounter(): void { |
71 | $this->setCounter($this->getCounter() + 1); |
72 | } |
73 | } |