src/Entity/Membre.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MembreRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=MembreRepository::class)
  9. */
  10. class Membre
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\ManyToOne(targetEntity=Federation::class, inversedBy="membres")
  20. */
  21. private $federation;
  22. /**
  23. * @ORM\OneToOne(targetEntity=User::class, inversedBy="membre", cascade={"persist", "remove"})
  24. */
  25. private $user;
  26. /**
  27. * @ORM\Column(type="date", nullable=true)
  28. */
  29. private $adhesion;
  30. /**
  31. * @ORM\Column(type="string", length=255, nullable=true)
  32. */
  33. private $photo;
  34. /**
  35. * @ORM\OneToMany(targetEntity=Cotisation::class, mappedBy="membre")
  36. */
  37. private $cotisations;
  38. /**
  39. * @ORM\Column(type="boolean", nullable=true)
  40. */
  41. private $cadre;
  42. /**
  43. * @ORM\OneToMany(targetEntity=Transaction::class, mappedBy="membre")
  44. */
  45. private $transactions;
  46. /**
  47. * @ORM\ManyToOne(targetEntity=Commune::class, inversedBy="membres")
  48. */
  49. private $commune;
  50. public function __construct()
  51. {
  52. $this->cotisations = new ArrayCollection();
  53. $this->transactions = new ArrayCollection();
  54. }
  55. public function getId(): ?int
  56. {
  57. return $this->id;
  58. }
  59. public function getFederation(): ?Federation
  60. {
  61. return $this->federation;
  62. }
  63. public function setFederation(?Federation $federation): self
  64. {
  65. $this->federation = $federation;
  66. return $this;
  67. }
  68. public function getUser(): ?User
  69. {
  70. return $this->user;
  71. }
  72. public function setUser(?User $user): self
  73. {
  74. $this->user = $user;
  75. return $this;
  76. }
  77. public function getAdhesion(): ?\DateTimeInterface
  78. {
  79. return $this->adhesion;
  80. }
  81. public function setAdhesion(?\DateTimeInterface $adhesion): self
  82. {
  83. $this->adhesion = $adhesion;
  84. return $this;
  85. }
  86. public function getPhoto(): ?string
  87. {
  88. return $this->photo;
  89. }
  90. public function setPhoto(?string $photo): self
  91. {
  92. $this->photo = $photo;
  93. return $this;
  94. }
  95. /**
  96. * @return Collection<int, Cotisation>
  97. */
  98. public function getCotisations(): Collection
  99. {
  100. return $this->cotisations;
  101. }
  102. public function addCotisation(Cotisation $cotisation): self
  103. {
  104. if (!$this->cotisations->contains($cotisation)) {
  105. $this->cotisations[] = $cotisation;
  106. $cotisation->setMembre($this);
  107. }
  108. return $this;
  109. }
  110. public function removeCotisation(Cotisation $cotisation): self
  111. {
  112. if ($this->cotisations->removeElement($cotisation)) {
  113. // set the owning side to null (unless already changed)
  114. if ($cotisation->getMembre() === $this) {
  115. $cotisation->setMembre(null);
  116. }
  117. }
  118. return $this;
  119. }
  120. public function getCadre(): ?bool
  121. {
  122. return $this->cadre;
  123. }
  124. public function setCadre(?bool $cadre): self
  125. {
  126. $this->cadre = $cadre;
  127. return $this;
  128. }
  129. /**
  130. * @return Collection<int, Transaction>
  131. */
  132. public function getTransactions(): Collection
  133. {
  134. return $this->transactions;
  135. }
  136. public function addTransaction(Transaction $transaction): self
  137. {
  138. if (!$this->transactions->contains($transaction)) {
  139. $this->transactions[] = $transaction;
  140. $transaction->setMembre($this);
  141. }
  142. return $this;
  143. }
  144. public function removeTransaction(Transaction $transaction): self
  145. {
  146. if ($this->transactions->removeElement($transaction)) {
  147. // set the owning side to null (unless already changed)
  148. if ($transaction->getMembre() === $this) {
  149. $transaction->setMembre(null);
  150. }
  151. }
  152. return $this;
  153. }
  154. public function getCommune(): ?Commune
  155. {
  156. return $this->commune;
  157. }
  158. public function setCommune(?Commune $commune): self
  159. {
  160. $this->commune = $commune;
  161. return $this;
  162. }
  163. }