Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
Snippet | |
0.00% |
0 / 6 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 1 |
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getText | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setText | |
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\Snippets; |
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 | use Olz\Repository\Snippets\SnippetRepository; |
10 | |
11 | #[ORM\Table(name: 'snippets')] |
12 | #[ORM\Entity(repositoryClass: SnippetRepository::class)] |
13 | class Snippet extends OlzEntity implements DataStorageInterface { |
14 | use DataStorageTrait; |
15 | |
16 | #[ORM\Id] |
17 | #[ORM\Column(type: 'integer', nullable: false)] |
18 | private int $id; |
19 | |
20 | #[ORM\Column(type: 'text', nullable: true)] |
21 | private ?string $text; |
22 | |
23 | public function getId(): ?int { |
24 | return $this->id ?? null; |
25 | } |
26 | |
27 | public function setId(int $new_value): void { |
28 | $this->id = $new_value; |
29 | } |
30 | |
31 | public function getText(): ?string { |
32 | return $this->text; |
33 | } |
34 | |
35 | public function setText(?string $new_value): void { |
36 | $this->text = $new_value; |
37 | } |
38 | |
39 | // --- |
40 | |
41 | public static function getEntityNameForStorage(): string { |
42 | return 'snippets'; |
43 | } |
44 | |
45 | public function getEntityIdForStorage(): string { |
46 | return "{$this->getId()}"; |
47 | } |
48 | } |