Commit 1c3c46d6794fad7f38240e781c60d311c6331d8b
1 parent
7580ea2f94
Exists in
master
por fin logrado unir estado academico con oferta academica y generar la inscripc…
…ion del estudiante a traves de uniones en doctrine
Showing
8 changed files
with
181 additions
and
377 deletions
Show diff stats
src/AppBundle/Controller/InscripcionController.php
| ... | ... | @@ -41,11 +41,11 @@ class InscripcionController extends Controller |
| 41 | 41 | */ |
| 42 | 42 | public function newAction(Request $request) |
| 43 | 43 | { |
| 44 | - $inscripcion = new Inscripcion(); | |
| 44 | + $inscripcion = $this->getDoctrine()->getRepository('AppBundle:EstadoAcademico')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
| 45 | 45 | $form = $this->createForm('AppBundle\Form\InscripcionType', $inscripcion); |
| 46 | 46 | $form->handleRequest($request); |
| 47 | 47 | |
| 48 | - if ($form->isSubmitted() && $form->isValid()) { | |
| 48 | + if ($form->isSubmitted() && $form->isValid()) { | |
| 49 | 49 | $em = $this->getDoctrine()->getManager(); |
| 50 | 50 | $em->persist($inscripcion); |
| 51 | 51 | $em->flush(); | ... | ... |
src/AppBundle/Entity/EstadoAcademico.php
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | namespace AppBundle\Entity; |
| 4 | 4 | |
| 5 | 5 | use Doctrine\ORM\Mapping as ORM; |
| 6 | +use AppBundle\Entity\Inscripcion; | |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * EstadoAcademico |
| ... | ... | @@ -77,15 +78,34 @@ class EstadoAcademico |
| 77 | 78 | * }) |
| 78 | 79 | */ |
| 79 | 80 | private $idGradoAcademico; |
| 81 | + | |
| 82 | + /** | |
| 83 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion", mappedBy="idEstadoAcademico", cascade={"all"}) | |
| 84 | + * */ | |
| 85 | + protected $hasInscripcion; | |
| 86 | + | |
| 87 | + protected $OfertaAcademica; | |
| 80 | 88 | |
| 89 | + | |
| 81 | 90 | |
| 91 | + /** | |
| 92 | + * Constructor | |
| 93 | + */ | |
| 94 | + public function __construct() | |
| 95 | + { | |
| 96 | + $this->OfertaAcademica = new \Doctrine\Common\Collections\ArrayCollection(); | |
| 97 | + $this->hasInscripcion = new \Doctrine\Common\Collections\ArrayCollection(); | |
| 98 | + } | |
| 82 | 99 | |
| 83 | 100 | /** |
| 84 | - * @ORM\PrePersist | |
| 85 | - */ | |
| 86 | - public function setFecha() | |
| 101 | + * Set fecha | |
| 102 | + * | |
| 103 | + * @param \DateTime $fecha | |
| 104 | + * @return EstadoAcademico | |
| 105 | + */ | |
| 106 | + public function setFecha($fecha) | |
| 87 | 107 | { |
| 88 | - $this->fecha = new \DateTime(); | |
| 108 | + $this->fecha = $fecha; | |
| 89 | 109 | |
| 90 | 110 | return $this; |
| 91 | 111 | } |
| ... | ... | @@ -224,4 +244,66 @@ class EstadoAcademico |
| 224 | 244 | { |
| 225 | 245 | return $this->idGradoAcademico; |
| 226 | 246 | } |
| 247 | + | |
| 248 | + /** | |
| 249 | + * Add hasInscripcion | |
| 250 | + * | |
| 251 | + * @param \AppBundle\Entity\Inscripcion $hasInscripcion | |
| 252 | + * @return EstadoAcademico | |
| 253 | + */ | |
| 254 | + public function addHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | |
| 255 | + { | |
| 256 | + $this->hasInscripcion[] = $hasInscripcion; | |
| 257 | + | |
| 258 | + return $this; | |
| 259 | + } | |
| 260 | + | |
| 261 | + /** | |
| 262 | + * Remove hasInscripcion | |
| 263 | + * | |
| 264 | + * @param \AppBundle\Entity\Inscripcion $hasInscripcion | |
| 265 | + */ | |
| 266 | + public function removeHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | |
| 267 | + { | |
| 268 | + $this->hasInscripcion->removeElement($hasInscripcion); | |
| 269 | + } | |
| 270 | + | |
| 271 | + /** | |
| 272 | + * Get hasInscripcion | |
| 273 | + * | |
| 274 | + * @return \Doctrine\Common\Collections\Collection | |
| 275 | + */ | |
| 276 | + public function getHasInscripcion() | |
| 277 | + { | |
| 278 | + return $this->hasInscripcion; | |
| 279 | + } | |
| 280 | + | |
| 281 | + | |
| 282 | + // Important | |
| 283 | + public function getOfertaAcademica() | |
| 284 | + { | |
| 285 | + $ofertaAcademica = new \Doctrine\Common\Collections\ArrayCollection(); | |
| 286 | + | |
| 287 | + foreach($this->hasInscripcion as $p) | |
| 288 | + { | |
| 289 | + $ofertaAcademica[] = $p->getOfertaAcademica(); | |
| 290 | + } | |
| 291 | + | |
| 292 | + return $ofertaAcademica; | |
| 293 | + } | |
| 294 | + // Important | |
| 295 | + public function setOfertaAcademica($ofertaAcademica) | |
| 296 | + { | |
| 297 | + foreach($ofertaAcademica as $o) | |
| 298 | + { | |
| 299 | + $inscripcion = new Inscripcion(); | |
| 300 | + | |
| 301 | + $inscripcion->setIdEstadoAcademico($this); | |
| 302 | + $inscripcion->setIdOfertaAcademica($o); | |
| 303 | + $inscripcion->setIdEstatus($this->getIdDocenteServicio()->getIdEstatus()); | |
| 304 | + | |
| 305 | + $this->addHasInscripcion($inscripcion); | |
| 306 | + } | |
| 307 | + | |
| 308 | + } | |
| 227 | 309 | } | ... | ... |
src/AppBundle/Entity/EstadoAcademico.php~
| ... | ... | @@ -7,8 +7,9 @@ use Doctrine\ORM\Mapping as ORM; |
| 7 | 7 | /** |
| 8 | 8 | * EstadoAcademico |
| 9 | 9 | * |
| 10 | - * @ORM\Table(name="estado_academico", indexes={@ORM\Index(name="fki_id_perido", columns={"id_periodo"}), @ORM\Index(name="fki_docente_servicio_estado_academico", columns={"id_docente_servicio"}), @ORM\Index(name="fki_grado_academico_estado_academico", columns={"id_grado_academico"}), @ORM\Index(name="fki_malla_curricular_estado_academico", columns={"id_malla_curricular"}), @ORM\Index(name="fki_rol_institucion_estado_academico", columns={"id_rol_institucion"})}) | |
| 10 | + * @ORM\Table(name="estado_academico", uniqueConstraints={@ORM\UniqueConstraint(name="i_rol_institucion_oferta_malla", columns={"id_rol_institucion", "id_oferta_malla_curricular"})}, indexes = {@ORM\Index(name="fki_docente_servicio_estado_academico", columns={"id_docente_servicio"}), @ORM\Index(name="fki_grado_academico_estado_academico", columns={"id_grado_academico"}), @ORM\Index(name="fki_oferta_malla_curricular_estado_academico", columns={"id_oferta_malla_curricular"}), @ORM\Index(name="fki_rol_institucion_estado_academico", columns={"id_rol_institucion"})}) | |
| 11 | 11 | * @ORM\Entity |
| 12 | + * @ORM\HasLifecycleCallbacks() | |
| 12 | 13 | */ |
| 13 | 14 | class EstadoAcademico |
| 14 | 15 | { |
| ... | ... | @@ -76,6 +77,12 @@ class EstadoAcademico |
| 76 | 77 | * }) |
| 77 | 78 | */ |
| 78 | 79 | private $idGradoAcademico; |
| 80 | + | |
| 81 | + /** | |
| 82 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion", mappedBy="idEstadoAcademico", cascade={"all"}) | |
| 83 | + * */ | |
| 84 | + protected $hasInscripcion; | |
| 79 | 85 | |
| 86 | + | |
| 80 | 87 | |
| 81 | 88 | } | ... | ... |
src/AppBundle/Entity/Inscripcion.php
| ... | ... | @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; |
| 7 | 7 | /** |
| 8 | 8 | * Inscripcion |
| 9 | 9 | * |
| 10 | - * @ORM\Table(name="inscripcion", uniqueConstraints={@ORM\UniqueConstraint(name="i_inscripcion", columns={"id_oferta_academica", "id_estado_academico"})}, indexes={@ORM\Index(name="oferta_academica_inscripcion", columns={"id_oferta_academica"}), @ORM\Index(name="fki_estado_academico_inscripcion", columns={"id_estado_academico"}), @ORM\Index(name="fki_estatus_inscripcion", columns={"id_estatus"})}) | |
| 10 | + * @ORM\Table(name="inscripcion") | |
| 11 | 11 | * @ORM\Entity |
| 12 | 12 | */ |
| 13 | 13 | class Inscripcion |
| ... | ... | @@ -23,30 +23,18 @@ class Inscripcion |
| 23 | 23 | private $id; |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @var \AppBundle\Entity\EstadoAcademico | |
| 27 | - * | |
| 28 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\EstadoAcademico") | |
| 29 | - * @ORM\JoinColumns({ | |
| 30 | - * @ORM\JoinColumn(name="id_estado_academico", referencedColumnName="id", nullable=false) | |
| 31 | - * }) | |
| 32 | - */ | |
| 26 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\EstadoAcademico", inversedBy="hasInscripcion") | |
| 27 | + * @ORM\JoinColumn(name="estado_academico_id", referencedColumnName="id") | |
| 28 | + * */ | |
| 33 | 29 | private $idEstadoAcademico; |
| 34 | 30 | |
| 35 | - /** | |
| 36 | - * @var \AppBundle\Entity\OfertaAcademica | |
| 37 | - * | |
| 38 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica") | |
| 39 | - * @ORM\JoinColumns({ | |
| 40 | - * @ORM\JoinColumn(name="id_oferta_academica", referencedColumnName="id", nullable=false) | |
| 41 | - * }) | |
| 42 | - */ | |
| 31 | + /** | |
| 32 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica", inversedBy="hasInscripcion") | |
| 33 | + * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") | |
| 34 | + * */ | |
| 43 | 35 | private $idOfertaAcademica; |
| 44 | 36 | |
| 45 | - /** | |
| 46 | - * @ORM\OneToMany(targetEntity="AppBundle\Entity\OfertaAcademica", mappedBy="idMallaCurricularUc") | |
| 47 | - */ | |
| 48 | - private $uc; | |
| 49 | - | |
| 37 | + | |
| 50 | 38 | /** |
| 51 | 39 | * @var \AppBundle\Entity\Estatus |
| 52 | 40 | * |
| ... | ... | @@ -57,7 +45,7 @@ class Inscripcion |
| 57 | 45 | */ |
| 58 | 46 | private $idEstatus; |
| 59 | 47 | |
| 60 | - | |
| 48 | + | |
| 61 | 49 | |
| 62 | 50 | /** |
| 63 | 51 | * Get id |
| ... | ... | @@ -75,7 +63,7 @@ class Inscripcion |
| 75 | 63 | * @param \AppBundle\Entity\EstadoAcademico $idEstadoAcademico |
| 76 | 64 | * @return Inscripcion |
| 77 | 65 | */ |
| 78 | - public function setIdEstadoAcademico(\AppBundle\Entity\EstadoAcademico $idEstadoAcademico) | |
| 66 | + public function setIdEstadoAcademico(\AppBundle\Entity\EstadoAcademico $idEstadoAcademico = null) | |
| 79 | 67 | { |
| 80 | 68 | $this->idEstadoAcademico = $idEstadoAcademico; |
| 81 | 69 | |
| ... | ... | @@ -98,7 +86,7 @@ class Inscripcion |
| 98 | 86 | * @param \AppBundle\Entity\OfertaAcademica $idOfertaAcademica |
| 99 | 87 | * @return Inscripcion |
| 100 | 88 | */ |
| 101 | - public function setIdOfertaAcademica(\AppBundle\Entity\OfertaAcademica $idOfertaAcademica) | |
| 89 | + public function setIdOfertaAcademica(\AppBundle\Entity\OfertaAcademica $idOfertaAcademica = null) | |
| 102 | 90 | { |
| 103 | 91 | $this->idOfertaAcademica = $idOfertaAcademica; |
| 104 | 92 | |
| ... | ... | @@ -137,44 +125,4 @@ class Inscripcion |
| 137 | 125 | { |
| 138 | 126 | return $this->idEstatus; |
| 139 | 127 | } |
| 140 | - /** | |
| 141 | - * Constructor | |
| 142 | - */ | |
| 143 | - public function __construct() | |
| 144 | - { | |
| 145 | - $this->uc = new \Doctrine\Common\Collections\ArrayCollection(); | |
| 146 | - } | |
| 147 | - | |
| 148 | - /** | |
| 149 | - * Add uc | |
| 150 | - * | |
| 151 | - * @param \AppBundle\Entity\OfertaAcademica $uc | |
| 152 | - * @return Inscripcion | |
| 153 | - */ | |
| 154 | - public function addUc(\AppBundle\Entity\OfertaAcademica $uc) | |
| 155 | - { | |
| 156 | - $this->uc[] = $uc; | |
| 157 | - | |
| 158 | - return $this; | |
| 159 | - } | |
| 160 | - | |
| 161 | - /** | |
| 162 | - * Remove uc | |
| 163 | - * | |
| 164 | - * @param \AppBundle\Entity\OfertaAcademica $uc | |
| 165 | - */ | |
| 166 | - public function removeUc(\AppBundle\Entity\OfertaAcademica $uc) | |
| 167 | - { | |
| 168 | - $this->uc->removeElement($uc); | |
| 169 | - } | |
| 170 | - | |
| 171 | - /** | |
| 172 | - * Get uc | |
| 173 | - * | |
| 174 | - * @return \Doctrine\Common\Collections\Collection | |
| 175 | - */ | |
| 176 | - public function getUc() | |
| 177 | - { | |
| 178 | - return $this->uc; | |
| 179 | - } | |
| 180 | 128 | } | ... | ... |
src/AppBundle/Entity/Inscripcion.php~
| ... | ... | @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; |
| 7 | 7 | /** |
| 8 | 8 | * Inscripcion |
| 9 | 9 | * |
| 10 | - * @ORM\Table(name="inscripcion", uniqueConstraints={@ORM\UniqueConstraint(name="i_inscripcion", columns={"id_oferta_academica", "id_estado_academico"})}, indexes={@ORM\Index(name="oferta_academica_inscripcion", columns={"id_oferta_academica"}), @ORM\Index(name="fki_estado_academico_inscripcion", columns={"id_estado_academico"}), @ORM\Index(name="fki_estatus_inscripcion", columns={"id_estatus"})}) | |
| 10 | + * @ORM\Table(name="inscripcion") | |
| 11 | 11 | * @ORM\Entity |
| 12 | 12 | */ |
| 13 | 13 | class Inscripcion |
| ... | ... | @@ -23,30 +23,18 @@ class Inscripcion |
| 23 | 23 | private $id; |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @var \AppBundle\Entity\EstadoAcademico | |
| 27 | - * | |
| 28 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\EstadoAcademico") | |
| 29 | - * @ORM\JoinColumns({ | |
| 30 | - * @ORM\JoinColumn(name="id_estado_academico", referencedColumnName="id", nullable=false) | |
| 31 | - * }) | |
| 32 | - */ | |
| 26 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\EstadoAcademico", inversedBy="hasInscripcion") | |
| 27 | + * @ORM\JoinColumn(name="estado_academico_id", referencedColumnName="id") | |
| 28 | + * */ | |
| 33 | 29 | private $idEstadoAcademico; |
| 34 | 30 | |
| 35 | - /** | |
| 36 | - * @var \AppBundle\Entity\OfertaAcademica | |
| 37 | - * | |
| 38 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica") | |
| 39 | - * @ORM\JoinColumns({ | |
| 40 | - * @ORM\JoinColumn(name="id_oferta_academica", referencedColumnName="id", nullable=false) | |
| 41 | - * }) | |
| 42 | - */ | |
| 31 | + /** | |
| 32 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica", inversedBy="hasInscripcion") | |
| 33 | + * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") | |
| 34 | + * */ | |
| 43 | 35 | private $idOfertaAcademica; |
| 44 | 36 | |
| 45 | - /** | |
| 46 | - * @ORM\OneToMany(targetEntity="AppBundle\Entity\OfertaAcademica", mappedBy="id_malla_curricular_uc") | |
| 47 | - */ | |
| 48 | - private $uc; | |
| 49 | - | |
| 37 | + | |
| 50 | 38 | /** |
| 51 | 39 | * @var \AppBundle\Entity\Estatus |
| 52 | 40 | * |
| ... | ... | @@ -57,84 +45,5 @@ class Inscripcion |
| 57 | 45 | */ |
| 58 | 46 | private $idEstatus; |
| 59 | 47 | |
| 60 | - | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * Get id | |
| 64 | - * | |
| 65 | - * @return integer | |
| 66 | - */ | |
| 67 | - public function getId() | |
| 68 | - { | |
| 69 | - return $this->id; | |
| 70 | - } | |
| 71 | - | |
| 72 | - /** | |
| 73 | - * Set idEstadoAcademico | |
| 74 | - * | |
| 75 | - * @param \AppBundle\Entity\EstadoAcademico $idEstadoAcademico | |
| 76 | - * @return Inscripcion | |
| 77 | - */ | |
| 78 | - public function setIdEstadoAcademico(\AppBundle\Entity\EstadoAcademico $idEstadoAcademico) | |
| 79 | - { | |
| 80 | - $this->idEstadoAcademico = $idEstadoAcademico; | |
| 81 | - | |
| 82 | - return $this; | |
| 83 | - } | |
| 84 | - | |
| 85 | - /** | |
| 86 | - * Get idEstadoAcademico | |
| 87 | - * | |
| 88 | - * @return \AppBundle\Entity\EstadoAcademico | |
| 89 | - */ | |
| 90 | - public function getIdEstadoAcademico() | |
| 91 | - { | |
| 92 | - return $this->idEstadoAcademico; | |
| 93 | - } | |
| 94 | - | |
| 95 | - /** | |
| 96 | - * Set idOfertaAcademica | |
| 97 | - * | |
| 98 | - * @param \AppBundle\Entity\OfertaAcademica $idOfertaAcademica | |
| 99 | - * @return Inscripcion | |
| 100 | - */ | |
| 101 | - public function setIdOfertaAcademica(\AppBundle\Entity\OfertaAcademica $idOfertaAcademica) | |
| 102 | - { | |
| 103 | - $this->idOfertaAcademica = $idOfertaAcademica; | |
| 104 | - | |
| 105 | - return $this; | |
| 106 | - } | |
| 107 | - | |
| 108 | - /** | |
| 109 | - * Get idOfertaAcademica | |
| 110 | - * | |
| 111 | - * @return \AppBundle\Entity\OfertaAcademica | |
| 112 | - */ | |
| 113 | - public function getIdOfertaAcademica() | |
| 114 | - { | |
| 115 | - return $this->idOfertaAcademica; | |
| 116 | - } | |
| 117 | - | |
| 118 | - /** | |
| 119 | - * Set idEstatus | |
| 120 | - * | |
| 121 | - * @param \AppBundle\Entity\Estatus $idEstatus | |
| 122 | - * @return Inscripcion | |
| 123 | - */ | |
| 124 | - public function setIdEstatus(\AppBundle\Entity\Estatus $idEstatus) | |
| 125 | - { | |
| 126 | - $this->idEstatus = $idEstatus; | |
| 127 | - | |
| 128 | - return $this; | |
| 129 | - } | |
| 130 | - | |
| 131 | - /** | |
| 132 | - * Get idEstatus | |
| 133 | - * | |
| 134 | - * @return \AppBundle\Entity\Estatus | |
| 135 | - */ | |
| 136 | - public function getIdEstatus() | |
| 137 | - { | |
| 138 | - return $this->idEstatus; | |
| 139 | - } | |
| 48 | + | |
| 140 | 49 | } | ... | ... |
src/AppBundle/Entity/OfertaAcademica.php
| ... | ... | @@ -44,9 +44,15 @@ class OfertaAcademica |
| 44 | 44 | * @ORM\JoinColumn(name="id_malla_curricular_uc", referencedColumnName="id", nullable=false) |
| 45 | 45 | * }) |
| 46 | 46 | * |
| 47 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Inscripcion", inversedBy="uc") | |
| 48 | 47 | */ |
| 49 | 48 | private $idMallaCurricularUc; |
| 49 | + | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion" , mappedBy="idOfertaAcademica" , cascade={"all"}) | |
| 53 | + * */ | |
| 54 | + protected $hasInscripcion; | |
| 55 | + | |
| 50 | 56 | |
| 51 | 57 | /** |
| 52 | 58 | * @var \AppBundle\Entity\Turno |
| ... | ... | @@ -89,6 +95,15 @@ class OfertaAcademica |
| 89 | 95 | private $idOfertaMallaCurricular; |
| 90 | 96 | |
| 91 | 97 | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * Constructor | |
| 101 | + */ | |
| 102 | + public function __construct() | |
| 103 | + { | |
| 104 | + $this->hasInscripcion = new \Doctrine\Common\Collections\ArrayCollection(); | |
| 105 | + } | |
| 106 | + | |
| 92 | 107 | /** |
| 93 | 108 | * Set aula |
| 94 | 109 | * |
| ... | ... | @@ -148,10 +163,10 @@ class OfertaAcademica |
| 148 | 163 | /** |
| 149 | 164 | * Set idMallaCurricularUc |
| 150 | 165 | * |
| 151 | - * @param \AppBundle\Entity\MallaCurricularUC $idMallaCurricularUc | |
| 166 | + * @param \AppBundle\Entity\MallaCurricularUc $idMallaCurricularUc | |
| 152 | 167 | * @return OfertaAcademica |
| 153 | 168 | */ |
| 154 | - public function setIdMallaCurricularUc(\AppBundle\Entity\MallaCurricularUC $idMallaCurricularUc) | |
| 169 | + public function setIdMallaCurricularUc(\AppBundle\Entity\MallaCurricularUc $idMallaCurricularUc) | |
| 155 | 170 | { |
| 156 | 171 | $this->idMallaCurricularUc = $idMallaCurricularUc; |
| 157 | 172 | |
| ... | ... | @@ -161,7 +176,7 @@ class OfertaAcademica |
| 161 | 176 | /** |
| 162 | 177 | * Get idMallaCurricularUc |
| 163 | 178 | * |
| 164 | - * @return \AppBundle\Entity\MallaCurricularUC | |
| 179 | + * @return \AppBundle\Entity\MallaCurricularUc | |
| 165 | 180 | */ |
| 166 | 181 | public function getIdMallaCurricularUc() |
| 167 | 182 | { |
| ... | ... | @@ -169,6 +184,39 @@ class OfertaAcademica |
| 169 | 184 | } |
| 170 | 185 | |
| 171 | 186 | /** |
| 187 | + * Add hasInscripcion | |
| 188 | + * | |
| 189 | + * @param \AppBundle\Entity\Inscripcion $hasInscripcion | |
| 190 | + * @return OfertaAcademica | |
| 191 | + */ | |
| 192 | + public function addHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | |
| 193 | + { | |
| 194 | + $this->hasInscripcion[] = $hasInscripcion; | |
| 195 | + | |
| 196 | + return $this; | |
| 197 | + } | |
| 198 | + | |
| 199 | + /** | |
| 200 | + * Remove hasInscripcion | |
| 201 | + * | |
| 202 | + * @param \AppBundle\Entity\Inscripcion $hasInscripcion | |
| 203 | + */ | |
| 204 | + public function removeHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | |
| 205 | + { | |
| 206 | + $this->hasInscripcion->removeElement($hasInscripcion); | |
| 207 | + } | |
| 208 | + | |
| 209 | + /** | |
| 210 | + * Get hasInscripcion | |
| 211 | + * | |
| 212 | + * @return \Doctrine\Common\Collections\Collection | |
| 213 | + */ | |
| 214 | + public function getHasInscripcion() | |
| 215 | + { | |
| 216 | + return $this->hasInscripcion; | |
| 217 | + } | |
| 218 | + | |
| 219 | + /** | |
| 172 | 220 | * Set idTurno |
| 173 | 221 | * |
| 174 | 222 | * @param \AppBundle\Entity\Turno $idTurno |
| ... | ... | @@ -263,27 +311,4 @@ class OfertaAcademica |
| 263 | 311 | public function __toString() { |
| 264 | 312 | return $this->getIdMallaCurricularUc()->getIdUnidadCurricularVolumen()->getIdUnidadCurricular()->getNombre(); |
| 265 | 313 | } |
| 266 | - | |
| 267 | - /** | |
| 268 | - * Set inscripcion | |
| 269 | - * | |
| 270 | - * @param \AppBundle\Entity\MallaCurricularUc $inscripcion | |
| 271 | - * @return OfertaAcademica | |
| 272 | - */ | |
| 273 | - public function setInscripcion(\AppBundle\Entity\MallaCurricularUc $inscripcion) | |
| 274 | - { | |
| 275 | - $this->inscripcion = $inscripcion; | |
| 276 | - | |
| 277 | - return $this; | |
| 278 | - } | |
| 279 | - | |
| 280 | - /** | |
| 281 | - * Get inscripcion | |
| 282 | - * | |
| 283 | - * @return \AppBundle\Entity\MallaCurricularUc | |
| 284 | - */ | |
| 285 | - public function getInscripcion() | |
| 286 | - { | |
| 287 | - return $this->inscripcion; | |
| 288 | - } | |
| 289 | 314 | } | ... | ... |
src/AppBundle/Entity/OfertaAcademica.php~
| ... | ... | @@ -44,9 +44,15 @@ class OfertaAcademica |
| 44 | 44 | * @ORM\JoinColumn(name="id_malla_curricular_uc", referencedColumnName="id", nullable=false) |
| 45 | 45 | * }) |
| 46 | 46 | * |
| 47 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Inscripcion", inversedBy="uc") | |
| 48 | 47 | */ |
| 49 | - private $inscripcion; | |
| 48 | + private $idMallaCurricularUc; | |
| 49 | + | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion" , mappedBy="idOfertaAcademica" , cascade={"all"}) | |
| 53 | + * */ | |
| 54 | + protected $hasInscripcion; | |
| 55 | + | |
| 50 | 56 | |
| 51 | 57 | /** |
| 52 | 58 | * @var \AppBundle\Entity\Turno |
| ... | ... | @@ -89,178 +95,5 @@ class OfertaAcademica |
| 89 | 95 | private $idOfertaMallaCurricular; |
| 90 | 96 | |
| 91 | 97 | |
| 92 | - /** | |
| 93 | - * Set aula | |
| 94 | - * | |
| 95 | - * @param string $aula | |
| 96 | - * @return OfertaAcademica | |
| 97 | - */ | |
| 98 | - public function setAula($aula) | |
| 99 | - { | |
| 100 | - $this->aula = $aula; | |
| 101 | - | |
| 102 | - return $this; | |
| 103 | - } | |
| 104 | - | |
| 105 | - /** | |
| 106 | - * Get aula | |
| 107 | - * | |
| 108 | - * @return string | |
| 109 | - */ | |
| 110 | - public function getAula() | |
| 111 | - { | |
| 112 | - return $this->aula; | |
| 113 | - } | |
| 114 | - | |
| 115 | - /** | |
| 116 | - * Set cupo | |
| 117 | - * | |
| 118 | - * @param string $cupo | |
| 119 | - * @return OfertaAcademica | |
| 120 | - */ | |
| 121 | - public function setCupo($cupo) | |
| 122 | - { | |
| 123 | - $this->cupo = $cupo; | |
| 124 | - | |
| 125 | - return $this; | |
| 126 | - } | |
| 127 | - | |
| 128 | - /** | |
| 129 | - * Get cupo | |
| 130 | - * | |
| 131 | - * @return string | |
| 132 | - */ | |
| 133 | - public function getCupo() | |
| 134 | - { | |
| 135 | - return $this->cupo; | |
| 136 | - } | |
| 137 | - | |
| 138 | - /** | |
| 139 | - * Get id | |
| 140 | - * | |
| 141 | - * @return integer | |
| 142 | - */ | |
| 143 | - public function getId() | |
| 144 | - { | |
| 145 | - return $this->id; | |
| 146 | - } | |
| 147 | - | |
| 148 | - /** | |
| 149 | - * Set idMallaCurricularUc | |
| 150 | - * | |
| 151 | - * @param \AppBundle\Entity\MallaCurricularUC $idMallaCurricularUc | |
| 152 | - * @return OfertaAcademica | |
| 153 | - */ | |
| 154 | - public function setIdMallaCurricularUc(\AppBundle\Entity\MallaCurricularUC $idMallaCurricularUc) | |
| 155 | - { | |
| 156 | - $this->idMallaCurricularUc = $idMallaCurricularUc; | |
| 157 | - | |
| 158 | - return $this; | |
| 159 | - } | |
| 160 | - | |
| 161 | - /** | |
| 162 | - * Get idMallaCurricularUc | |
| 163 | - * | |
| 164 | - * @return \AppBundle\Entity\MallaCurricularUC | |
| 165 | - */ | |
| 166 | - public function getIdMallaCurricularUc() | |
| 167 | - { | |
| 168 | - return $this->idMallaCurricularUc; | |
| 169 | - } | |
| 170 | - | |
| 171 | - /** | |
| 172 | - * Set idTurno | |
| 173 | - * | |
| 174 | - * @param \AppBundle\Entity\Turno $idTurno | |
| 175 | - * @return OfertaAcademica | |
| 176 | - */ | |
| 177 | - public function setIdTurno(\AppBundle\Entity\Turno $idTurno) | |
| 178 | - { | |
| 179 | - $this->idTurno = $idTurno; | |
| 180 | - | |
| 181 | - return $this; | |
| 182 | - } | |
| 183 | - | |
| 184 | - /** | |
| 185 | - * Get idTurno | |
| 186 | - * | |
| 187 | - * @return \AppBundle\Entity\Turno | |
| 188 | - */ | |
| 189 | - public function getIdTurno() | |
| 190 | - { | |
| 191 | - return $this->idTurno; | |
| 192 | - } | |
| 193 | - | |
| 194 | - /** | |
| 195 | - * Set idSeccion | |
| 196 | - * | |
| 197 | - * @param \AppBundle\Entity\Seccion $idSeccion | |
| 198 | - * @return OfertaAcademica | |
| 199 | - */ | |
| 200 | - public function setIdSeccion(\AppBundle\Entity\Seccion $idSeccion) | |
| 201 | - { | |
| 202 | - $this->idSeccion = $idSeccion; | |
| 203 | - | |
| 204 | - return $this; | |
| 205 | - } | |
| 206 | - | |
| 207 | - /** | |
| 208 | - * Get idSeccion | |
| 209 | - * | |
| 210 | - * @return \AppBundle\Entity\Seccion | |
| 211 | - */ | |
| 212 | - public function getIdSeccion() | |
| 213 | - { | |
| 214 | - return $this->idSeccion; | |
| 215 | - } | |
| 216 | - | |
| 217 | - /** | |
| 218 | - * Set idRolInstitucion | |
| 219 | - * | |
| 220 | - * @param \AppBundle\Entity\RolInstitucion $idRolInstitucion | |
| 221 | - * @return OfertaAcademica | |
| 222 | - */ | |
| 223 | - public function setIdRolInstitucion(\AppBundle\Entity\RolInstitucion $idRolInstitucion) | |
| 224 | - { | |
| 225 | - $this->idRolInstitucion = $idRolInstitucion; | |
| 226 | - | |
| 227 | - return $this; | |
| 228 | - } | |
| 229 | - | |
| 230 | - /** | |
| 231 | - * Get idRolInstitucion | |
| 232 | - * | |
| 233 | - * @return \AppBundle\Entity\RolInstitucion | |
| 234 | - */ | |
| 235 | - public function getIdRolInstitucion() | |
| 236 | - { | |
| 237 | - return $this->idRolInstitucion; | |
| 238 | - } | |
| 239 | - | |
| 240 | - /** | |
| 241 | - * Set idOfertaMallaCurricular | |
| 242 | - * | |
| 243 | - * @param \AppBundle\Entity\OfertaMallaCurricular $idOfertaMallaCurricular | |
| 244 | - * @return OfertaAcademica | |
| 245 | - */ | |
| 246 | - public function setIdOfertaMallaCurricular(\AppBundle\Entity\OfertaMallaCurricular $idOfertaMallaCurricular) | |
| 247 | - { | |
| 248 | - $this->idOfertaMallaCurricular = $idOfertaMallaCurricular; | |
| 249 | - | |
| 250 | - return $this; | |
| 251 | - } | |
| 252 | - | |
| 253 | - /** | |
| 254 | - * Get idOfertaMallaCurricular | |
| 255 | - * | |
| 256 | - * @return \AppBundle\Entity\OfertaMallaCurricular | |
| 257 | - */ | |
| 258 | - public function getIdOfertaMallaCurricular() | |
| 259 | - { | |
| 260 | - return $this->idOfertaMallaCurricular; | |
| 261 | - } | |
| 262 | 98 | |
| 263 | - public function __toString() { | |
| 264 | - return $this->getIdMallaCurricularUc()->getIdUnidadCurricularVolumen()->getIdUnidadCurricular()->getNombre(); | |
| 265 | - } | |
| 266 | 99 | } | ... | ... |
src/AppBundle/Form/InscripcionType.php
| ... | ... | @@ -16,10 +16,10 @@ class InscripcionType extends AbstractType |
| 16 | 16 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 17 | 17 | { |
| 18 | 18 | $builder |
| 19 | - /*->add('idEstadoAcademico') | |
| 19 | + /*->add('idRolInstitucion') | |
| 20 | 20 | ->add('idOfertaAcademica') |
| 21 | 21 | ->add('idEstatus')*/ |
| 22 | - ->add('uc', EntityType::class, array( | |
| 22 | + ->add('OfertaAcademica', EntityType::class, array( | |
| 23 | 23 | 'class' => 'AppBundle:OfertaAcademica', |
| 24 | 24 | 'expanded' => true, |
| 25 | 25 | 'multiple' => true |
| ... | ... | @@ -33,7 +33,7 @@ class InscripcionType extends AbstractType |
| 33 | 33 | public function configureOptions(OptionsResolver $resolver) |
| 34 | 34 | { |
| 35 | 35 | $resolver->setDefaults(array( |
| 36 | - 'data_class' => 'AppBundle\Entity\Inscripcion', | |
| 36 | + 'data_class' => 'AppBundle\Entity\EstadoAcademico', | |
| 37 | 37 | )); |
| 38 | 38 | } |
| 39 | 39 | } | ... | ... |