rater/src/Entity/Rating.php

53 lines
989 B
PHP
Raw Normal View History

2026-06-04 21:29:10 +02:00
<?php
namespace App\Entity;
use App\Repository\RatingRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RatingRepository::class)]
class Rating
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'ratings')]
#[ORM\JoinColumn(nullable: false)]
2026-06-04 21:46:16 +02:00
private ?Subject $subject = null;
2026-06-04 21:29:10 +02:00
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
2026-06-04 21:46:16 +02:00
private ?int $score = null;
2026-06-04 21:29:10 +02:00
public function getId(): ?int
{
return $this->id;
}
2026-06-04 21:46:16 +02:00
public function getSubject(): ?Subject
2026-06-04 21:29:10 +02:00
{
2026-06-04 21:46:16 +02:00
return $this->subject;
2026-06-04 21:29:10 +02:00
}
2026-06-04 21:46:16 +02:00
public function setSubject(?Subject $subject): static
2026-06-04 21:29:10 +02:00
{
2026-06-04 21:46:16 +02:00
$this->subject = $subject;
2026-06-04 21:29:10 +02:00
return $this;
}
2026-06-04 21:46:16 +02:00
public function getScore(): ?int
2026-06-04 21:29:10 +02:00
{
2026-06-04 21:46:16 +02:00
return $this->score;
2026-06-04 21:29:10 +02:00
}
2026-06-04 21:46:16 +02:00
public function setScore(?int $score): static
2026-06-04 21:29:10 +02:00
{
2026-06-04 21:46:16 +02:00
$this->score = $score;
2026-06-04 21:29:10 +02:00
return $this;
}
}