src/Entity/Saison.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SaisonRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=SaisonRepository::class)
  9. */
  10. class Saison
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=255)
  20. */
  21. private $title;
  22. /**
  23. * @ORM\ManyToMany(targetEntity=Sejour::class, mappedBy="saisons")
  24. */
  25. private $sejours;
  26. /**
  27. * @ORM\OneToMany(targetEntity=Media::class, mappedBy="saison")
  28. */
  29. private $medias;
  30. /**
  31. * @ORM\Column(type="string", length=100)
  32. */
  33. private $slug;
  34. /**
  35. * @ORM\Column(type="string", length=10, nullable=true)
  36. */
  37. private $anneeAffichee;
  38. /**
  39. * @ORM\Column(type="text", nullable=true)
  40. */
  41. private $topDescription;
  42. /**
  43. * @ORM\Column(type="text")
  44. */
  45. private $bottomDescription;
  46. /**
  47. * @ORM\Column(type="boolean")
  48. */
  49. private $isActive;
  50. public function __construct()
  51. {
  52. $this->sejours = new ArrayCollection();
  53. $this->medias = new ArrayCollection();
  54. }
  55. public function getId(): ?int
  56. {
  57. return $this->id;
  58. }
  59. public function getTitle(): ?string
  60. {
  61. return $this->title;
  62. }
  63. public function setTitle(string $name): self
  64. {
  65. $this->title = $name;
  66. return $this;
  67. }
  68. /**
  69. * @return Collection|Sejour[]
  70. */
  71. public function getSejours(): Collection
  72. {
  73. return $this->sejours;
  74. }
  75. public function addSejour(Sejour $sejour): self
  76. {
  77. if (!$this->sejours->contains($sejour)) {
  78. $this->sejours[] = $sejour;
  79. $sejour->addSaison($this);
  80. }
  81. return $this;
  82. }
  83. public function removeSejour(Sejour $sejour): self
  84. {
  85. if ($this->sejours->removeElement($sejour)) {
  86. $sejour->removeSaison($this);
  87. }
  88. return $this;
  89. }
  90. /**
  91. * @return Collection|Media[]
  92. */
  93. public function getMedias(): Collection
  94. {
  95. return $this->medias;
  96. }
  97. public function addMedia(Media $media): self
  98. {
  99. if (!$this->medias->contains($media)) {
  100. $this->medias[] = $media;
  101. $media->setSaison($this);
  102. }
  103. return $this;
  104. }
  105. public function removeMedia(Media $media): self
  106. {
  107. if ($this->medias->removeElement($media)) {
  108. // set the owning side to null (unless already changed)
  109. if ($media->getSaison() === $this) {
  110. $media->setSaison(null);
  111. }
  112. }
  113. return $this;
  114. }
  115. public function getSlug(): ?string
  116. {
  117. return $this->slug;
  118. }
  119. public function setSlug(string $slug): self
  120. {
  121. $this->slug = $slug;
  122. return $this;
  123. }
  124. public function getAnneeAffichee(): ?string
  125. {
  126. return $this->anneeAffichee;
  127. }
  128. public function setAnneeAffichee(?string $anneeAffichee): self
  129. {
  130. $this->anneeAffichee = $anneeAffichee;
  131. return $this;
  132. }
  133. public function getTopDescription(): ?string
  134. {
  135. return $this->topDescription;
  136. }
  137. public function setTopDescription(?string $topDescription): self
  138. {
  139. $this->topDescription = $topDescription;
  140. return $this;
  141. }
  142. public function getBottomDescription(): ?string
  143. {
  144. return $this->bottomDescription;
  145. }
  146. public function setBottomDescription(string $bottomDescription): self
  147. {
  148. $this->bottomDescription = $bottomDescription;
  149. return $this;
  150. }
  151. public function getIsActive(): ?bool
  152. {
  153. return $this->isActive;
  154. }
  155. public function setIsActive(bool $isActive): self
  156. {
  157. $this->isActive = $isActive;
  158. return $this;
  159. }
  160. }