Period.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PeriodRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: PeriodRepository::class)]
  6. class Period
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column]
  11. private ?int $id = null;
  12. #[ORM\Column]
  13. private ?\DateTime $startOn = null;
  14. #[ORM\Column]
  15. private ?\DateTime $endOn = null;
  16. #[ORM\ManyToOne(inversedBy: 'periods')]
  17. #[ORM\JoinColumn(nullable: false)]
  18. private ?Event $event = null;
  19. #[ORM\Column(nullable: true)]
  20. private ?bool $locked = null;
  21. public function getId(): ?int
  22. {
  23. return $this->id;
  24. }
  25. public function getStartOn(): ?\DateTime
  26. {
  27. return $this->startOn;
  28. }
  29. public function setStartOn(\DateTime $startOn): static
  30. {
  31. $this->startOn = $startOn;
  32. return $this;
  33. }
  34. public function getEndOn(): ?\DateTime
  35. {
  36. return $this->endOn;
  37. }
  38. public function setEndOn(\DateTime $endOn): static
  39. {
  40. $this->endOn = $endOn;
  41. return $this;
  42. }
  43. public function getEvent(): ?Event
  44. {
  45. return $this->event;
  46. }
  47. public function setEvent(?Event $event): static
  48. {
  49. $this->event = $event;
  50. return $this;
  51. }
  52. public function isLocked(): ?bool
  53. {
  54. return $this->locked;
  55. }
  56. public function setLocked(?bool $locked): static
  57. {
  58. $this->locked = $locked;
  59. return $this;
  60. }
  61. }