src/Entity/Tarea.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Core\Entity\Color;
  4. use App\Repository\TareaRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * @ORM\Entity(repositoryClass=TareaRepository::class)
  10. */
  11. class Tarea
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue
  16. * @ORM\Column(type="integer")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\Column(type="string", length=255)
  21. */
  22. private $nombre;
  23. /**
  24. * @ORM\Column(type="text", nullable=true)
  25. */
  26. private $descripcion;
  27. /**
  28. * @ORM\OneToMany(targetEntity=TareasCurso::class, mappedBy="tarea")
  29. */
  30. private $tareasCursos;
  31. /**
  32. * @ORM\Column(type="text", nullable=true)
  33. */
  34. private $link;
  35. /**
  36. * @ORM\OneToMany(targetEntity=TareaArchivo::class, mappedBy="tarea")
  37. */
  38. private $tareaArchivos;
  39. /**
  40. * @ORM\ManyToOne(targetEntity=Color::class)
  41. */
  42. private $color;
  43. /**
  44. * @ORM\OneToMany(targetEntity=TareaEstudiante::class, mappedBy="tarea")
  45. */
  46. private $tareaEstudiantes;
  47. public function __construct()
  48. {
  49. $this->tareasCursos = new ArrayCollection();
  50. $this->tareaArchivos = new ArrayCollection();
  51. $this->tareaEstudiantes = new ArrayCollection();
  52. }
  53. public function getId(): ?int
  54. {
  55. return $this->id;
  56. }
  57. public function getNombre(): ?string
  58. {
  59. return $this->nombre;
  60. }
  61. public function setNombre(string $nombre): self
  62. {
  63. $this->nombre = $nombre;
  64. return $this;
  65. }
  66. public function getDescripcion(): ?string
  67. {
  68. return $this->descripcion;
  69. }
  70. public function setDescripcion(string $descripcion): self
  71. {
  72. $this->descripcion = $descripcion;
  73. return $this;
  74. }
  75. /**
  76. * @return Collection<int, TareasCurso>
  77. */
  78. public function getTareasCursos(): Collection
  79. {
  80. return $this->tareasCursos;
  81. }
  82. public function addTareasCurso(TareasCurso $tareasCurso): self
  83. {
  84. if (!$this->tareasCursos->contains($tareasCurso)) {
  85. $this->tareasCursos[] = $tareasCurso;
  86. $tareasCurso->setTarea($this);
  87. }
  88. return $this;
  89. }
  90. public function removeTareasCurso(TareasCurso $tareasCurso): self
  91. {
  92. if ($this->tareasCursos->removeElement($tareasCurso)) {
  93. // set the owning side to null (unless already changed)
  94. if ($tareasCurso->getTarea() === $this) {
  95. $tareasCurso->setTarea(null);
  96. }
  97. }
  98. return $this;
  99. }
  100. public function getLink(): ?string
  101. {
  102. return $this->link;
  103. }
  104. public function setLink(?string $link): self
  105. {
  106. $this->link = $link;
  107. return $this;
  108. }
  109. /**
  110. * @return Collection<int, TareaArchivo>
  111. */
  112. public function getTareaArchivos(): Collection
  113. {
  114. return $this->tareaArchivos;
  115. }
  116. public function addTareaArchivo(TareaArchivo $tareaArchivo): self
  117. {
  118. if (!$this->tareaArchivos->contains($tareaArchivo)) {
  119. $this->tareaArchivos[] = $tareaArchivo;
  120. $tareaArchivo->setTarea($this);
  121. }
  122. return $this;
  123. }
  124. public function removeTareaArchivo(TareaArchivo $tareaArchivo): self
  125. {
  126. if ($this->tareaArchivos->removeElement($tareaArchivo)) {
  127. // set the owning side to null (unless already changed)
  128. if ($tareaArchivo->getTarea() === $this) {
  129. $tareaArchivo->setTarea(null);
  130. }
  131. }
  132. return $this;
  133. }
  134. public function getColor(): ?Color
  135. {
  136. return $this->color;
  137. }
  138. public function setColor(?Color $color): self
  139. {
  140. $this->color = $color;
  141. return $this;
  142. }
  143. /**
  144. * @return Collection<int, TareaEstudiante>
  145. */
  146. public function getTareaEstudiantes(): Collection
  147. {
  148. return $this->tareaEstudiantes;
  149. }
  150. public function addTareaEstudiante(TareaEstudiante $tareaEstudiante): self
  151. {
  152. if (!$this->tareaEstudiantes->contains($tareaEstudiante)) {
  153. $this->tareaEstudiantes[] = $tareaEstudiante;
  154. $tareaEstudiante->setTarea($this);
  155. }
  156. return $this;
  157. }
  158. public function removeTareaEstudiante(TareaEstudiante $tareaEstudiante): self
  159. {
  160. if ($this->tareaEstudiantes->removeElement($tareaEstudiante)) {
  161. // set the owning side to null (unless already changed)
  162. if ($tareaEstudiante->getTarea() === $this) {
  163. $tareaEstudiante->setTarea(null);
  164. }
  165. }
  166. return $this;
  167. }
  168. }