Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 8 |
CRAP | |
0.00% |
0 / 1 |
Download | |
0.00% |
0 / 8 |
|
0.00% |
0 / 8 |
72 | |
0.00% |
0 / 1 |
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getPosition | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setPosition | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getEntityNameForStorage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getEntityIdForStorage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Olz\Entity\Service; |
4 | |
5 | use Doctrine\ORM\Mapping as ORM; |
6 | use Olz\Entity\Common\DataStorageInterface; |
7 | use Olz\Entity\Common\DataStorageTrait; |
8 | use Olz\Entity\Common\OlzEntity; |
9 | |
10 | #[ORM\Table(name: 'downloads')] |
11 | #[ORM\Index(name: 'position_index', columns: ['on_off', 'position'])] |
12 | #[ORM\Entity] |
13 | class Download extends OlzEntity implements DataStorageInterface { |
14 | use DataStorageTrait; |
15 | |
16 | #[ORM\Id] |
17 | #[ORM\Column(type: 'integer', nullable: false)] |
18 | #[ORM\GeneratedValue] |
19 | private int $id; |
20 | |
21 | #[ORM\Column(type: 'text', nullable: true)] |
22 | private ?string $name; |
23 | |
24 | #[ORM\Column(type: 'integer', nullable: false)] |
25 | private int $position; |
26 | |
27 | public function getId(): ?int { |
28 | return $this->id ?? null; |
29 | } |
30 | |
31 | public function setId(int $new_value): void { |
32 | $this->id = $new_value; |
33 | } |
34 | |
35 | public function getName(): ?string { |
36 | return $this->name; |
37 | } |
38 | |
39 | public function setName(?string $new_value): void { |
40 | $this->name = $new_value; |
41 | } |
42 | |
43 | public function getPosition(): int { |
44 | return $this->position; |
45 | } |
46 | |
47 | public function setPosition(int $new_value): void { |
48 | $this->position = $new_value; |
49 | } |
50 | |
51 | public static function getEntityNameForStorage(): string { |
52 | return 'downloads'; |
53 | } |
54 | |
55 | public function getEntityIdForStorage(): string { |
56 | return "{$this->getId()}"; |
57 | } |
58 | } |