<?php
namespace App\Entity;
use App\Repository\TeacherPaymentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=TeacherPaymentRepository::class)
*/
class TeacherPayment
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"TeacherPaymentList"})
*/
private $id;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"TeacherPaymentList"})
*/
private $dateFor;
/**
* @ORM\Column(type="float", nullable=true)
* @Groups({"TeacherPaymentList"})
*/
private $hours;
/**
* @ORM\Column(type="float", nullable=true)
* @Groups({"TeacherPaymentList"})
*/
private $expectedAmount;
/**
* @ORM\Column(type="float", nullable=true)
* @Groups({"TeacherPaymentList"})
*/
private $amount;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateAdd;
/**
* @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="teacherPayments")
*/
private $teacher;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"TeacherPaymentList"})
*/
private $status;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $surveyBonusAmount;
/**
* @ORM\OneToMany(targetEntity=TeacherPaymentBonus::class, mappedBy="teacherPayment")
*/
private $teacherPaymentBonuses;
public function __construct()
{
$this->dateAdd = new \DateTime();
$this->teacherPaymentBonuses = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDateFor(): ?\DateTimeInterface
{
return $this->dateFor;
}
public function setDateFor(?\DateTimeInterface $dateFor): self
{
$this->dateFor = $dateFor;
return $this;
}
public function getHours(): ?float
{
return $this->hours;
}
public function setHours(?float $hours): self
{
$this->hours = $hours;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(?float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getExpectedAmount(): ?float
{
return $this->expectedAmount;
}
public function setExpectedAmount(?float $expectedAmount): self
{
$this->expectedAmount = $expectedAmount;
return $this;
}
public function getDateAdd(): ?\DateTimeInterface
{
return $this->dateAdd;
}
public function setDateAdd(?\DateTimeInterface $dateAdd): self
{
$this->dateAdd = $dateAdd;
return $this;
}
public function getTeacher(): ?Teacher
{
return $this->teacher;
}
public function setTeacher(?Teacher $teacher): self
{
$this->teacher = $teacher;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getSurveyBonusAmount(): ?float
{
return $this->surveyBonusAmount;
}
public function setSurveyBonusAmount(?float $surveyBonusAmount): self
{
$this->surveyBonusAmount = $surveyBonusAmount;
return $this;
}
/**
* @return Collection<int, TeacherPaymentBonus>
*/
public function getTeacherPaymentBonuses(): Collection
{
return $this->teacherPaymentBonuses;
}
public function addTeacherPaymentBonus(TeacherPaymentBonus $teacherPaymentBonus): self
{
if (!$this->teacherPaymentBonuses->contains($teacherPaymentBonus)) {
$this->teacherPaymentBonuses[] = $teacherPaymentBonus;
$teacherPaymentBonus->setTeacherPayment($this);
}
return $this;
}
public function removeTeacherPaymentBonus(TeacherPaymentBonus $teacherPaymentBonus): self
{
if ($this->teacherPaymentBonuses->removeElement($teacherPaymentBonus)) {
// set the owning side to null (unless already changed)
if ($teacherPaymentBonus->getTeacherPayment() === $this) {
$teacherPaymentBonus->setTeacherPayment(null);
}
}
return $this;
}
}