src/Core/Entity/Curso.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Core\Entity;
  3. use App\Asistencia\Entity\Anuncio;
  4. use App\Asistencia\Entity\Clase;
  5. use App\Asistencia\Entity\Evaluacion;
  6. use App\Core\Entity\Chat\Conversacion;
  7. use App\Core\Entity\Institucion\Nivel;
  8. use App\Core\Entity\Subscripciones\HistorialPagoSubscripcion;
  9. use App\Core\Entity\Subscripciones\PagoSubscripcion;
  10. use App\Entity\ArchivoCurso;
  11. use App\Entity\EstudianteCursoNotaFinal;
  12. use App\Entity\InvitacionInstitucionPermisos;
  13. use App\Entity\Materia;
  14. use App\Entity\TareasCurso;
  15. use App\Core\Entity\Institucion\Seccion;
  16. use DateTimeInterface;
  17. use Doctrine\Common\Collections\ArrayCollection;
  18. use Doctrine\Common\Collections\Collection;
  19. use Doctrine\ORM\Mapping as ORM;
  20. use Symfony\Component\HttpFoundation\File\File;
  21. use Symfony\Component\HttpFoundation\File\UploadedFile;
  22. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  23. /**
  24. * @ORM\Entity(repositoryClass="App\Core\Repository\CursoRepository")
  25. * @Vich\Uploadable()
  26. */
  27. class Curso
  28. {
  29. const JSON_FIELDS = ['id', 'nombre', 'descripcion', 'cupo', 'estado', 'fechaInicio', 'fechaFin', 'cursoClon' => ['id', 'nombre', 'descripcion'], 'duracion', 'horarios' => Horario::JSON_FIELDS, 'maestrosCurso' => ['id'], 'estudiantesCurso' => ['id']];
  30. /**
  31. * @ORM\Id()
  32. * @ORM\GeneratedValue()
  33. * @ORM\Column(type="integer")
  34. */
  35. private $id;
  36. /**
  37. * @ORM\Column(type="string", length=100)
  38. */
  39. private $nombre;
  40. /**
  41. * @ORM\Column(type="text")
  42. */
  43. private $descripcion;
  44. /**
  45. * @ORM\Column(type="integer")
  46. */
  47. private $cupo;
  48. /**
  49. * @ORM\Column(type="integer")
  50. * 0 = en creacion, este estado se utiliza cuando el curso esta en proceso de creacion
  51. * 1 = activo
  52. * 2 = archivado
  53. * 3 = eliminado
  54. */
  55. private $estado;
  56. /**
  57. * @ORM\Column(type="date")
  58. */
  59. private $fechaInicio;
  60. /**
  61. * @ORM\Column(type="date", nullable=true)
  62. */
  63. private $fechaFin;
  64. /**
  65. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Curso", cascade={"persist", "remove"})
  66. */
  67. private $cursoClon;
  68. /**
  69. * @ORM\Column(type="integer")
  70. */
  71. private $duracion;
  72. /**
  73. * @ORM\OneToMany(targetEntity="App\Core\Entity\Horario", mappedBy="curso")
  74. */
  75. private $horarios;
  76. /**
  77. * @ORM\OneToMany(targetEntity="App\Core\Entity\MaestroCurso", mappedBy="curso")
  78. */
  79. private $maestrosCurso;
  80. /**
  81. * @ORM\OneToMany(targetEntity="App\Core\Entity\EstudianteCurso", mappedBy="curso")
  82. */
  83. private $estudiantesCurso;
  84. /**
  85. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Color", inversedBy="cursos")
  86. * @ORM\JoinColumn(nullable=false)
  87. */
  88. private $color;
  89. /**
  90. * @ORM\OneToOne(targetEntity="App\Entity\Materia", inversedBy="curso", cascade={"persist", "remove"})
  91. * @ORM\JoinColumn(name="materia_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  92. */
  93. private $materia;
  94. /**
  95. * @ORM\Column(type="boolean")
  96. */
  97. private $privado;
  98. /**
  99. * @ORM\Column(type="boolean", nullable=true)
  100. */
  101. private $cursoInstitucion;
  102. /*
  103. * null o 0 = curso normal
  104. * 1 = curso institucion
  105. */
  106. /**
  107. * @ORM\OneToMany(targetEntity="App\Core\Entity\CategoriaCurso", mappedBy="curso")
  108. */
  109. private $cursoCategorias;
  110. /**
  111. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Direccion", inversedBy="cursos")
  112. * @ORM\JoinColumn(nullable=true)
  113. */
  114. private $direccion;
  115. /**
  116. * @ORM\Column(type="text", nullable=true)
  117. */
  118. private $excepcionesObservaciones;
  119. /**
  120. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Clase", mappedBy="curso", orphanRemoval=true)
  121. */
  122. private $clases;
  123. /**
  124. * @ORM\Column(type="decimal", precision=3, scale=2)
  125. */
  126. private $porcentajePresente;
  127. /**
  128. * @ORM\Column(type="decimal", precision=3, scale=2)
  129. */
  130. private $porcentajeTarde;
  131. /**
  132. * @ORM\Column(type="decimal", precision=3, scale=2)
  133. */
  134. private $porcentajeAusente;
  135. /**
  136. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Anuncio", mappedBy="curso", orphanRemoval=true)
  137. */
  138. private $anuncios;
  139. /**
  140. * @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Evaluacion", mappedBy="curso", orphanRemoval=true)
  141. */
  142. private $evaluaciones;
  143. /**
  144. * @ORM\OneToMany(targetEntity="App\Core\Entity\SolicitudAsignacion", mappedBy="curso", orphanRemoval=true)
  145. */
  146. private $solicitudAsignaciones;
  147. /**
  148. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Maestro")
  149. * @ORM\JoinColumn(nullable=false)
  150. */
  151. private $maestroPrincipal;
  152. /**
  153. * @ORM\Column(type="datetime")
  154. */
  155. private $fechaCreacion;
  156. public $esDeMaestro = false;
  157. /**
  158. * @ORM\OneToMany(targetEntity=Conversacion::class, mappedBy="curso", orphanRemoval=true)
  159. */
  160. private $conversaciones;
  161. /**
  162. * @ORM\OneToMany(targetEntity=Notificacion::class, mappedBy="curso")
  163. */
  164. private $notificaciones;
  165. /**
  166. * @ORM\OneToMany(targetEntity=PuntuacionCurso::class, mappedBy="curso", orphanRemoval=true)
  167. */
  168. private $puntuacionesCurso;
  169. /**
  170. * @ORM\OneToMany(targetEntity=PagoSubscripcion::class, mappedBy="curso")
  171. */
  172. private $pagosSubscripcion;
  173. /**
  174. * @ORM\OneToMany(targetEntity=HistorialPagoSubscripcion::class, mappedBy="curso")
  175. */
  176. private $historialPagosSubscripcion;
  177. /**
  178. * NOTE: This is not a mapped field of entity metadata, just a simple property.
  179. *
  180. * @Vich\UploadableField(mapping="portada_de_curso", fileNameProperty="imgPortadaName", size="imgPortadaSize")
  181. *
  182. * @var File|null
  183. */
  184. private $imgPortada;
  185. /**
  186. * @ORM\Column(type="string", length=200, nullable=true)
  187. *
  188. * @var string|null
  189. */
  190. private $imgPortadaName;
  191. /**
  192. * @ORM\Column(type="integer", nullable=true)
  193. *
  194. * @var int|null
  195. */
  196. private $imgPortadaSize;
  197. /**
  198. * @ORM\Column(type="string", nullable=true, length=20)
  199. */
  200. private $modalidad;
  201. /**
  202. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Institucion\Nivel", inversedBy="materias")
  203. * @ORM\JoinColumn(nullable=true)
  204. */
  205. private $nivel;
  206. /**
  207. * @ORM\Column(type="float", nullable=true)
  208. */
  209. private $puntuacionPromedio;
  210. /**
  211. * @ORM\OneToMany(targetEntity=EstudianteCursoRol::class, mappedBy="curso")
  212. */
  213. private $estudianteCursoRols;
  214. /**
  215. * @ORM\OneToMany(targetEntity=ArchivoCurso::class, mappedBy="curso")
  216. */
  217. private $archivoCursos;
  218. /**
  219. * @ORM\OneToMany(targetEntity=TareasCurso::class, mappedBy="curso")
  220. */
  221. private $tareasCursos;
  222. /**
  223. * @ORM\Column(type="string", nullable=true)
  224. */
  225. private $notaMaximaCaracter;
  226. /**
  227. * @ORM\Column(type="integer", nullable=true)
  228. */
  229. private $notaMaximaNumerica;
  230. /**
  231. * @ORM\Column(type="decimal", precision=3, scale=2, nullable=true)
  232. */
  233. private $notaMaximaPorcentaje;
  234. /**
  235. * @ORM\OneToMany(targetEntity=EstudianteCursoNotaFinal::class, mappedBy="curso")
  236. */
  237. private $estudianteCursoNotaFinals;
  238. /**
  239. * @ORM\ManyToOne(targetEntity="App\Core\Entity\Institucion\Seccion", inversedBy="cursos")
  240. * @ORM\JoinColumn(nullable=true) // Permite valores nulos
  241. */
  242. private $seccion;
  243. /**
  244. * @ORM\OneToMany(targetEntity=InvitacionInstitucionPermisos::class, mappedBy="Curso")
  245. */
  246. private $invitacionInstitucionPermisos;
  247. public function __construct()
  248. {
  249. $this->horarios = new ArrayCollection();
  250. $this->cursoCategorias = new ArrayCollection();
  251. $this->maestrosCurso = new ArrayCollection();
  252. $this->estudiantesCurso = new ArrayCollection();
  253. $this->clases = new ArrayCollection();
  254. $this->anuncios = new ArrayCollection();
  255. $this->evaluaciones = new ArrayCollection();
  256. $this->solicitudAsignaciones = new ArrayCollection();
  257. $this->conversaciones = new ArrayCollection();
  258. $this->notificaciones = new ArrayCollection();
  259. $this->puntuacionesCurso = new ArrayCollection();
  260. $this->pagosSubscripcion = new ArrayCollection();
  261. $this->historialPagosSubscripcion = new ArrayCollection();
  262. $this->estudianteCursoRols = new ArrayCollection();
  263. $this->archivoCursos = new ArrayCollection();
  264. $this->tareasCursos = new ArrayCollection();
  265. $this->estudianteCursoNotaFinals = new ArrayCollection();
  266. $this->modalidad = '';
  267. $this->invitacionInstitucionPermisos = new ArrayCollection();
  268. }
  269. public function getId(): ?int
  270. {
  271. return $this->id;
  272. }
  273. public function getNombre(): ?string
  274. {
  275. return $this->nombre;
  276. }
  277. public function setNombre(string $nombre): self
  278. {
  279. $this->nombre = $nombre;
  280. return $this;
  281. }
  282. public function getDescripcion(): ?string
  283. {
  284. return $this->descripcion;
  285. }
  286. public function setDescripcion(string $descripcion): self
  287. {
  288. $this->descripcion = $descripcion;
  289. return $this;
  290. }
  291. public function getCupo(): ?int
  292. {
  293. return $this->cupo;
  294. }
  295. public function setCupo(int $cupo): self
  296. {
  297. $this->cupo = $cupo;
  298. return $this;
  299. }
  300. public function getEstado(): ?int
  301. {
  302. return $this->estado;
  303. }
  304. public function setEstado(int $estado): self
  305. {
  306. $this->estado = $estado;
  307. return $this;
  308. }
  309. public function getFechaInicio(): ?DateTimeInterface
  310. {
  311. return $this->fechaInicio;
  312. }
  313. public function setFechaInicio(DateTimeInterface $fechaInicio): self
  314. {
  315. $this->fechaInicio = $fechaInicio;
  316. return $this;
  317. }
  318. public function getFechaFin(): ?DateTimeInterface
  319. {
  320. return $this->fechaFin;
  321. }
  322. public function setFechaFin(DateTimeInterface $fechaFin = null): self
  323. {
  324. $this->fechaFin = $fechaFin;
  325. return $this;
  326. }
  327. public function getCursoClon(): ?self
  328. {
  329. return $this->cursoClon;
  330. }
  331. public function setCursoClon(?self $cursoClon = null): self
  332. {
  333. $this->cursoClon = $cursoClon;
  334. return $this;
  335. }
  336. public function getDuracion(): ?int
  337. {
  338. return $this->duracion;
  339. }
  340. public function setDuracion(?int $duracion): self
  341. {
  342. $this->duracion = $duracion;
  343. return $this;
  344. }
  345. /**
  346. * @return Collection|Horario[]
  347. */
  348. public function getHorarios(): Collection
  349. {
  350. return $this->horarios;
  351. }
  352. public function addHorario(Horario $horario): self
  353. {
  354. if (!$this->horarios->contains($horario)) {
  355. $this->horarios[] = $horario;
  356. $horario->setCurso($this);
  357. }
  358. return $this;
  359. }
  360. public function removeHorario(Horario $horario): self
  361. {
  362. if ($this->horarios->contains($horario)) {
  363. $this->horarios->removeElement($horario);
  364. // set the owning side to null (unless already changed)
  365. if ($horario->getCurso() === $this) {
  366. $horario->setCurso(null);
  367. }
  368. }
  369. return $this;
  370. }
  371. public function getColor(): ?Color
  372. {
  373. return $this->color;
  374. }
  375. public function setColor(Color $color): self
  376. {
  377. $this->color = $color;
  378. return $this;
  379. }
  380. public function getPrivado(): ?bool
  381. {
  382. return $this->privado;
  383. }
  384. public function setPrivado(bool $privado): self
  385. {
  386. $this->privado = $privado;
  387. return $this;
  388. }
  389. /**
  390. * @return Collection|CategoriaCurso[]
  391. */
  392. public function getCursoCategorias(): Collection
  393. {
  394. return $this->cursoCategorias;
  395. }
  396. public function addCategoriaCurso(CategoriaCurso $categoriaCurso): self
  397. {
  398. if (!$this->cursoCategorias->contains($categoriaCurso)) {
  399. $this->cursoCategorias[] = $categoriaCurso;
  400. $categoriaCurso->setCurso($this);
  401. }
  402. return $this;
  403. }
  404. public function removeCategoriaCurso(CategoriaCurso $categoriaCurso): self
  405. {
  406. if ($this->cursoCategorias->contains($categoriaCurso)) {
  407. $this->cursoCategorias->removeElement($categoriaCurso);
  408. // set the owning side to null (unless already changed)
  409. if ($categoriaCurso->getCurso() === $this) {
  410. $categoriaCurso->setCurso(null);
  411. }
  412. }
  413. return $this;
  414. }
  415. public function getDireccion(): ?Direccion
  416. {
  417. return $this->direccion;
  418. }
  419. public function setDireccion(Direccion $direccion = null): self
  420. {
  421. $this->direccion = $direccion;
  422. return $this;
  423. }
  424. public function getExcepcionesObservaciones(): ?string
  425. {
  426. return $this->excepcionesObservaciones;
  427. }
  428. public function setExcepcionesObservaciones(string $excepcionesObservaciones = null): self
  429. {
  430. $this->excepcionesObservaciones = $excepcionesObservaciones;
  431. return $this;
  432. }
  433. /**
  434. * @return Collection|EstudianteCurso[]
  435. */
  436. public function getEstudiantesCurso(): Collection
  437. {
  438. return $this->estudiantesCurso;
  439. }
  440. public function addEstudianteCurso(EstudianteCurso $estudianteCurso): self
  441. {
  442. if (!$this->estudiantesCurso->contains($estudianteCurso)) {
  443. $this->estudiantesCurso[] = $estudianteCurso;
  444. $estudianteCurso->setCurso($this);
  445. }
  446. return $this;
  447. }
  448. public function removeEstudianteCurso(EstudianteCurso $estudianteCurso): self
  449. {
  450. if ($this->estudiantesCurso->contains($estudianteCurso)) {
  451. $this->estudiantesCurso->removeElement($estudianteCurso);
  452. // set the owning side to null (unless already changed)
  453. if ($estudianteCurso->getCurso() === $this) {
  454. $estudianteCurso->setCurso(null);
  455. }
  456. }
  457. return $this;
  458. }
  459. /**
  460. * @return Collection|MaestroCurso[]
  461. */
  462. public function getMaestrosCurso(): Collection
  463. {
  464. return $this->maestrosCurso;
  465. }
  466. public function addMaestroCurso(MaestroCurso $maestroCurso): self
  467. {
  468. if (!$this->maestrosCurso->contains($maestroCurso)) {
  469. $this->maestrosCurso[] = $maestroCurso;
  470. $maestroCurso->setCurso($this);
  471. }
  472. return $this;
  473. }
  474. public function removeMaestroCurso(MaestroCurso $maestroCurso): self
  475. {
  476. if ($this->maestrosCurso->contains($maestroCurso)) {
  477. $this->maestrosCurso->removeElement($maestroCurso);
  478. // set the owning side to null (unless already changed)
  479. if ($maestroCurso->getCurso() === $this) {
  480. $maestroCurso->setCurso(null);
  481. }
  482. }
  483. return $this;
  484. }
  485. function getCantidadAlumnos(): int
  486. {
  487. return count($this->getEstudiantesCurso());
  488. }
  489. function getCantidadMaestros(): int
  490. {
  491. return count($this->getMaestrosCurso());
  492. }
  493. /**
  494. * @return Collection|Clase[]
  495. */
  496. public function getClases(): Collection
  497. {
  498. return $this->clases;
  499. }
  500. public function addClase(Clase $clase): self
  501. {
  502. if (!$this->clases->contains($clase)) {
  503. $this->clases[] = $clase;
  504. $clase->setCurso($this);
  505. }
  506. return $this;
  507. }
  508. public function removeClase(Clase $clase): self
  509. {
  510. if ($this->clases->contains($clase)) {
  511. $this->clases->removeElement($clase);
  512. // set the owning side to null (unless already changed)
  513. if ($clase->getCurso() === $this) {
  514. $clase->setCurso(null);
  515. }
  516. }
  517. return $this;
  518. }
  519. public function getPorcentajePresente(): ?string
  520. {
  521. return $this->porcentajePresente;
  522. }
  523. public function setPorcentajePresente(string $porcentajePresente): self
  524. {
  525. $this->porcentajePresente = $porcentajePresente;
  526. return $this;
  527. }
  528. public function getPorcentajeTarde(): ?string
  529. {
  530. return $this->porcentajeTarde;
  531. }
  532. public function setPorcentajeTarde(string $porcentajeTarde): self
  533. {
  534. $this->porcentajeTarde = $porcentajeTarde;
  535. return $this;
  536. }
  537. public function getPorcentajeAusente(): ?string
  538. {
  539. return $this->porcentajeAusente;
  540. }
  541. public function setPorcentajeAusente(string $porcentajeAusente): self
  542. {
  543. $this->porcentajeAusente = $porcentajeAusente;
  544. return $this;
  545. }
  546. /**
  547. * @return Collection|Anuncio[]
  548. */
  549. public function getAnuncios(): Collection
  550. {
  551. return $this->anuncios;
  552. }
  553. public function addAnuncio(Anuncio $anuncio): self
  554. {
  555. if (!$this->anuncios->contains($anuncio)) {
  556. $this->anuncios[] = $anuncio;
  557. $anuncio->setCurso($this);
  558. }
  559. return $this;
  560. }
  561. public function removeAnuncio(Anuncio $anuncio): self
  562. {
  563. if ($this->anuncios->contains($anuncio)) {
  564. $this->anuncios->removeElement($anuncio);
  565. // set the owning side to null (unless already changed)
  566. if ($anuncio->getCurso() === $this) {
  567. $anuncio->setCurso(null);
  568. }
  569. }
  570. return $this;
  571. }
  572. /**
  573. * @return Collection|Evaluacion[]
  574. */
  575. public function getEvaluaciones(): Collection
  576. {
  577. return $this->evaluaciones;
  578. }
  579. public function addEvaluacione(Evaluacion $evaluacione): self
  580. {
  581. if (!$this->evaluaciones->contains($evaluacione)) {
  582. $this->evaluaciones[] = $evaluacione;
  583. $evaluacione->setCurso($this);
  584. }
  585. return $this;
  586. }
  587. public function removeEvaluacione(Evaluacion $evaluacione): self
  588. {
  589. if ($this->evaluaciones->contains($evaluacione)) {
  590. $this->evaluaciones->removeElement($evaluacione);
  591. // set the owning side to null (unless already changed)
  592. if ($evaluacione->getCurso() === $this) {
  593. $evaluacione->setCurso(null);
  594. }
  595. }
  596. return $this;
  597. }
  598. /**
  599. * @return Collection|SolicitudAsignacion[]
  600. */
  601. public function getSolicitudAsignaciones(): Collection
  602. {
  603. return $this->solicitudAsignaciones;
  604. }
  605. public function addSolicitudAsignacione(SolicitudAsignacion $solicitudAsignacione): self
  606. {
  607. if (!$this->solicitudAsignaciones->contains($solicitudAsignacione)) {
  608. $this->solicitudAsignaciones[] = $solicitudAsignacione;
  609. $solicitudAsignacione->setCurso($this);
  610. }
  611. return $this;
  612. }
  613. public function removeSolicitudAsignacione(SolicitudAsignacion $solicitudAsignacione): self
  614. {
  615. if ($this->solicitudAsignaciones->contains($solicitudAsignacione)) {
  616. $this->solicitudAsignaciones->removeElement($solicitudAsignacione);
  617. // set the owning side to null (unless already changed)
  618. if ($solicitudAsignacione->getCurso() === $this) {
  619. $solicitudAsignacione->setCurso(null);
  620. }
  621. }
  622. return $this;
  623. }
  624. public function getMaestroPrincipal(): ?Maestro
  625. {
  626. return $this->maestroPrincipal;
  627. }
  628. public function setMaestroPrincipal(Maestro $maestro): self
  629. {
  630. $this->maestroPrincipal = $maestro;
  631. return $this;
  632. }
  633. public function getEsDeMaestro() {
  634. return $this->esDeMaestro;
  635. }
  636. public function setEsDeMaestro(bool $esDeMaestro) {
  637. $this->esDeMaestro = $esDeMaestro;
  638. }
  639. /**
  640. * @return Collection|Conversacion[]
  641. */
  642. public function getConversaciones(): Collection
  643. {
  644. return $this->conversaciones;
  645. }
  646. public function addConversacione(Conversacion $conversacione): self
  647. {
  648. if (!$this->conversaciones->contains($conversacione)) {
  649. $this->conversaciones[] = $conversacione;
  650. $conversacione->setCurso($this);
  651. }
  652. return $this;
  653. }
  654. public function removeConversacione(Conversacion $conversacione): self
  655. {
  656. if ($this->conversaciones->contains($conversacione)) {
  657. $this->conversaciones->removeElement($conversacione);
  658. // set the owning side to null (unless already changed)
  659. if ($conversacione->getCurso() === $this) {
  660. $conversacione->setCurso(null);
  661. }
  662. }
  663. return $this;
  664. }
  665. /**
  666. * @return Collection|Notificacion[]
  667. */
  668. public function getNotificacions(): Collection
  669. {
  670. return $this->notificaciones;
  671. }
  672. public function addNotificacion(Notificacion $notificacion): self
  673. {
  674. if (!$this->notificaciones->contains($notificacion)) {
  675. $this->notificaciones[] = $notificacion;
  676. $notificacion->setCurso($this);
  677. }
  678. return $this;
  679. }
  680. public function removeNotificacion(Notificacion $notificacion): self
  681. {
  682. if ($this->notificaciones->removeElement($notificacion)) {
  683. // set the owning side to null (unless already changed)
  684. if ($notificacion->getCurso() === $this) {
  685. $notificacion->setCurso(null);
  686. }
  687. }
  688. return $this;
  689. }
  690. /**
  691. * @return Collection|PuntuacionCurso[]
  692. */
  693. public function getPuntuacionesCurso(): Collection
  694. {
  695. return $this->puntuacionesCurso;
  696. }
  697. public function addPuntuacionesCurso(PuntuacionCurso $puntuacionesCurso): self
  698. {
  699. if (!$this->puntuacionesCurso->contains($puntuacionesCurso)) {
  700. $this->puntuacionesCurso[] = $puntuacionesCurso;
  701. $puntuacionesCurso->setCurso($this);
  702. }
  703. return $this;
  704. }
  705. public function removePuntuacionesCurso(PuntuacionCurso $puntuacionesCurso): self
  706. {
  707. if ($this->puntuacionesCurso->removeElement($puntuacionesCurso)) {
  708. // set the owning side to null (unless already changed)
  709. if ($puntuacionesCurso->getCurso() === $this) {
  710. $puntuacionesCurso->setCurso(null);
  711. }
  712. }
  713. return $this;
  714. }
  715. /**
  716. * @return Collection|PagoSubscripcion[]
  717. */
  718. public function getPagosSubscripcion(): Collection
  719. {
  720. return $this->pagosSubscripcion;
  721. }
  722. public function addPagosSubscripcion(PagoSubscripcion $pagosSubscripcion): self
  723. {
  724. if (!$this->pagosSubscripcion->contains($pagosSubscripcion)) {
  725. $this->pagosSubscripcion[] = $pagosSubscripcion;
  726. $pagosSubscripcion->setCurso($this);
  727. }
  728. return $this;
  729. }
  730. public function removePagosSubscripcion(PagoSubscripcion $pagosSubscripcion): self
  731. {
  732. if ($this->pagosSubscripcion->removeElement($pagosSubscripcion)) {
  733. // set the owning side to null (unless already changed)
  734. if ($pagosSubscripcion->getCurso() === $this) {
  735. $pagosSubscripcion->setCurso(null);
  736. }
  737. }
  738. return $this;
  739. }
  740. /**
  741. * @return Collection|HistorialPagoSubscripcion[]
  742. */
  743. public function getHistorialPagosSubscripcion(): Collection
  744. {
  745. return $this->historialPagosSubscripcion;
  746. }
  747. public function getFechaCreacion(): ?DateTimeInterface
  748. {
  749. return $this->fechaCreacion;
  750. }
  751. public function setFechaCreacion(DateTimeInterface $fechaCreacion): self
  752. {
  753. $this->fechaCreacion = $fechaCreacion;
  754. return $this;
  755. }
  756. /**
  757. * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  758. * of 'UploadedFile' is injected into this setter to trigger the update. If this
  759. * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  760. * must be able to accept an instance of 'File' as the bundle will inject one here
  761. * during Doctrine hydration.
  762. *
  763. * @param File|UploadedFile|null $uploadedFile
  764. */
  765. public function setImgPortada(?File $uploadedFile = null): void
  766. {
  767. $this->imgPortada = $uploadedFile;
  768. if (null !== $uploadedFile) {
  769. // It is required that at least one field changes if you are using doctrine
  770. // otherwise the event listeners won't be called and the file is lost
  771. $this->setImgPortadaSize($uploadedFile->getSize());
  772. }
  773. }
  774. public function getImgPortada(): ?File
  775. {
  776. return $this->imgPortada;
  777. }
  778. public function setImgPortadaName(?string $imgPortadaName): void
  779. {
  780. $this->imgPortadaName = $imgPortadaName;
  781. }
  782. public function getImgPortadaName(): ?string
  783. {
  784. return $this->imgPortadaName;
  785. }
  786. public function setImgPortadaSize(?int $imgPortadaSize): void
  787. {
  788. $this->imgPortadaSize = $imgPortadaSize;
  789. }
  790. public function getImgPortadaSize(): ?int
  791. {
  792. return $this->imgPortadaSize;
  793. }
  794. public function getModalidad(): ?string {
  795. return $this->modalidad;
  796. }
  797. public function setModalidad(?string $modalidad): self
  798. {
  799. $this->modalidad = $modalidad ?? 'virtual';
  800. return $this;
  801. }
  802. public function getNivel(): ?Nivel
  803. {
  804. return $this->nivel;
  805. }
  806. public function setNivel(?Nivel $nivel): self
  807. {
  808. $this->nivel = $nivel;
  809. return $this;
  810. }
  811. /**
  812. * @return ?float
  813. */
  814. public function getPuntuacionPromedio(): ?float
  815. {
  816. return $this->puntuacionPromedio;
  817. }
  818. /**
  819. * @param float $puntuacionPromedio
  820. */
  821. public function setPuntuacionPromedio(float $puntuacionPromedio): void
  822. {
  823. $this->puntuacionPromedio = $puntuacionPromedio;
  824. }
  825. /**
  826. * @return Collection<int, EstudianteCursoRol>
  827. */
  828. public function getEstudianteCursoRols(): Collection
  829. {
  830. return $this->estudianteCursoRols;
  831. }
  832. public function addEstudianteCursoRol(EstudianteCursoRol $estudianteCursoRol): self
  833. {
  834. if (!$this->estudianteCursoRols->contains($estudianteCursoRol)) {
  835. $this->estudianteCursoRols[] = $estudianteCursoRol;
  836. $estudianteCursoRol->setCurso($this);
  837. }
  838. return $this;
  839. }
  840. public function removeEstudianteCursoRol(EstudianteCursoRol $estudianteCursoRol): self
  841. {
  842. if ($this->estudianteCursoRols->removeElement($estudianteCursoRol)) {
  843. // set the owning side to null (unless already changed)
  844. if ($estudianteCursoRol->getCurso() === $this) {
  845. $estudianteCursoRol->setCurso(null);
  846. }
  847. }
  848. return $this;
  849. }
  850. /**
  851. * @return Collection<int, ArchivoCurso>
  852. */
  853. public function getArchivoCursos(): Collection
  854. {
  855. return $this->archivoCursos;
  856. }
  857. public function addArchivoCurso(ArchivoCurso $archivoCurso): self
  858. {
  859. if (!$this->archivoCursos->contains($archivoCurso)) {
  860. $this->archivoCursos[] = $archivoCurso;
  861. $archivoCurso->setCurso($this);
  862. }
  863. return $this;
  864. }
  865. public function removeArchivoCurso(ArchivoCurso $archivoCurso): self
  866. {
  867. if ($this->archivoCursos->removeElement($archivoCurso)) {
  868. // set the owning side to null (unless already changed)
  869. if ($archivoCurso->getCurso() === $this) {
  870. $archivoCurso->setCurso(null);
  871. }
  872. }
  873. return $this;
  874. }
  875. /**
  876. * @return Collection<int, TareasCurso>
  877. */
  878. public function getTareasCursos(): Collection
  879. {
  880. return $this->tareasCursos;
  881. }
  882. public function addTareasCurso(TareasCurso $tareasCurso): self
  883. {
  884. if (!$this->tareasCursos->contains($tareasCurso)) {
  885. $this->tareasCursos[] = $tareasCurso;
  886. $tareasCurso->setCurso($this);
  887. }
  888. return $this;
  889. }
  890. public function removeTareasCurso(TareasCurso $tareasCurso): self
  891. {
  892. if ($this->tareasCursos->removeElement($tareasCurso)) {
  893. // set the owning side to null (unless already changed)
  894. if ($tareasCurso->getCurso() === $this) {
  895. $tareasCurso->setCurso(null);
  896. }
  897. }
  898. return $this;
  899. }
  900. /**
  901. * @return mixed
  902. */
  903. public function getNotaMaximaCaracter()
  904. {
  905. return $this->notaMaximaCaracter;
  906. }
  907. /**
  908. * @param mixed $notaMaximaCaracter
  909. */
  910. public function setNotaMaximaCaracter($notaMaximaCaracter): void
  911. {
  912. $this->notaMaximaCaracter = $notaMaximaCaracter;
  913. }
  914. /**
  915. * @return mixed
  916. */
  917. public function getNotaMaximaNumerica()
  918. {
  919. return $this->notaMaximaNumerica;
  920. }
  921. /**
  922. * @param mixed $notaMaximaNumerica
  923. */
  924. public function setNotaMaximaNumerica($notaMaximaNumerica): void
  925. {
  926. $this->notaMaximaNumerica = $notaMaximaNumerica;
  927. }
  928. /**
  929. * @return mixed
  930. */
  931. public function getNotaMaximaPorcentaje()
  932. {
  933. return $this->notaMaximaPorcentaje;
  934. }
  935. /**
  936. * @param mixed $notaMaximaPorcentaje
  937. */
  938. public function setNotaMaximaPorcentaje($notaMaximaPorcentaje): void
  939. {
  940. $this->notaMaximaPorcentaje = $notaMaximaPorcentaje;
  941. }
  942. /**
  943. * @return Collection<int, EstudianteCursoNotaFinal>
  944. */
  945. public function getEstudianteCursoNotaFinals(): Collection
  946. {
  947. return $this->estudianteCursoNotaFinals;
  948. }
  949. public function addEstudianteCursoNotaFinal(EstudianteCursoNotaFinal $estudianteCursoNotaFinal): self
  950. {
  951. if (!$this->estudianteCursoNotaFinals->contains($estudianteCursoNotaFinal)) {
  952. $this->estudianteCursoNotaFinals[] = $estudianteCursoNotaFinal;
  953. $estudianteCursoNotaFinal->setCurso($this);
  954. }
  955. return $this;
  956. }
  957. public function removeEstudianteCursoNotaFinal(EstudianteCursoNotaFinal $estudianteCursoNotaFinal): self
  958. {
  959. if ($this->estudianteCursoNotaFinals->removeElement($estudianteCursoNotaFinal)) {
  960. // set the owning side to null (unless already changed)
  961. if ($estudianteCursoNotaFinal->getCurso() === $this) {
  962. $estudianteCursoNotaFinal->setCurso(null);
  963. }
  964. }
  965. return $this;
  966. }
  967. public function getMateria(): ?Materia
  968. {
  969. return $this->materia;
  970. }
  971. public function setMateria(?Materia $materia): self
  972. {
  973. $this->materia = $materia;
  974. return $this;
  975. }
  976. public function getSeccion(): ?Seccion
  977. {
  978. return $this->seccion;
  979. }
  980. public function setSeccion(?Seccion $seccion): self
  981. {
  982. $this->seccion = $seccion;
  983. return $this;
  984. }
  985. public function getCursoInstitucion(): ?bool
  986. {
  987. return $this->cursoInstitucion;
  988. }
  989. public function setCursoInstitucion(?bool $cursoInstitucion): self
  990. {
  991. $this->cursoInstitucion = $cursoInstitucion;
  992. return $this;
  993. }
  994. /**
  995. * @return Collection<int, InvitacionInstitucionPermisos>
  996. */
  997. public function getInvitacionInstitucionPermisos(): Collection
  998. {
  999. return $this->invitacionInstitucionPermisos;
  1000. }
  1001. public function addInvitacionInstitucionPermiso(InvitacionInstitucionPermisos $invitacionInstitucionPermiso): self
  1002. {
  1003. if (!$this->invitacionInstitucionPermisos->contains($invitacionInstitucionPermiso)) {
  1004. $this->invitacionInstitucionPermisos[] = $invitacionInstitucionPermiso;
  1005. $invitacionInstitucionPermiso->setCurso($this);
  1006. }
  1007. return $this;
  1008. }
  1009. public function removeInvitacionInstitucionPermiso(InvitacionInstitucionPermisos $invitacionInstitucionPermiso): self
  1010. {
  1011. if ($this->invitacionInstitucionPermisos->removeElement($invitacionInstitucionPermiso)) {
  1012. // set the owning side to null (unless already changed)
  1013. if ($invitacionInstitucionPermiso->getCurso() === $this) {
  1014. $invitacionInstitucionPermiso->setCurso(null);
  1015. }
  1016. }
  1017. return $this;
  1018. }
  1019. }