src/Entity/GrandeRegion.php line 19

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