src/Entity/TeacherPayment.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TeacherPaymentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9. * @ORM\Entity(repositoryClass=TeacherPaymentRepository::class)
  10. */
  11. class TeacherPayment
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue
  16. * @ORM\Column(type="integer")
  17. * @Groups({"TeacherPaymentList"})
  18. */
  19. private $id;
  20. /**
  21. * @ORM\Column(type="datetime", nullable=true)
  22. * @Groups({"TeacherPaymentList"})
  23. */
  24. private $dateFor;
  25. /**
  26. * @ORM\Column(type="float", nullable=true)
  27. * @Groups({"TeacherPaymentList"})
  28. */
  29. private $hours;
  30. /**
  31. * @ORM\Column(type="float", nullable=true)
  32. * @Groups({"TeacherPaymentList"})
  33. */
  34. private $expectedAmount;
  35. /**
  36. * @ORM\Column(type="float", nullable=true)
  37. * @Groups({"TeacherPaymentList"})
  38. */
  39. private $amount;
  40. /**
  41. * @ORM\Column(type="datetime", nullable=true)
  42. */
  43. private $dateAdd;
  44. /**
  45. * @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="teacherPayments")
  46. */
  47. private $teacher;
  48. /**
  49. * @ORM\Column(type="string", length=255, nullable=true)
  50. * @Groups({"TeacherPaymentList"})
  51. */
  52. private $status;
  53. /**
  54. * @ORM\Column(type="float", nullable=true)
  55. */
  56. private $surveyBonusAmount;
  57. /**
  58. * @ORM\OneToMany(targetEntity=TeacherPaymentBonus::class, mappedBy="teacherPayment")
  59. */
  60. private $teacherPaymentBonuses;
  61. public function __construct()
  62. {
  63. $this->dateAdd = new \DateTime();
  64. $this->teacherPaymentBonuses = new ArrayCollection();
  65. }
  66. public function getId(): ?int
  67. {
  68. return $this->id;
  69. }
  70. public function getDateFor(): ?\DateTimeInterface
  71. {
  72. return $this->dateFor;
  73. }
  74. public function setDateFor(?\DateTimeInterface $dateFor): self
  75. {
  76. $this->dateFor = $dateFor;
  77. return $this;
  78. }
  79. public function getHours(): ?float
  80. {
  81. return $this->hours;
  82. }
  83. public function setHours(?float $hours): self
  84. {
  85. $this->hours = $hours;
  86. return $this;
  87. }
  88. public function getAmount(): ?float
  89. {
  90. return $this->amount;
  91. }
  92. public function setAmount(?float $amount): self
  93. {
  94. $this->amount = $amount;
  95. return $this;
  96. }
  97. public function getExpectedAmount(): ?float
  98. {
  99. return $this->expectedAmount;
  100. }
  101. public function setExpectedAmount(?float $expectedAmount): self
  102. {
  103. $this->expectedAmount = $expectedAmount;
  104. return $this;
  105. }
  106. public function getDateAdd(): ?\DateTimeInterface
  107. {
  108. return $this->dateAdd;
  109. }
  110. public function setDateAdd(?\DateTimeInterface $dateAdd): self
  111. {
  112. $this->dateAdd = $dateAdd;
  113. return $this;
  114. }
  115. public function getTeacher(): ?Teacher
  116. {
  117. return $this->teacher;
  118. }
  119. public function setTeacher(?Teacher $teacher): self
  120. {
  121. $this->teacher = $teacher;
  122. return $this;
  123. }
  124. public function getStatus(): ?string
  125. {
  126. return $this->status;
  127. }
  128. public function setStatus(?string $status): self
  129. {
  130. $this->status = $status;
  131. return $this;
  132. }
  133. public function getSurveyBonusAmount(): ?float
  134. {
  135. return $this->surveyBonusAmount;
  136. }
  137. public function setSurveyBonusAmount(?float $surveyBonusAmount): self
  138. {
  139. $this->surveyBonusAmount = $surveyBonusAmount;
  140. return $this;
  141. }
  142. /**
  143. * @return Collection<int, TeacherPaymentBonus>
  144. */
  145. public function getTeacherPaymentBonuses(): Collection
  146. {
  147. return $this->teacherPaymentBonuses;
  148. }
  149. public function addTeacherPaymentBonus(TeacherPaymentBonus $teacherPaymentBonus): self
  150. {
  151. if (!$this->teacherPaymentBonuses->contains($teacherPaymentBonus)) {
  152. $this->teacherPaymentBonuses[] = $teacherPaymentBonus;
  153. $teacherPaymentBonus->setTeacherPayment($this);
  154. }
  155. return $this;
  156. }
  157. public function removeTeacherPaymentBonus(TeacherPaymentBonus $teacherPaymentBonus): self
  158. {
  159. if ($this->teacherPaymentBonuses->removeElement($teacherPaymentBonus)) {
  160. // set the owning side to null (unless already changed)
  161. if ($teacherPaymentBonus->getTeacherPayment() === $this) {
  162. $teacherPaymentBonus->setTeacherPayment(null);
  163. }
  164. }
  165. return $this;
  166. }
  167. }