<?phpnamespace App\Entity;use App\Entity\Traits\Timestampable;use App\Repository\PvCommentRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;// Commentaire libre d'un PV (procès-verbal), écrit par un éditeur pour un élève sur une période// précise. Exactement un seul des trois champs exam/quarter/annual est renseigné selon le type de// PV (séquentiel, trimestriel ou annuel) - c'est ce qui distingue les trois portées.#[ORM\HasLifecycleCallbacks]#[ORM\Entity(repositoryClass: PvCommentRepository::class)]class PvComment{ use Timestampable; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?Student $student = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?School $school = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?TheClass $classe = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?SchoolYear $year = null; // Renseigné uniquement pour un commentaire de PV séquentiel. #[ORM\ManyToOne] private ?Exams $exam = null; // Renseigné uniquement pour un commentaire de PV trimestriel. #[ORM\ManyToOne] private ?Quarter $quarter = null; // true uniquement pour un commentaire de PV annuel. #[ORM\Column(nullable: true)] private ?bool $annual = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $comment = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?User $author = null; #[ORM\ManyToOne] private ?User $editor = null; public function getId(): ?int { return $this->id; } public function getStudent(): ?Student { return $this->student; } public function setStudent(?Student $student): static { $this->student = $student; return $this; } public function getSchool(): ?School { return $this->school; } public function setSchool(?School $school): static { $this->school = $school; return $this; } public function getClasse(): ?TheClass { return $this->classe; } public function setClasse(?TheClass $classe): static { $this->classe = $classe; return $this; } public function getYear(): ?SchoolYear { return $this->year; } public function setYear(?SchoolYear $year): static { $this->year = $year; return $this; } public function getExam(): ?Exams { return $this->exam; } public function setExam(?Exams $exam): static { $this->exam = $exam; return $this; } public function getQuarter(): ?Quarter { return $this->quarter; } public function setQuarter(?Quarter $quarter): static { $this->quarter = $quarter; return $this; } public function isAnnual(): ?bool { return $this->annual; } public function setAnnual(?bool $annual): static { $this->annual = $annual; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(?string $comment): static { $this->comment = $comment; return $this; } public function getAuthor(): ?User { return $this->author; } public function setAuthor(?User $author): static { $this->author = $author; return $this; } public function getEditor(): ?User { return $this->editor; } public function setEditor(?User $editor): static { $this->editor = $editor; return $this; }}