src/Entity/TeacherPriceChange.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TeacherPriceChangeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7. * @ORM\Entity(repositoryClass=TeacherPriceChangeRepository::class)
  8. */
  9. class TeacherPriceChange
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. * @Groups({"TeacherPriceChangesEdit"})
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="datetime", nullable=true)
  20. * @Groups({"TeacherPriceChangesEdit"})
  21. */
  22. private $dateFrom;
  23. /**
  24. * @ORM\Column(type="float", nullable=true)
  25. * @Groups({"TeacherPriceChangesEdit"})
  26. */
  27. private $value;
  28. /**
  29. * @ORM\Column(type="datetime", nullable=true)
  30. */
  31. private $createdAt;
  32. /**
  33. * @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="teacherPriceChanges")
  34. */
  35. private $teacher;
  36. /**
  37. * @ORM\Column(type="boolean", nullable=true)
  38. */
  39. private $manual = true;
  40. /**
  41. * @ORM\Column(type="boolean", nullable=true)
  42. * @Groups({"TeacherPriceChangesEdit"})
  43. */
  44. private $reset;
  45. public function __construct()
  46. {
  47. $this->createdAt = new \DateTime();
  48. }
  49. public function getId(): ?int
  50. {
  51. return $this->id;
  52. }
  53. public function getDateFrom(): ?\DateTimeInterface
  54. {
  55. return $this->dateFrom;
  56. }
  57. public function setDateFrom(?\DateTimeInterface $dateFrom): self
  58. {
  59. $this->dateFrom = $dateFrom;
  60. return $this;
  61. }
  62. public function getValue(): ?float
  63. {
  64. return $this->value;
  65. }
  66. public function setValue(?float $value): self
  67. {
  68. $this->value = $value;
  69. return $this;
  70. }
  71. public function getCreatedAt(): ?\DateTimeInterface
  72. {
  73. return $this->createdAt;
  74. }
  75. public function setCreatedAt(?\DateTimeInterface $createdAt): self
  76. {
  77. $this->createdAt = $createdAt;
  78. return $this;
  79. }
  80. public function getTeacher(): ?Teacher
  81. {
  82. return $this->teacher;
  83. }
  84. public function setTeacher(?Teacher $teacher): self
  85. {
  86. $this->teacher = $teacher;
  87. return $this;
  88. }
  89. public function getManual(): ?bool
  90. {
  91. return $this->manual;
  92. }
  93. public function setManual(?bool $manual): self
  94. {
  95. $this->manual = $manual;
  96. return $this;
  97. }
  98. public function getReset(): ?bool
  99. {
  100. return $this->reset;
  101. }
  102. public function setReset($reset): self
  103. {
  104. if (is_string($reset)) {
  105. if ($reset == "yes")
  106. $this->reset = 1;
  107. else {
  108. $this->reset = 0;
  109. }
  110. }
  111. else{
  112. $this->reset = $reset;
  113. }
  114. return $this;
  115. }
  116. }