Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
| Throttling | |
0.00% |
0 / 7 |
|
0.00% |
0 / 7 |
56 | |
0.00% |
0 / 1 |
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getEventName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEventName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLastOccurrence | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setLastOccurrence | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| testOnlyGetField | |
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\Common\TestableInterface; |
| 7 | use Olz\Repository\ThrottlingRepository; |
| 8 | |
| 9 | #[ORM\Table(name: 'throttlings')] |
| 10 | #[ORM\UniqueConstraint(name: 'event_name_index', columns: ['event_name'])] |
| 11 | #[ORM\Entity(repositoryClass: ThrottlingRepository::class)] |
| 12 | class Throttling implements TestableInterface { |
| 13 | #[ORM\Column(type: 'string', nullable: false)] |
| 14 | private string $event_name; |
| 15 | |
| 16 | #[ORM\Column(type: 'datetime', nullable: true)] |
| 17 | private ?\DateTime $last_occurrence; |
| 18 | |
| 19 | #[ORM\Id] |
| 20 | #[ORM\Column(type: 'bigint', nullable: false)] |
| 21 | #[ORM\GeneratedValue] |
| 22 | private int|string $id; |
| 23 | |
| 24 | public function getId(): int|string { |
| 25 | return intval($this->id); |
| 26 | } |
| 27 | |
| 28 | public function setId(int|string $new_id): void { |
| 29 | $this->id = $new_id; |
| 30 | } |
| 31 | |
| 32 | public function getEventName(): string { |
| 33 | return $this->event_name; |
| 34 | } |
| 35 | |
| 36 | public function setEventName(string $new_event_name): void { |
| 37 | $this->event_name = $new_event_name; |
| 38 | } |
| 39 | |
| 40 | public function getLastOccurrence(): ?\DateTime { |
| 41 | return $this->last_occurrence; |
| 42 | } |
| 43 | |
| 44 | public function setLastOccurrence(?\DateTime $new_last_occurrence): void { |
| 45 | $this->last_occurrence = $new_last_occurrence; |
| 46 | } |
| 47 | |
| 48 | // --- |
| 49 | |
| 50 | public function testOnlyGetField(string $field_name): mixed { |
| 51 | return $this->{$field_name}; |
| 52 | } |
| 53 | } |