Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 12 |
CRAP | |
0.00% |
0 / 1 |
| WeeklyPicture | |
0.00% |
0 / 12 |
|
0.00% |
0 / 12 |
156 | |
0.00% |
0 / 1 |
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPublishedDate | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setPublishedDate | |
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 | |||
| getImageId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setImageId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __toString | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| testOnlyGetField | |
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\Startseite; |
| 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\Entity\Common\TestableInterface; |
| 10 | use Olz\Repository\Startseite\WeeklyPictureRepository; |
| 11 | |
| 12 | #[ORM\Table(name: 'weekly_picture')] |
| 13 | #[ORM\Index(name: 'datum_index', columns: ['datum'])] |
| 14 | #[ORM\Entity(repositoryClass: WeeklyPictureRepository::class)] |
| 15 | class WeeklyPicture extends OlzEntity implements DataStorageInterface, TestableInterface { |
| 16 | use DataStorageTrait; |
| 17 | |
| 18 | #[ORM\Column(type: 'date', nullable: true)] |
| 19 | private ?\DateTime $datum; |
| 20 | |
| 21 | #[ORM\Column(type: 'text', nullable: true)] |
| 22 | private ?string $image_id; |
| 23 | |
| 24 | #[ORM\Column(type: 'text', nullable: true)] |
| 25 | private ?string $text; |
| 26 | |
| 27 | #[ORM\Id] |
| 28 | #[ORM\Column(type: 'integer', nullable: false)] |
| 29 | #[ORM\GeneratedValue] |
| 30 | private int $id; |
| 31 | // PRIMARY KEY (`id`), |
| 32 | // KEY `datum` (`datum`) |
| 33 | |
| 34 | public function getId(): ?int { |
| 35 | return $this->id ?? null; |
| 36 | } |
| 37 | |
| 38 | public function setId(int $new_id): void { |
| 39 | $this->id = $new_id; |
| 40 | } |
| 41 | |
| 42 | public function getPublishedDate(): ?\DateTime { |
| 43 | return $this->datum; |
| 44 | } |
| 45 | |
| 46 | public function setPublishedDate(?\DateTime $new_datum): void { |
| 47 | $this->datum = $new_datum; |
| 48 | } |
| 49 | |
| 50 | public function getText(): ?string { |
| 51 | return $this->text; |
| 52 | } |
| 53 | |
| 54 | public function setText(?string $new_text): void { |
| 55 | $this->text = $new_text; |
| 56 | } |
| 57 | |
| 58 | public function getImageId(): ?string { |
| 59 | return $this->image_id; |
| 60 | } |
| 61 | |
| 62 | public function setImageId(?string $new_image_id): void { |
| 63 | $this->image_id = $new_image_id; |
| 64 | } |
| 65 | |
| 66 | // --- |
| 67 | |
| 68 | public function __toString(): string { |
| 69 | return "WeeklyPicture (ID: {$this->getId()})"; |
| 70 | } |
| 71 | |
| 72 | public function testOnlyGetField(string $field_name): mixed { |
| 73 | return $this->{$field_name}; |
| 74 | } |
| 75 | |
| 76 | public static function getEntityNameForStorage(): string { |
| 77 | return 'weekly_picture'; |
| 78 | } |
| 79 | |
| 80 | public function getEntityIdForStorage(): string { |
| 81 | return "{$this->getId()}"; |
| 82 | } |
| 83 | } |