src/Entity/TerritoireIntervention.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * TerritoireIntervention.
  9. *
  10. * @ORM\Table(name="TerritoireIntervention")
  11. *
  12. * @ORM\Entity
  13. */
  14. class TerritoireIntervention
  15. {
  16. /**
  17. * @var int
  18. *
  19. * @ORM\Column(name="id", type="integer")
  20. *
  21. * @ORM\Id
  22. *
  23. * @ORM\GeneratedValue(strategy="AUTO")
  24. */
  25. private $id;
  26. /**
  27. * @var string
  28. *
  29. * @ORM\Column(name="nom", type="string", length=255)
  30. */
  31. private $nom;
  32. /**
  33. * @ORM\OneToMany(targetEntity="Structure", mappedBy="territoireIntervention")
  34. */
  35. private $structures;
  36. /**
  37. * @ORM\OneToMany(targetEntity="FiltreStructure", mappedBy="territoireIntervention")
  38. */
  39. private $filtreStructures;
  40. /**
  41. * Get id.
  42. *
  43. * @return int
  44. */
  45. public function getId()
  46. {
  47. return $this->id;
  48. }
  49. /**
  50. * Set nom.
  51. *
  52. * @param string $nom
  53. */
  54. public function setNom($nom): static
  55. {
  56. $this->nom = $nom;
  57. return $this;
  58. }
  59. /**
  60. * Get nom.
  61. *
  62. * @return string
  63. */
  64. public function getNom()
  65. {
  66. return $this->nom;
  67. }
  68. /**
  69. * Methode pour afficher le nom.
  70. */
  71. #[\Override]
  72. public function __toString(): string
  73. {
  74. return $this->getNom();
  75. }
  76. /**
  77. * Constructor.
  78. */
  79. public function __construct()
  80. {
  81. $this->structures = new \Doctrine\Common\Collections\ArrayCollection();
  82. $this->filtreStructures = new ArrayCollection();
  83. }
  84. /**
  85. * Add structures.
  86. */
  87. public function addStructure(Structure $structures): static
  88. {
  89. $this->structures[] = $structures;
  90. return $this;
  91. }
  92. /**
  93. * Remove structures.
  94. */
  95. public function removeStructure(Structure $structures): void
  96. {
  97. $this->structures->removeElement($structures);
  98. }
  99. /**
  100. * Get structures.
  101. *
  102. * @return \Doctrine\Common\Collections\Collection
  103. */
  104. public function getStructures()
  105. {
  106. return $this->structures;
  107. }
  108. /**
  109. * Add filtreStructures.
  110. */
  111. public function addFiltreStructure(FiltreStructure $filtreStructures): static
  112. {
  113. $this->filtreStructures[] = $filtreStructures;
  114. return $this;
  115. }
  116. /**
  117. * Remove filtreStructures.
  118. */
  119. public function removeFiltreStructure(FiltreStructure $filtreStructures): void
  120. {
  121. $this->filtreStructures->removeElement($filtreStructures);
  122. }
  123. /**
  124. * Get filtreStructures.
  125. *
  126. * @return \Doctrine\Common\Collections\Collection
  127. */
  128. public function getFiltreStructures()
  129. {
  130. return $this->filtreStructures;
  131. }
  132. }