<?php
namespace App\Entity;
use App\Repository\ChildLessonReviewRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=ChildLessonReviewRepository::class)
*/
class ChildLessonReview
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"ChildLessonReviewList", "TeacherResponsesList"})
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Child::class, inversedBy="childLessonReviews")
* @Groups({"ChildLessonReviewList", "TeacherResponsesList"})
*/
private $child;
/**
* @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="childLessonReviews")
* @Groups({"ChildLessonReviewList"})
*/
private $Teacher;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"ChildLessonReviewList", "TeacherResponsesList"})
*/
private $dateAdd;
/**
* @ORM\ManyToOne(targetEntity=Lesson::class, inversedBy="childLessonReviews")
* @Groups({"ChildLessonReviewList", "TeacherResponsesList"})
*/
private $lesson;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"ChildLessonReviewList", "TeacherResponsesList"})
*/
private $rating;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"ChildLessonReviewList", "TeacherResponsesList"})
*/
private $comment;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": 0})
*/
private $isDeleted = false;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $deleteReason;
/**
* @ORM\ManyToOne(targetEntity=Admin::class)
* @ORM\JoinColumn(name="deleted_by", referencedColumnName="id", nullable=true)
*/
private $deletedBy;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $deletedAt;
public function getId(): ?int
{
return $this->id;
}
public function getChild(): ?Child
{
return $this->child;
}
public function setChild(?Child $child): self
{
$this->child = $child;
return $this;
}
public function getTeacher(): ?Teacher
{
return $this->Teacher;
}
public function setTeacher(?Teacher $Teacher): self
{
$this->Teacher = $Teacher;
return $this;
}
public function getDateAdd(): ?\DateTimeInterface
{
return $this->dateAdd;
}
public function setDateAdd(?\DateTimeInterface $dateAdd): self
{
$this->dateAdd = $dateAdd;
return $this;
}
public function getLesson(): ?Lesson
{
return $this->lesson;
}
public function setLesson(?Lesson $lesson): self
{
$this->lesson = $lesson;
return $this;
}
public function getRating(): ?int
{
return $this->rating;
}
public function setRating(?int $rating): self
{
$this->rating = $rating;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getIsDeleted(): ?bool
{
return $this->isDeleted;
}
public function setIsDeleted(?bool $isDeleted): self
{
$this->isDeleted = $isDeleted;
return $this;
}
public function getDeleteReason(): ?string
{
return $this->deleteReason;
}
public function setDeleteReason(?string $deleteReason): self
{
$this->deleteReason = $deleteReason;
return $this;
}
public function getDeletedBy(): ?Admin
{
return $this->deletedBy;
}
public function setDeletedBy(?Admin $deletedBy): self
{
$this->deletedBy = $deletedBy;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public static function getRatingLabel(?int $rating): string
{
return match ($rating) {
2 => '😞 Labai silpnai',
4 => '😕 Silpnai',
8 => '🙂 Gerai',
10 => '🤩 Puikiai',
default => $rating !== null ? (string) $rating : '',
};
}
}