src/Entity/PriceChange.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PriceChangeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7. * @ORM\Entity(repositoryClass=PriceChangeRepository::class)
  8. */
  9. class PriceChange
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. * @Groups({"GuardianPriceChangesEdit"})
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="datetime", nullable=true)
  20. * @Groups({"GuardianPriceChangesEdit"})
  21. */
  22. private $dateFrom;
  23. /**
  24. * @ORM\Column(type="float", nullable=true)
  25. * @Groups({"GuardianPriceChangesEdit"})
  26. */
  27. private $value;
  28. /**
  29. * @ORM\Column(type="datetime", nullable=true)
  30. */
  31. private $createdAt;
  32. /**
  33. * @ORM\ManyToOne(targetEntity=Guardian::class, inversedBy="priceChanges")
  34. */
  35. private $guardian;
  36. public function __construct()
  37. {
  38. $this->createdAt = new \DateTime();
  39. }
  40. public function getId(): ?int
  41. {
  42. return $this->id;
  43. }
  44. public function getDateFrom(): ?\DateTimeInterface
  45. {
  46. return $this->dateFrom;
  47. }
  48. public function setDateFrom(?\DateTimeInterface $dateFrom): self
  49. {
  50. $this->dateFrom = $dateFrom;
  51. return $this;
  52. }
  53. public function getValue(): ?float
  54. {
  55. return $this->value;
  56. }
  57. public function setValue(?float $value): self
  58. {
  59. $this->value = $value;
  60. return $this;
  61. }
  62. public function getCreatedAt(): ?\DateTimeImmutable
  63. {
  64. return $this->createdAt;
  65. }
  66. public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  67. {
  68. $this->createdAt = $createdAt;
  69. return $this;
  70. }
  71. public function getGuardian(): ?Guardian
  72. {
  73. return $this->guardian;
  74. }
  75. public function setGuardian(?Guardian $guardian): self
  76. {
  77. $this->guardian = $guardian;
  78. return $this;
  79. }
  80. }