Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
9 / 9
CRAP
100.00% covered (success)
100.00%
1 / 1
TerminReaction
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
9 / 9
10
100.00% covered (success)
100.00%
1 / 1
 getId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
 setId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getTermin
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTermin
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getUser
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setUser
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getEmoji
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setEmoji
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 testOnlyGetField
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Olz\Entity\Termine;
4
5use Doctrine\ORM\Mapping as ORM;
6use Olz\Entity\Common\TestableInterface;
7use Olz\Entity\Users\User;
8use Olz\Repository\Termine\TerminReactionRepository;
9
10#[ORM\Table(name: 'termin_reactions')]
11#[ORM\Index(name: 'termin_emoji_user_index', columns: ['termin_id', 'emoji', 'user_id'])]
12#[ORM\Entity(repositoryClass: TerminReactionRepository::class)]
13class TerminReaction implements TestableInterface {
14    #[ORM\Id]
15    #[ORM\Column(type: 'bigint', nullable: false)]
16    #[ORM\GeneratedValue]
17    private int|string $id;
18
19    #[ORM\ManyToOne(targetEntity: Termin::class)]
20    #[ORM\JoinColumn(name: 'termin_id', referencedColumnName: 'id', nullable: false)]
21    private Termin $termin;
22
23    #[ORM\ManyToOne(targetEntity: User::class)]
24    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false)]
25    private User $user;
26
27    #[ORM\Column(type: 'string', length: 15, nullable: false)]
28    private string $emoji;
29
30    public function getId(): ?int {
31        return isset($this->id) ? intval($this->id) : null;
32    }
33
34    public function setId(int $new_value): void {
35        $this->id = $new_value;
36    }
37
38    public function getTermin(): Termin {
39        return $this->termin;
40    }
41
42    public function setTermin(Termin $new_value): void {
43        $this->termin = $new_value;
44    }
45
46    public function getUser(): User {
47        return $this->user;
48    }
49
50    public function setUser(User $new_value): void {
51        $this->user = $new_value;
52    }
53
54    public function getEmoji(): string {
55        return $this->emoji;
56    }
57
58    public function setEmoji(string $new_value): void {
59        $this->emoji = $new_value;
60    }
61
62    // ---
63
64    public function testOnlyGetField(string $field_name): mixed {
65        return $this->{$field_name};
66    }
67}