src/Entity/Agrement.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. * Agrement.
  9. *
  10. * @ORM\Table(name="Agrement")
  11. *
  12. * @ORM\Entity
  13. */
  14. class Agrement
  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="agrement")
  34. */
  35. private $structures;
  36. /**
  37. * @ORM\OneToMany(targetEntity="FiltreStructure", mappedBy="agrement")
  38. */
  39. private $filtreStructures;
  40. /**
  41. * Get id.
  42. *
  43. * @return int
  44. */
  45. public function getId()
  46. {
  47. return $this->id;
  48. }
  49. #[\Override]
  50. public function __toString(): string
  51. {
  52. return $this->nom;
  53. }
  54. /**
  55. * Set nom.
  56. *
  57. * @param string $nom
  58. */
  59. public function setNom($nom): static
  60. {
  61. $this->nom = $nom;
  62. return $this;
  63. }
  64. /**
  65. * Get nom.
  66. *
  67. * @return string
  68. */
  69. public function getNom()
  70. {
  71. return $this->nom;
  72. }
  73. /**
  74. * Constructor.
  75. */
  76. public function __construct()
  77. {
  78. $this->structures = new \Doctrine\Common\Collections\ArrayCollection();
  79. $this->filtreStructures = new ArrayCollection();
  80. }
  81. /**
  82. * Add structures.
  83. */
  84. public function addStructure(Structure $structures): static
  85. {
  86. $this->structures[] = $structures;
  87. return $this;
  88. }
  89. /**
  90. * Remove structures.
  91. */
  92. public function removeStructure(Structure $structures): void
  93. {
  94. $this->structures->removeElement($structures);
  95. }
  96. /**
  97. * Get structures.
  98. *
  99. * @return \Doctrine\Common\Collections\Collection
  100. */
  101. public function getStructures()
  102. {
  103. return $this->structures;
  104. }
  105. /**
  106. * Add filtreStructures.
  107. */
  108. public function addFiltreStructure(FiltreStructure $filtreStructures): static
  109. {
  110. $this->filtreStructures[] = $filtreStructures;
  111. return $this;
  112. }
  113. /**
  114. * Remove filtreStructures.
  115. */
  116. public function removeFiltreStructure(FiltreStructure $filtreStructures): void
  117. {
  118. $this->filtreStructures->removeElement($filtreStructures);
  119. }
  120. /**
  121. * Get filtreStructures.
  122. *
  123. * @return \Doctrine\Common\Collections\Collection
  124. */
  125. public function getFiltreStructures()
  126. {
  127. return $this->filtreStructures;
  128. }
  129. }