Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 11 |
CRAP | |
0.00% |
0 / 1 |
| Member | |
0.00% |
0 / 11 |
|
0.00% |
0 / 11 |
132 | |
0.00% |
0 / 1 |
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getIdent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setIdent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getData | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setData | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getUpdates | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setUpdates | |
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\Members; |
| 4 | |
| 5 | use Doctrine\ORM\Mapping as ORM; |
| 6 | use Olz\Entity\Common\OlzEntity; |
| 7 | use Olz\Entity\Common\TestableInterface; |
| 8 | use Olz\Entity\Users\User; |
| 9 | use Olz\Repository\Members\MemberRepository; |
| 10 | |
| 11 | #[ORM\Table(name: 'members')] |
| 12 | #[ORM\Index(name: 'ident_index', columns: ['ident'])] |
| 13 | #[ORM\Index(name: 'user_id_index', columns: ['user_id'])] |
| 14 | #[ORM\Entity(repositoryClass: MemberRepository::class)] |
| 15 | class Member extends OlzEntity implements TestableInterface { |
| 16 | #[ORM\Id] |
| 17 | #[ORM\Column(type: 'integer', nullable: false)] |
| 18 | #[ORM\GeneratedValue] |
| 19 | public int $id; |
| 20 | |
| 21 | #[ORM\ManyToOne(targetEntity: User::class)] |
| 22 | #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true)] |
| 23 | private ?User $user; |
| 24 | |
| 25 | #[ORM\Column(type: 'string', nullable: false)] |
| 26 | public string $ident; |
| 27 | |
| 28 | #[ORM\Column(type: 'text', nullable: false)] |
| 29 | public string $data; |
| 30 | |
| 31 | #[ORM\Column(type: 'text', nullable: true)] |
| 32 | public ?string $updates; |
| 33 | |
| 34 | public function getId(): ?int { |
| 35 | return $this->id ?? null; |
| 36 | } |
| 37 | |
| 38 | public function setId(int $new_value): void { |
| 39 | $this->id = $new_value; |
| 40 | } |
| 41 | |
| 42 | public function getUser(): ?User { |
| 43 | return $this->user; |
| 44 | } |
| 45 | |
| 46 | public function setUser(?User $new_user): void { |
| 47 | $this->user = $new_user; |
| 48 | } |
| 49 | |
| 50 | public function getIdent(): string { |
| 51 | return $this->ident; |
| 52 | } |
| 53 | |
| 54 | public function setIdent(string $new_value): void { |
| 55 | $this->ident = $new_value; |
| 56 | } |
| 57 | |
| 58 | public function getData(): string { |
| 59 | return $this->data; |
| 60 | } |
| 61 | |
| 62 | public function setData(string $new_value): void { |
| 63 | $this->data = $new_value; |
| 64 | } |
| 65 | |
| 66 | public function getUpdates(): ?string { |
| 67 | return $this->updates; |
| 68 | } |
| 69 | |
| 70 | public function setUpdates(?string $new_value): void { |
| 71 | $this->updates = $new_value; |
| 72 | } |
| 73 | |
| 74 | // --- |
| 75 | |
| 76 | public function testOnlyGetField(string $field_name): mixed { |
| 77 | return $this->{$field_name}; |
| 78 | } |
| 79 | } |