src/Entity/TeacherPaymentLog.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TeacherPaymentLogRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=TeacherPaymentLogRepository::class)
  7. */
  8. class TeacherPaymentLog
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="teacherPaymentLogs")
  18. */
  19. private $teacher;
  20. /**
  21. * @ORM\ManyToOne(targetEntity=Lesson::class, inversedBy="teacherPaymentLogs")
  22. * @ORM\JoinColumn(name="lesson_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  23. */
  24. private $lesson;
  25. /**
  26. * @ORM\Column(type="float", nullable=true)
  27. */
  28. private $amount;
  29. /**
  30. * @ORM\Column(type="datetime", nullable=true)
  31. */
  32. private $dateAdd;
  33. /**
  34. * @ORM\Column(type="datetime", nullable=true)
  35. */
  36. private $dateFor;
  37. /**
  38. * @ORM\Column(type="text", nullable=true)
  39. */
  40. private $info;
  41. /**
  42. * @ORM\Column(type="integer", nullable=true)
  43. */
  44. private $duration;
  45. /**
  46. * @ORM\Column(type="datetime", nullable=true)
  47. */
  48. private $startTime;
  49. /**
  50. * @ORM\Column(type="datetime", nullable=true)
  51. */
  52. private $endTime;
  53. /**
  54. * @ORM\Column(type="string", length=255, nullable=true)
  55. */
  56. private $status;
  57. /**
  58. * @ORM\Column(type="string", length=255, nullable=true)
  59. */
  60. private $discipline;
  61. /**
  62. * @ORM\Column(type="string", length=255, nullable=true)
  63. */
  64. private $clients;
  65. /**
  66. * @ORM\ManyToOne(targetEntity=LessonDeleted::class)
  67. */
  68. private $lessonDeleted;
  69. public function __construct()
  70. {
  71. $this->dateAdd = new \DateTime();
  72. }
  73. public function getId(): ?int
  74. {
  75. return $this->id;
  76. }
  77. public function getTeacher(): ?Teacher
  78. {
  79. return $this->teacher;
  80. }
  81. public function setTeacher(?Teacher $teacher): self
  82. {
  83. $this->teacher = $teacher;
  84. return $this;
  85. }
  86. public function getLesson(): ?Lesson
  87. {
  88. return $this->lesson;
  89. }
  90. public function setLesson(?Lesson $lesson): self
  91. {
  92. $this->lesson = $lesson;
  93. return $this;
  94. }
  95. public function getAmount(): ?float
  96. {
  97. return $this->amount;
  98. }
  99. public function setAmount(?float $amount): self
  100. {
  101. $this->amount = $amount;
  102. return $this;
  103. }
  104. public function getDateAdd(): ?\DateTimeInterface
  105. {
  106. return $this->dateAdd;
  107. }
  108. public function setDateAdd(?\DateTimeInterface $dateAdd): self
  109. {
  110. $this->dateAdd = $dateAdd;
  111. return $this;
  112. }
  113. public function getDateFor(): ?\DateTimeInterface
  114. {
  115. return $this->dateFor;
  116. }
  117. public function setDateFor(?\DateTimeInterface $dateFor): self
  118. {
  119. $this->dateFor = $dateFor;
  120. return $this;
  121. }
  122. public function getInfo(): ?string
  123. {
  124. return $this->info;
  125. }
  126. public function setInfo(?string $info): self
  127. {
  128. $this->info = $info;
  129. return $this;
  130. }
  131. public function getDuration(): ?int
  132. {
  133. return $this->duration;
  134. }
  135. public function setDuration(?int $duration): self
  136. {
  137. $this->duration = $duration;
  138. return $this;
  139. }
  140. public function getStartTime(): ?\DateTimeInterface
  141. {
  142. return $this->startTime;
  143. }
  144. public function setStartTime(?\DateTimeInterface $startTime): self
  145. {
  146. $this->startTime = $startTime;
  147. return $this;
  148. }
  149. public function getEndTime(): ?\DateTimeInterface
  150. {
  151. return $this->endTime;
  152. }
  153. public function setEndTime(?\DateTimeInterface $endTime): self
  154. {
  155. $this->endTime = $endTime;
  156. return $this;
  157. }
  158. public function getStatus(): ?string
  159. {
  160. $text = $this->status;
  161. foreach (Lesson::STATUSES as $STATUS)
  162. {
  163. if($STATUS['value'] == $this->status)
  164. {
  165. $text = $STATUS['text'];
  166. }
  167. }
  168. return $text;
  169. }
  170. public function setStatus(?string $status): self
  171. {
  172. foreach (Lesson::STATUSES as $STATUS)
  173. {
  174. if($STATUS['text'] == $status)
  175. {
  176. $status = $STATUS['value'];
  177. }
  178. }
  179. $this->status = $status;
  180. return $this;
  181. }
  182. public function getDisciplineFull(): ?string
  183. {
  184. $disciplines = ['MAT' => 'Matematika',
  185. 'LT' => 'Lietuvių k.',
  186. 'ANG' => 'Anglu k.',
  187. 'FIZ' => 'Fizika',
  188. 'CHE' => 'Chemija',
  189. 'BIO' => 'Biologija',
  190. 'IST' => 'Istorija',
  191. 'IT' => 'Informatika',
  192. 'VOK' => 'Vokiečių k.',
  193. 'FRA' => 'Prancūzų k.',
  194. 'RU' => 'Rusų k.',
  195. 'GEO' => 'Geografija',
  196. 'ISP' => 'Ispanų k.',
  197. ];
  198. if (isset($disciplines[$this->discipline])) {
  199. return $disciplines[$this->discipline];
  200. }
  201. return $this->discipline;
  202. }
  203. public function getDiscipline(): ?string
  204. {
  205. return $this->discipline;
  206. }
  207. public function setDiscipline(?string $discipline): self
  208. {
  209. $this->discipline = $discipline;
  210. return $this;
  211. }
  212. public function getClients(): ?string
  213. {
  214. return $this->clients;
  215. }
  216. public function setClients(?string $clients): self
  217. {
  218. $this->clients = $clients;
  219. return $this;
  220. }
  221. public function getStatusColor(): ?string
  222. {
  223. $color = "";
  224. foreach (Lesson::ALL_STATUSES as $STATUS)
  225. {
  226. if($STATUS['value'] == $this->status)
  227. {
  228. $color = $STATUS['color'];
  229. }
  230. }
  231. return $color;
  232. }
  233. public function getLessonDeleted(): ?LessonDeleted
  234. {
  235. return $this->lessonDeleted;
  236. }
  237. public function setLessonDeleted(?LessonDeleted $lessonDeleted): self
  238. {
  239. $this->lessonDeleted = $lessonDeleted;
  240. return $this;
  241. }
  242. }