AccessFamilyWish.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\AccessWish;
  4. // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * Famille à laquelle est rattaché un AccessWish.
  10. */
  11. // #[Auditable]
  12. #[ORM\Entity]
  13. class AccessFamilyWish
  14. {
  15. #[ORM\Id]
  16. #[ORM\Column]
  17. #[ORM\GeneratedValue]
  18. private ?int $id = null;
  19. #[ORM\OneToMany(mappedBy: 'accessFamilyWish', targetEntity: AccessWish::class, cascade: ['remove'])]
  20. private Collection $accessWishes;
  21. /**
  22. * Date de dernière mise à jour de l'entité.
  23. */
  24. #[ORM\Column(type: 'datetime', nullable: true)]
  25. private \DateTimeInterface $updateDate;
  26. #[ORM\Column]
  27. private bool $registrationCompleted = false;
  28. #[ORM\Column]
  29. private bool $closeRegistration = false;
  30. public function __construct()
  31. {
  32. $this->accessWishes = new ArrayCollection();
  33. }
  34. public function getId(): ?int
  35. {
  36. return $this->id;
  37. }
  38. /**
  39. * @return Collection<int, AccessWish>
  40. */
  41. public function getAccessWishes(): Collection
  42. {
  43. return $this->accessWishes;
  44. }
  45. public function addAccessWish(AccessWish $accessWish): self
  46. {
  47. if (!$this->accessWishes->contains($accessWish)) {
  48. $this->accessWishes[] = $accessWish;
  49. $accessWish->setAccessFamilyWish($this);
  50. }
  51. return $this;
  52. }
  53. public function removeAccessWish(AccessWish $accessWish): self
  54. {
  55. if ($this->accessWishes->removeElement($accessWish)) {
  56. // set the owning side to null (unless already changed)
  57. if ($accessWish->getAccessFamilyWish() === $this) {
  58. $accessWish->setAccessFamilyWish(null);
  59. }
  60. }
  61. return $this;
  62. }
  63. public function getUpdateDate(): \DateTimeInterface
  64. {
  65. return $this->updateDate;
  66. }
  67. public function setUpdateDate(\DateTimeInterface $updateDate): void
  68. {
  69. $this->updateDate = $updateDate;
  70. }
  71. public function isRegistrationCompleted(): bool
  72. {
  73. return $this->registrationCompleted;
  74. }
  75. public function setRegistrationCompleted(bool $registrationCompleted): void
  76. {
  77. $this->registrationCompleted = $registrationCompleted;
  78. }
  79. public function isCloseRegistration(): bool
  80. {
  81. return $this->closeRegistration;
  82. }
  83. public function setCloseRegistration(bool $closeRegistration): void
  84. {
  85. $this->closeRegistration = $closeRegistration;
  86. }
  87. }