src/Entity/EventLog.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EventLogRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: EventLogRepository::class)]
  6. class EventLog
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column(type: 'integer')]
  11. private $id;
  12. #[ORM\ManyToOne(targetEntity: Distributors::class, inversedBy: 'eventLogs')]
  13. private $distributor;
  14. #[ORM\ManyToOne(targetEntity: Clinics::class, inversedBy: 'eventLogs')]
  15. private $clinic;
  16. #[ORM\ManyToOne(targetEntity: Orders::class, inversedBy: 'eventLogs')]
  17. private $orders;
  18. #[ORM\ManyToOne(targetEntity: Status::class, inversedBy: 'eventLogs')]
  19. private $status;
  20. #[ORM\Column(type: 'datetime')]
  21. private $modified;
  22. #[ORM\Column(type: 'datetime')]
  23. private $created;
  24. public function __construct()
  25. {
  26. $date = new \DateTime("now", new \DateTimeZone('Asia/Dubai'));
  27. $this->setModified($date);
  28. if ($this->getCreated() == null)
  29. {
  30. $this->setCreated($date);
  31. }
  32. }
  33. public function getId(): ?int
  34. {
  35. return $this->id;
  36. }
  37. public function getDistributor(): ?Distributors
  38. {
  39. return $this->distributor;
  40. }
  41. public function setDistributor(?Distributors $distributor): self
  42. {
  43. $this->distributor = $distributor;
  44. return $this;
  45. }
  46. public function getClinic(): ?Clinics
  47. {
  48. return $this->clinic;
  49. }
  50. public function setClinic(?Clinics $clinic): self
  51. {
  52. $this->clinic = $clinic;
  53. return $this;
  54. }
  55. public function getOrders(): ?Orders
  56. {
  57. return $this->orders;
  58. }
  59. public function setOrders(?Orders $orders): self
  60. {
  61. $this->orders = $orders;
  62. return $this;
  63. }
  64. public function getStatus(): ?Status
  65. {
  66. return $this->status;
  67. }
  68. public function setStatus(?Status $status): self
  69. {
  70. $this->status = $status;
  71. return $this;
  72. }
  73. public function getModified(): ?\DateTimeInterface
  74. {
  75. return $this->modified;
  76. }
  77. public function setModified(\DateTimeInterface $modified): self
  78. {
  79. $this->modified = $modified;
  80. return $this;
  81. }
  82. public function getCreated(): ?\DateTimeInterface
  83. {
  84. return $this->created;
  85. }
  86. public function setCreated(\DateTimeInterface $created): self
  87. {
  88. $this->created = $created;
  89. return $this;
  90. }
  91. }