<?php
namespace App\Entity;
use App\Repository\TrainingReportRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TrainingReportRepository::class)
*/
class TrainingReport
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="trainingReports")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=Child::class, inversedBy="trainingReports")
*/
private $participant;
/**
* @ORM\ManyToOne(targetEntity=Subject::class, inversedBy="trainingReports")
* @ORM\JoinColumn(nullable=false)
*/
private $program;
/**
* @ORM\ManyToOne(targetEntity=SubjectLevel::class, inversedBy="trainingReports")
*/
private $level;
/**
* @ORM\ManyToOne(targetEntity=SubscriptionOrder::class, inversedBy="trainingReports")
*/
private $relatedToSubscription;
/**
* @ORM\ManyToOne(targetEntity=SessionOrder::class, inversedBy="trainingReports")
*/
private $relatedToGroupCourse;
/**
* @ORM\Column(type="datetime")
*/
private $askAt;
/**
* @ORM\Column(type="boolean", options={"default":false})
*/
private $hadMidExam;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $deadLineForMid;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $midGradeWriting;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $deadLineForEnd;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $endGradeWriting;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $endGradeSpeaking;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $finalGrade;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $mention;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $comments;
/**
* @ORM\Column(type="boolean", options={"default":false})
*/
private $isReadyToSend;
/**
* @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="trainingReports")
*/
private $teacher;
/**
* @ORM\OneToMany(targetEntity=Exam::class, mappedBy="relatedToTrainingReport")
*/
private $exams;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $updateBy;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isSent = false;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $sentAt;
public function __construct()
{
$this->exams = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getParticipant(): ?Child
{
return $this->participant;
}
public function setParticipant(?Child $participant): self
{
$this->participant = $participant;
return $this;
}
public function getProgram(): ?Subject
{
return $this->program;
}
public function setProgram(?Subject $program): self
{
$this->program = $program;
return $this;
}
public function getLevel(): ?SubjectLevel
{
return $this->level;
}
public function setLevel(?SubjectLevel $level): self
{
$this->level = $level;
return $this;
}
public function getRelatedToSubscription(): ?SubscriptionOrder
{
return $this->relatedToSubscription;
}
public function setRelatedToSubscription(?SubscriptionOrder $relatedToSubscription): self
{
$this->relatedToSubscription = $relatedToSubscription;
return $this;
}
public function getRelatedToGroupCourse(): ?SessionOrder
{
return $this->relatedToGroupCourse;
}
public function setRelatedToGroupCourse(?SessionOrder $relatedToGroupCourse): self
{
$this->relatedToGroupCourse = $relatedToGroupCourse;
return $this;
}
public function getAskAt(): ?\DateTimeInterface
{
return $this->askAt;
}
public function setAskAt(\DateTimeInterface $askAt): self
{
$this->askAt = $askAt;
return $this;
}
public function getHadMidExam(): ?bool
{
return $this->hadMidExam;
}
public function setHadMidExam(bool $hadMidExam): self
{
$this->hadMidExam = $hadMidExam;
return $this;
}
public function getDeadLineForMid(): ?\DateTimeInterface
{
return $this->deadLineForMid;
}
public function setDeadLineForMid(?\DateTimeInterface $deadLineForMid): self
{
$this->deadLineForMid = $deadLineForMid;
return $this;
}
public function getMidGradeWriting(): ?float
{
return $this->midGradeWriting;
}
public function setMidGradeWriting(?float $midGradeWriting): self
{
if ($midGradeWriting !== null) {
$midGradeWriting = round($midGradeWriting, 2);
}
$this->midGradeWriting = $midGradeWriting;
return $this;
}
public function getDeadLineForEnd(): ?\DateTimeInterface
{
return $this->deadLineForEnd;
}
public function setDeadLineForEnd(?\DateTimeInterface $deadLineForEnd): self
{
$this->deadLineForEnd = $deadLineForEnd;
return $this;
}
public function getEndGradeWriting(): ?float
{
return $this->endGradeWriting;
}
public function setEndGradeWriting(?float $endGradeWriting): self
{
if($endGradeWriting !== null) {
$endGradeWriting = round($endGradeWriting, 2);
}
$this->endGradeWriting = $endGradeWriting;
return $this;
}
public function getEndGradeSpeaking(): ?float
{
return $this->endGradeSpeaking;
}
public function setEndGradeSpeaking(?float $endGradeSpeaking): self
{
if($endGradeSpeaking !== null) {
$endGradeSpeaking = round($endGradeSpeaking, 2);
}
$this->endGradeSpeaking = $endGradeSpeaking;
return $this;
}
public function getFinalGrade(): ?float
{
return $this->finalGrade;
}
public function setFinalGrade(?float $finalGrade): self
{
$this->finalGrade = round($finalGrade, 2);
return $this;
}
public function getMention(): ?string
{
return $this->mention;
}
public function setMention(?string $mention): self
{
$this->mention = $mention;
return $this;
}
public function getComments(): ?string
{
return $this->comments;
}
public function setComments(?string $comments): self
{
$this->comments = $comments;
return $this;
}
public function getIsReadyToSend(): ?bool
{
return $this->isReadyToSend;
}
public function setIsReadyToSend(bool $isReadyToSend): self
{
$this->isReadyToSend = $isReadyToSend;
return $this;
}
public function getTeacher(): ?Teacher
{
return $this->teacher;
}
public function setTeacher(?Teacher $teacher): self
{
$this->teacher = $teacher;
return $this;
}
/**
* @return Collection|Exam[]
*/
public function getExams(): Collection
{
return $this->exams;
}
public function addExam(Exam $exam): self
{
if ( ! $this->exams->contains($exam)) {
$this->exams[] = $exam;
$exam->setRelatedToTrainingReport($this);
}
return $this;
}
public function removeExam(Exam $exam): self
{
if ($this->exams->removeElement($exam)) {
// set the owning side to null (unless already changed)
if ($exam->getRelatedToTrainingReport() === $this) {
$exam->setRelatedToTrainingReport(null);
}
}
return $this;
}
public function getUpdateBy(): ?string
{
return $this->updateBy;
}
public function setUpdateBy(?string $updateBy): self
{
$this->updateBy = $updateBy;
return $this;
}
public function getIsSent(): ?bool
{
return $this->isSent;
}
public function setIsSent(?bool $isSent): self
{
$this->isSent = $isSent;
return $this;
}
public function getSentAt(): ?\DateTimeImmutable
{
return $this->sentAt;
}
public function setSentAt(?\DateTimeImmutable $sentAt): self
{
$this->sentAt = $sentAt;
return $this;
}
}