src/Entity/ActionCulturelle.php line 19

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\ActionCulturelleRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * ActionCulturelle.
  10. *
  11. * @ORM\Table(name="ActionCulturelle")
  12. *
  13. * @ORM\Entity(repositoryClass=ActionCulturelleRepository::class)
  14. */
  15. class ActionCulturelle
  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="Action", mappedBy="actionCulturelle")
  35. */
  36. private $actions;
  37. #[\Override]
  38. public function __toString(): string
  39. {
  40. return $this->nom;
  41. }
  42. /**
  43. * Get id.
  44. *
  45. * @return int
  46. */
  47. public function getId()
  48. {
  49. return $this->id;
  50. }
  51. /**
  52. * Set nom.
  53. *
  54. * @param string $nom
  55. */
  56. public function setNom($nom): static
  57. {
  58. $this->nom = $nom;
  59. return $this;
  60. }
  61. /**
  62. * Get nom.
  63. *
  64. * @return string
  65. */
  66. public function getNom()
  67. {
  68. return $this->nom;
  69. }
  70. /**
  71. * Constructor.
  72. */
  73. public function __construct()
  74. {
  75. $this->actions = new \Doctrine\Common\Collections\ArrayCollection();
  76. }
  77. /**
  78. * Add actions.
  79. */
  80. public function addAction(Action $actions): static
  81. {
  82. $this->actions[] = $actions;
  83. return $this;
  84. }
  85. /**
  86. * Remove actions.
  87. */
  88. public function removeAction(Action $actions): void
  89. {
  90. $this->actions->removeElement($actions);
  91. }
  92. /**
  93. * Get actions.
  94. *
  95. * @return \Doctrine\Common\Collections\Collection
  96. */
  97. public function getActions()
  98. {
  99. return $this->actions;
  100. }
  101. }