src/Core/Entity/EstudianteCurso.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Core\Entity;
  3. use App\Asistencia\Entity\Asistencia;
  4. use App\Asistencia\Entity\Comentario;
  5. use App\Asistencia\Entity\RegistroEvaluacion;
  6. use App\Core\Entity\Curso;
  7. use App\Core\Entity\Estudiante;
  8. use App\Asistencia\Entity\Logro;
  9. use App\Asistencia\Entity\Meta;
  10. use App\Core\Entity\Institucion\Seccion;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use Doctrine\ORM\Mapping as ORM;
  14. /**
  15. * @ORM\Entity(repositoryClass="App\Core\Repository\EstudianteCursoRepository")
  16. */
  17. class EstudianteCurso
  18. {
  19. /**
  20. * @ORM\Id()
  21. * @ORM\GeneratedValue()
  22. * @ORM\Column(type="integer")
  23. */
  24. private $id;
  25. /**
  26. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Estudiante", inversedBy="estudianteCursos")
  27. * @ORM\JoinColumn(nullable=false)
  28. */
  29. private $estudiante;
  30. /**
  31. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Curso", inversedBy="estudiantesCurso")
  32. * @ORM\JoinColumn(nullable=false)
  33. */
  34. private $curso;
  35. /**
  36. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Logro", mappedBy="estudianteCurso", orphanRemoval=true, cascade={"remove"})
  37. */
  38. private $logros;
  39. /**
  40. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Meta", mappedBy="asignacion", orphanRemoval=true, cascade={"remove"})
  41. */
  42. private $metas;
  43. /**
  44. * @ORM\OneToOne(targetEntity="App\Core\Entity\Agenda", cascade={"persist", "remove"})
  45. * @ORM\JoinColumn(nullable=false)
  46. */
  47. private $agenda;
  48. /**
  49. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Institucion\Seccion", inversedBy="estudiantesCurso")
  50. * @ORM\JoinColumn(nullable=true)
  51. */
  52. private $seccion;
  53. /**
  54. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Asistencia", mappedBy="estudianteCurso", orphanRemoval=true, cascade={"remove"})
  55. */
  56. private $asistencias;
  57. /**
  58. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Comentario", mappedBy="estudianteCurso", orphanRemoval=true, cascade={"remove"})
  59. */
  60. private $comentarios;
  61. /**
  62. * @ORM\OneToMany(targetEntity=PuntuacionClase::class, mappedBy="estudianteCurso", orphanRemoval=true, cascade={"remove"})
  63. */
  64. private $puntuacionesClases;
  65. /**
  66. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\RegistroEvaluacion", mappedBy="estudianteCurso", orphanRemoval=true, cascade={"remove"})
  67. */
  68. private $registroEvaluaciones;
  69. public function __construct()
  70. {
  71. $this->logros = new ArrayCollection();
  72. $this->metas = new ArrayCollection();
  73. $this->asistencias = new ArrayCollection();
  74. $this->comentarios = new ArrayCollection();
  75. $this->puntuacionesClases = new ArrayCollection();
  76. $this->registroEvaluaciones = new ArrayCollection();
  77. }
  78. public function getId(): ?int
  79. {
  80. return $this->id;
  81. }
  82. public function getEstudiante(): ?Estudiante
  83. {
  84. return $this->estudiante;
  85. }
  86. public function setEstudiante(?Estudiante $estudiante): self
  87. {
  88. $this->estudiante = $estudiante;
  89. return $this;
  90. }
  91. public function getCurso(): ?Curso
  92. {
  93. return $this->curso;
  94. }
  95. public function setCurso(?Curso $curso): self
  96. {
  97. $this->curso = $curso;
  98. return $this;
  99. }
  100. /**
  101. * @return Collection|Logro[]
  102. */
  103. public function getLogros(): Collection
  104. {
  105. return $this->logros;
  106. }
  107. public function addLogro(Logro $logro): self
  108. {
  109. if (!$this->logros->contains($logro)) {
  110. $this->logros[] = $logro;
  111. $logro->setEstudianteCurso($this);
  112. }
  113. return $this;
  114. }
  115. public function removeLogro(Logro $logro): self
  116. {
  117. if ($this->logros->contains($logro)) {
  118. $this->logros->removeElement($logro);
  119. // set the owning side to null (unless already changed)
  120. if ($logro->getEstudianteCurso() === $this) {
  121. $logro->setEstudianteCurso(null);
  122. }
  123. }
  124. return $this;
  125. }
  126. /**
  127. * @return Collection|Meta[]
  128. */
  129. public function getMetas(): Collection
  130. {
  131. return $this->metas;
  132. }
  133. public function addMeta(Meta $meta): self
  134. {
  135. if (!$this->metas->contains($meta)) {
  136. $this->metas[] = $meta;
  137. $meta->setAsignacion($this);
  138. }
  139. return $this;
  140. }
  141. public function removeMeta(Meta $meta): self
  142. {
  143. if ($this->metas->contains($meta)) {
  144. $this->metas->removeElement($meta);
  145. // set the owning side to null (unless already changed)
  146. if ($meta->getAsignacion() === $this) {
  147. $meta->setAsignacion(null);
  148. }
  149. }
  150. return $this;
  151. }
  152. public function getAgenda(): ?Agenda
  153. {
  154. return $this->agenda;
  155. }
  156. public function setAgenda(Agenda $agenda): self
  157. {
  158. $this->agenda = $agenda;
  159. return $this;
  160. }
  161. public function getSeccion(): ?Seccion
  162. {
  163. return $this->seccion;
  164. }
  165. public function setSeccion(?Seccion $seccion): self
  166. {
  167. $this->seccion = $seccion;
  168. return $this;
  169. }
  170. /**
  171. * @return Collection|Asistencia[]
  172. */
  173. public function getAsistencias(): Collection
  174. {
  175. return $this->asistencias;
  176. }
  177. public function addAsistencia(Asistencia $asistencia): self
  178. {
  179. if (!$this->asistencias->contains($asistencia)) {
  180. $this->asistencias[] = $asistencia;
  181. $asistencia->setEstudianteCurso($this);
  182. }
  183. return $this;
  184. }
  185. public function removeAsistencia(Asistencia $asistencia): self
  186. {
  187. if ($this->asistencias->contains($asistencia)) {
  188. $this->asistencias->removeElement($asistencia);
  189. // set the owning side to null (unless already changed)
  190. if ($asistencia->getEstudianteCurso() === $this) {
  191. $asistencia->setEstudianteCurso(null);
  192. }
  193. }
  194. return $this;
  195. }
  196. /**
  197. * @return Collection|Comentario[]
  198. */
  199. public function getComentarios(): Collection
  200. {
  201. return $this->comentarios;
  202. }
  203. public function addComentario(Comentario $comentario): self
  204. {
  205. if (!$this->comentarios->contains($comentario)) {
  206. $this->comentarios[] = $comentario;
  207. $comentario->setEstudianteCurso($this);
  208. }
  209. return $this;
  210. }
  211. public function removeComentario(Comentario $comentario): self
  212. {
  213. if ($this->comentarios->contains($comentario)) {
  214. $this->comentarios->removeElement($comentario);
  215. // set the owning side to null (unless already changed)
  216. if ($comentario->getEstudianteCurso() === $this) {
  217. $comentario->setEstudianteCurso(null);
  218. }
  219. }
  220. return $this;
  221. }
  222. /**
  223. * @return Collection|PuntuacionClase[]
  224. */
  225. public function getPuntuacionesClases(): Collection
  226. {
  227. return $this->puntuacionesClases;
  228. }
  229. public function addPuntuacionesClase(PuntuacionClase $puntuacionesClase): self
  230. {
  231. if (!$this->puntuacionesClases->contains($puntuacionesClase)) {
  232. $this->puntuacionesClases[] = $puntuacionesClase;
  233. $puntuacionesClase->setEstudianteCurso($this);
  234. }
  235. return $this;
  236. }
  237. public function removePuntuacionesClase(PuntuacionClase $puntuacionesClase): self
  238. {
  239. if ($this->puntuacionesClases->contains($puntuacionesClase)) {
  240. $this->puntuacionesClases->removeElement($puntuacionesClase);
  241. // set the owning side to null (unless already changed)
  242. if ($puntuacionesClase->getEstudianteCurso() === $this) {
  243. $puntuacionesClase->setEstudianteCurso(null);
  244. }
  245. }
  246. return $this;
  247. }
  248. /**
  249. * @return Collection|RegistroEvaluacion[]
  250. */
  251. public function getRegistroEvaluaciones(): Collection
  252. {
  253. return $this->registroEvaluaciones;
  254. }
  255. public function addRegistroEvaluacione(RegistroEvaluacion $registroEvaluacione): self
  256. {
  257. if (!$this->registroEvaluaciones->contains($registroEvaluacione)) {
  258. $this->registroEvaluaciones[] = $registroEvaluacione;
  259. $registroEvaluacione->setEstudianteCurso($this);
  260. }
  261. return $this;
  262. }
  263. public function removeRegistroEvaluacione(RegistroEvaluacion $registroEvaluacione): self
  264. {
  265. if ($this->registroEvaluaciones->contains($registroEvaluacione)) {
  266. $this->registroEvaluaciones->removeElement($registroEvaluacione);
  267. // set the owning side to null (unless already changed)
  268. if ($registroEvaluacione->getEstudianteCurso() === $this) {
  269. $registroEvaluacione->setEstudianteCurso(null);
  270. }
  271. }
  272. return $this;
  273. }
  274. }