67 lines
1.2 KiB
PHP
67 lines
1.2 KiB
PHP
<?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)]
|
|
private Subject $subject;
|
|
|
|
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
|
private ?int $score = null;
|
|
|
|
#[ORM\Column(type: Types::TEXT, options: ['default' => ''])]
|
|
private string $note = '';
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getSubject(): ?Subject
|
|
{
|
|
return $this->subject;
|
|
}
|
|
|
|
public function setSubject(?Subject $subject): static
|
|
{
|
|
$this->subject = $subject;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getScore(): ?int
|
|
{
|
|
return $this->score;
|
|
}
|
|
|
|
public function setScore(?int $score): static
|
|
{
|
|
$this->score = $score;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getNote(): string
|
|
{
|
|
return $this->note;
|
|
}
|
|
|
|
public function setNote(?string $note = ''): static
|
|
{
|
|
$this->note = $note;
|
|
|
|
return $this;
|
|
}
|
|
}
|