Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 11 |
CRAP | |
0.00% |
0 / 1 |
| SkillLevel | |
0.00% |
0 / 11 |
|
0.00% |
0 / 11 |
156 | |
0.00% |
0 / 1 |
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| 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 | |||
| getSkill | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setSkill | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getValue | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setValue | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRecordedAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRecordedAt | |
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\Quiz; |
| 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\Quiz\SkillLevelRepository; |
| 10 | |
| 11 | #[ORM\Table(name: 'quiz_skill_levels')] |
| 12 | #[ORM\Index(name: 'user_skill_index', columns: ['user_id', 'skill_id'])] |
| 13 | #[ORM\Entity(repositoryClass: SkillLevelRepository::class)] |
| 14 | class SkillLevel extends OlzEntity implements TestableInterface { |
| 15 | #[ORM\Id] |
| 16 | #[ORM\Column(type: 'bigint', nullable: false)] |
| 17 | #[ORM\GeneratedValue] |
| 18 | private int|string $id; |
| 19 | |
| 20 | #[ORM\ManyToOne(targetEntity: User::class)] |
| 21 | #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true)] |
| 22 | private ?User $user; |
| 23 | |
| 24 | #[ORM\ManyToOne(targetEntity: Skill::class)] |
| 25 | #[ORM\JoinColumn(name: 'skill_id', referencedColumnName: 'id', nullable: true)] |
| 26 | private ?Skill $skill; |
| 27 | |
| 28 | #[ORM\Column(type: 'float', nullable: false)] |
| 29 | private float $value; |
| 30 | |
| 31 | #[ORM\Column(type: 'datetime', nullable: false)] |
| 32 | private \DateTime $recorded_at; |
| 33 | |
| 34 | public function getId(): ?int { |
| 35 | return isset($this->id) ? intval($this->id) : null; |
| 36 | } |
| 37 | |
| 38 | public function setId(int $new_id): void { |
| 39 | $this->id = $new_id; |
| 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 getSkill(): ?Skill { |
| 51 | return $this->skill; |
| 52 | } |
| 53 | |
| 54 | public function setSkill(?Skill $new_skill): void { |
| 55 | $this->skill = $new_skill; |
| 56 | } |
| 57 | |
| 58 | public function getValue(): float { |
| 59 | return $this->value; |
| 60 | } |
| 61 | |
| 62 | public function setValue(float $new_value): void { |
| 63 | $this->value = $new_value; |
| 64 | } |
| 65 | |
| 66 | public function getRecordedAt(): \DateTime { |
| 67 | return $this->recorded_at; |
| 68 | } |
| 69 | |
| 70 | public function setRecordedAt(\DateTime $new_recorded_at): void { |
| 71 | $this->recorded_at = $new_recorded_at; |
| 72 | } |
| 73 | |
| 74 | // --- |
| 75 | |
| 76 | public function testOnlyGetField(string $field_name): mixed { |
| 77 | return $this->{$field_name}; |
| 78 | } |
| 79 | } |