53 lines
1,015 B
PHP
53 lines
1,015 B
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_id = null;
|
||
|
|
|
||
|
|
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||
|
|
private ?int $rating = null;
|
||
|
|
|
||
|
|
public function getId(): ?int
|
||
|
|
{
|
||
|
|
return $this->id;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getSubjectId(): ?Subject
|
||
|
|
{
|
||
|
|
return $this->subject_id;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function setSubjectId(?Subject $subject_id): static
|
||
|
|
{
|
||
|
|
$this->subject_id = $subject_id;
|
||
|
|
|
||
|
|
return $this;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getRating(): ?int
|
||
|
|
{
|
||
|
|
return $this->rating;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function setRating(?int $rating): static
|
||
|
|
{
|
||
|
|
$this->rating = $rating;
|
||
|
|
|
||
|
|
return $this;
|
||
|
|
}
|
||
|
|
}
|