src/Entity/AgrementDuree.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. * AgrementDuree.
  9. *
  10. * @ORM\Table(name="AgrementDuree")
  11. *
  12. * @ORM\Entity
  13. */
  14. class AgrementDuree
  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="agrementDuree")
  34. */
  35. private $structures;
  36. #[\Override]
  37. public function __toString(): string
  38. {
  39. return ''.$this->nom;
  40. }
  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->structures = new \Doctrine\Common\Collections\ArrayCollection();
  75. }
  76. /**
  77. * Add structures.
  78. */
  79. public function addStructure(Structure $structures): static
  80. {
  81. $this->structures[] = $structures;
  82. return $this;
  83. }
  84. /**
  85. * Remove structures.
  86. */
  87. public function removeStructure(Structure $structures): void
  88. {
  89. $this->structures->removeElement($structures);
  90. }
  91. /**
  92. * Get structures.
  93. *
  94. * @return \Doctrine\Common\Collections\Collection
  95. */
  96. public function getStructures()
  97. {
  98. return $this->structures;
  99. }
  100. }