src/Entity/AppelSujet.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AppelSujetRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Table(name="appelSujet")
  9. * @ORM\Entity(repositoryClass=AppelSujetRepository::class)
  10. */
  11. class AppelSujet
  12. {
  13. /**
  14. * @ORM\Id()
  15. * @ORM\GeneratedValue()
  16. * @ORM\Column(type="integer")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\OneToMany(targetEntity=Appel::class, mappedBy="sujet")
  21. */
  22. private $appels;
  23. /**
  24. * @ORM\Column(type="string", length=100)
  25. */
  26. private $name;
  27. /**
  28. * @ORM\OneToMany(targetEntity=Rdv::class, mappedBy="sujet")
  29. */
  30. private $rdvs;
  31. /**
  32. * @ORM\Column(type="string", length=100, nullable=true)
  33. */
  34. private $role;
  35. public function __construct()
  36. {
  37. $this->appels = new ArrayCollection();
  38. $this->rdvs = new ArrayCollection();
  39. }
  40. public function getId(): ?int
  41. {
  42. return $this->id;
  43. }
  44. /**
  45. * @return Collection|Appel[]
  46. */
  47. public function getAppels(): Collection
  48. {
  49. return $this->appels;
  50. }
  51. public function addAppel(Appel $appel): self
  52. {
  53. if (!$this->appels->contains($appel)) {
  54. $this->appels[] = $appel;
  55. $appel->setSujet($this);
  56. }
  57. return $this;
  58. }
  59. public function removeAppel(Appel $appel): self
  60. {
  61. if ($this->appels->contains($appel)) {
  62. $this->appels->removeElement($appel);
  63. // set the owning side to null (unless already changed)
  64. if ($appel->getSujet() === $this) {
  65. $appel->setSujet(null);
  66. }
  67. }
  68. return $this;
  69. }
  70. public function getName(): ?string
  71. {
  72. return $this->name;
  73. }
  74. public function setName(string $name): self
  75. {
  76. $this->name = $name;
  77. return $this;
  78. }
  79. /**
  80. * @return Collection|Rdv[]
  81. */
  82. public function getRdvs(): Collection
  83. {
  84. return $this->rdvs;
  85. }
  86. public function addRdv(Rdv $rdv): self
  87. {
  88. if (!$this->rdvs->contains($rdv)) {
  89. $this->rdvs[] = $rdv;
  90. $rdv->setSujet($this);
  91. }
  92. return $this;
  93. }
  94. public function removeRdv(Rdv $rdv): self
  95. {
  96. if ($this->rdvs->contains($rdv)) {
  97. $this->rdvs->removeElement($rdv);
  98. // set the owning side to null (unless already changed)
  99. if ($rdv->getSujet() === $this) {
  100. $rdv->setSujet(null);
  101. }
  102. }
  103. return $this;
  104. }
  105. public function getRole(): ?string
  106. {
  107. return $this->role;
  108. }
  109. public function setRole(?string $role): self
  110. {
  111. $this->role = $role;
  112. return $this;
  113. }
  114. }