Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 15 |
CRAP | |
0.00% |
0 / 1 |
| ForwardedEmail | |
0.00% |
0 / 15 |
|
0.00% |
0 / 15 |
272 | |
0.00% |
0 / 1 |
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRecipientUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRecipientUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSenderAddress | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setSenderAddress | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSubject | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setSubject | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getForwardedAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setForwardedAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getErrorMessage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setErrorMessage | |
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\Entity\Users\User; |
| 8 | use Olz\Repository\ForwardedEmailRepository; |
| 9 | |
| 10 | #[ORM\Table(name: 'forwarded_emails')] |
| 11 | #[ORM\Index(name: 'recipient_user_id_forwarded_at_index', columns: ['recipient_user_id', 'forwarded_at'])] |
| 12 | #[ORM\Entity(repositoryClass: ForwardedEmailRepository::class)] |
| 13 | class ForwardedEmail implements TestableInterface { |
| 14 | #[ORM\ManyToOne(targetEntity: User::class)] |
| 15 | #[ORM\JoinColumn(name: 'recipient_user_id', referencedColumnName: 'id', nullable: true)] |
| 16 | private ?User $recipient_user; |
| 17 | |
| 18 | #[ORM\Column(type: 'string', nullable: false)] |
| 19 | private string $sender_address; |
| 20 | |
| 21 | #[ORM\Column(type: 'string', nullable: false)] |
| 22 | private string $subject; |
| 23 | |
| 24 | #[ORM\Column(type: 'text', nullable: false)] |
| 25 | private string $body; |
| 26 | |
| 27 | #[ORM\Column(type: 'datetime', nullable: true)] |
| 28 | private ?\DateTime $forwarded_at; |
| 29 | |
| 30 | #[ORM\Column(type: 'string', nullable: true)] |
| 31 | private ?string $error_message; |
| 32 | |
| 33 | #[ORM\Id] |
| 34 | #[ORM\Column(type: 'bigint', nullable: false)] |
| 35 | #[ORM\GeneratedValue] |
| 36 | private int|string $id; |
| 37 | |
| 38 | public function getId(): ?int { |
| 39 | return isset($this->id) ? intval($this->id) : null; |
| 40 | } |
| 41 | |
| 42 | public function setId(int $new_id): void { |
| 43 | $this->id = $new_id; |
| 44 | } |
| 45 | |
| 46 | public function getRecipientUser(): ?User { |
| 47 | return $this->recipient_user; |
| 48 | } |
| 49 | |
| 50 | public function setRecipientUser(?User $new_value): void { |
| 51 | $this->recipient_user = $new_value; |
| 52 | } |
| 53 | |
| 54 | public function getSenderAddress(): string { |
| 55 | return $this->sender_address; |
| 56 | } |
| 57 | |
| 58 | public function setSenderAddress(string $new_value): void { |
| 59 | $this->sender_address = $new_value; |
| 60 | } |
| 61 | |
| 62 | public function getSubject(): string { |
| 63 | return $this->subject; |
| 64 | } |
| 65 | |
| 66 | public function setSubject(string $new_value): void { |
| 67 | $this->subject = $new_value; |
| 68 | } |
| 69 | |
| 70 | public function getBody(): string { |
| 71 | return $this->body; |
| 72 | } |
| 73 | |
| 74 | public function setBody(string $new_value): void { |
| 75 | $this->body = $new_value; |
| 76 | } |
| 77 | |
| 78 | public function getForwardedAt(): ?\DateTime { |
| 79 | return $this->forwarded_at; |
| 80 | } |
| 81 | |
| 82 | public function setForwardedAt(?\DateTime $new_value): void { |
| 83 | $this->forwarded_at = $new_value; |
| 84 | } |
| 85 | |
| 86 | public function getErrorMessage(): ?string { |
| 87 | return $this->error_message; |
| 88 | } |
| 89 | |
| 90 | public function setErrorMessage(?string $new_value): void { |
| 91 | $this->error_message = $new_value; |
| 92 | } |
| 93 | |
| 94 | // --- |
| 95 | |
| 96 | public function testOnlyGetField(string $field_name): mixed { |
| 97 | return $this->{$field_name}; |
| 98 | } |
| 99 | } |