src/Entity/Actualite.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ActualiteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ActualiteRepository::class)
  9. */
  10. class Actualite
  11. {
  12. /**
  13. * @ORM\Id()
  14. * @ORM\GeneratedValue()
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\ManyToOne(targetEntity=Utilisateur::class, inversedBy="actualites")
  20. * @ORM\JoinColumn(nullable=false,name="createur")
  21. */
  22. private $createur;
  23. /**
  24. * @ORM\Column(type="string", length=255)
  25. */
  26. private $description;
  27. /**
  28. * @ORM\Column(type="string", length=255)
  29. */
  30. private $pathShow;
  31. /**
  32. * @ORM\Column(type="string", length=255)
  33. */
  34. private $date;
  35. /**
  36. * @ORM\Column(type="integer")
  37. */
  38. private $idCreature;
  39. /**
  40. * @ORM\OneToMany(targetEntity=Suivi::class, mappedBy="actualite")
  41. */
  42. private $suivis;
  43. public function __construct()
  44. {
  45. $this->suivis = new ArrayCollection();
  46. }
  47. public function getId(): ?int
  48. {
  49. return $this->id;
  50. }
  51. public function getCreateur(): ?Utilisateur
  52. {
  53. return $this->createur;
  54. }
  55. public function setCreateur(?Utilisateur $createur): self
  56. {
  57. $this->createur = $createur;
  58. return $this;
  59. }
  60. public function getDescription(): ?string
  61. {
  62. return $this->description;
  63. }
  64. public function setDescription(string $description): self
  65. {
  66. $this->description = $description;
  67. return $this;
  68. }
  69. public function getPathShow(): ?string
  70. {
  71. return $this->pathShow;
  72. }
  73. public function setPathShow(string $pathShow): self
  74. {
  75. $this->pathShow = $pathShow;
  76. return $this;
  77. }
  78. public function getDate(): ?string
  79. {
  80. return $this->date;
  81. }
  82. public function setDate(string $date): self
  83. {
  84. $this->date = $date;
  85. return $this;
  86. }
  87. public function getIdCreature(): ?int
  88. {
  89. return $this->idCreature;
  90. }
  91. public function setIdCreature(int $idCreature): self
  92. {
  93. $this->idCreature = $idCreature;
  94. return $this;
  95. }
  96. /**
  97. * @return Collection|Suivi[]
  98. */
  99. public function getSuivis(): Collection
  100. {
  101. return $this->suivis;
  102. }
  103. public function addSuivi(Suivi $suivi): self
  104. {
  105. if (!$this->suivis->contains($suivi)) {
  106. $this->suivis[] = $suivi;
  107. $suivi->setActualite($this);
  108. }
  109. return $this;
  110. }
  111. public function removeSuivi(Suivi $suivi): self
  112. {
  113. if ($this->suivis->contains($suivi)) {
  114. $this->suivis->removeElement($suivi);
  115. // set the owning side to null (unless already changed)
  116. if ($suivi->getActualite() === $this) {
  117. $suivi->setActualite(null);
  118. }
  119. }
  120. return $this;
  121. }
  122. }