diff --git a/src/AppBundle/Controller/InscripcionController.php b/src/AppBundle/Controller/InscripcionController.php index 027cb4f..4c98c44 100644 --- a/src/AppBundle/Controller/InscripcionController.php +++ b/src/AppBundle/Controller/InscripcionController.php @@ -59,9 +59,10 @@ class InscripcionController extends Controller $em = $this->getDoctrine()->getManager(); foreach ($request->request->get('seccion')['idSeccion'] as $s ){ - $inscripcion = $this->getDoctrine()->getRepository('AppBundle:Seccion')->findOneById($s); + $secc = $this->getDoctrine()->getRepository('AppBundle:Seccion')->findOneById($s); + $estatus = $this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(2); //var_dump($inscripcion->getId()); exit; - $ea->setIdSeccion($inscripcion); + $ea->setIdSeccion($secc, $estatus); }; $em->persist($ea); $em->flush(); diff --git a/src/AppBundle/Entity/EstadoAcademico.php b/src/AppBundle/Entity/EstadoAcademico.php index fbfd367..ab35aab 100644 --- a/src/AppBundle/Entity/EstadoAcademico.php +++ b/src/AppBundle/Entity/EstadoAcademico.php @@ -302,13 +302,13 @@ class EstadoAcademico * Set idSeccion * */ - public function setIdSeccion($idSeccion) + public function setIdSeccion($idSeccion, $estatus) { $inscripcion = new Inscripcion(); $inscripcion->setIdEstadoAcademico($this); $inscripcion->setIdSeccion($idSeccion); - $inscripcion->setIdEstatus($this->getIdDocenteServicio()->getIdEstatus()); + $inscripcion->setIdEstatus($estatus); $this->addHasInscripcion($inscripcion); diff --git a/src/AppBundle/Entity/Inscripcion.php b/src/AppBundle/Entity/Inscripcion.php index 24f3e7a..5cee4d4 100644 --- a/src/AppBundle/Entity/Inscripcion.php +++ b/src/AppBundle/Entity/Inscripcion.php @@ -9,6 +9,7 @@ use Doctrine\ORM\Mapping as ORM; * * @ORM\Table(name="inscripcion") * @ORM\Entity + * @ORM\HasLifecycleCallBacks() */ class Inscripcion { @@ -47,6 +48,46 @@ class Inscripcion + /** + * @var \DateTime + * + * @ORM\Column(name="fecha_creacion", type="date", nullable=false, options={"comment" = "fecha de creacion de la inscripcion"}) + */ + protected $created; + + + /** + * @var \DateTime + * + * @ORM\Column(name="fecha_ultima_actualizacion", type="date", nullable=false, options={"comment" = "fecha de actualizacion de la inscripcion"}) + */ + protected $modified; + + + + + + + /** + * @ORM\PrePersist + */ + public function prePersist() + { + + $this->created = new \DateTime(); + $this->modified = new \DateTime(); + + } + + + /** + * @ORM\PreUpdate + */ + public function preUpdate() + { + $this->modified = new \DateTime(); + + } /** @@ -127,4 +168,50 @@ class Inscripcion { return $this->idEstatus; } + + /** + * Set created + * + * @param \DateTime $created + * @return Inscripcion + */ + public function setCreated($created) + { + $this->created = $created; + + return $this; + } + + /** + * Get created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->created; + } + + /** + * Set modified + * + * @param \DateTime $modified + * @return Inscripcion + */ + public function setModified($modified) + { + $this->modified = $modified; + + return $this; + } + + /** + * Get modified + * + * @return \DateTime + */ + public function getModified() + { + return $this->modified; + } } diff --git a/src/AppBundle/Entity/Inscripcion.php~ b/src/AppBundle/Entity/Inscripcion.php~ index 0b51caa..9a8eb52 100644 --- a/src/AppBundle/Entity/Inscripcion.php~ +++ b/src/AppBundle/Entity/Inscripcion.php~ @@ -9,6 +9,7 @@ use Doctrine\ORM\Mapping as ORM; * * @ORM\Table(name="inscripcion") * @ORM\Entity + * @ORM\HasLifecycleCallBacks() */ class Inscripcion { @@ -29,7 +30,7 @@ class Inscripcion private $idEstadoAcademico; /** - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica", inversedBy="hasInscripcion") + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Seccion", inversedBy="hasInscripcion") * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") * */ private $idSeccion; @@ -47,5 +48,124 @@ class Inscripcion + /** + * @var \DateTime + * + * @ORM\Column(name="fecha_creacion", type="date", nullable=false, options={"comment" = "fecha de creacion de la inscripcion"}) + */ + protected $created; + + + /** + * @var \DateTime + * + * @ORM\Column(name="fecha_ultima_actualizacion", type="date", nullable=false, options={"comment" = "fecha de actualizacion de la inscripcion"}) + */ + protected $modified; + + + + + + + /** + * @ORM\PrePersist + */ + public function prePersist() + { + + $this->created = new \DateTime(); + $this->modified = new \DateTime(); + + } + + + /** + * @ORM\PreUpdate + */ + public function preUpdate() + { + $this->modified = new \DateTime(); + + } + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set idEstadoAcademico + * + * @param \AppBundle\Entity\EstadoAcademico $idEstadoAcademico + * @return Inscripcion + */ + public function setIdEstadoAcademico(\AppBundle\Entity\EstadoAcademico $idEstadoAcademico = null) + { + $this->idEstadoAcademico = $idEstadoAcademico; + + return $this; + } + + /** + * Get idEstadoAcademico + * + * @return \AppBundle\Entity\EstadoAcademico + */ + public function getIdEstadoAcademico() + { + return $this->idEstadoAcademico; + } + + /** + * Set idSeccion + * + * @param \AppBundle\Entity\Seccion $idSeccion + * @return Inscripcion + */ + public function setIdSeccion(\AppBundle\Entity\Seccion $idSeccion = null) + { + $this->idSeccion = $idSeccion; + + return $this; + } + + /** + * Get idSeccion + * + * @return \AppBundle\Entity\Seccion + */ + public function getIdSeccion() + { + return $this->idSeccion; + } + + /** + * Set idEstatus + * + * @param \AppBundle\Entity\Estatus $idEstatus + * @return Inscripcion + */ + public function setIdEstatus(\AppBundle\Entity\Estatus $idEstatus) + { + $this->idEstatus = $idEstatus; + + return $this; + } + + /** + * Get idEstatus + * + * @return \AppBundle\Entity\Estatus + */ + public function getIdEstatus() + { + return $this->idEstatus; + } }