Commit e40a9b34d4551551b792009083f6df6277c28188
1 parent
e5c4ad4d8f
Exists in
master
creado el estatus de inscripcion en espera y formalizada para controlar el flujo del proceso
Showing
4 changed files
with
213 additions
and
5 deletions
Show diff stats
src/AppBundle/Controller/InscripcionController.php
@@ -59,9 +59,10 @@ class InscripcionController extends Controller | @@ -59,9 +59,10 @@ class InscripcionController extends Controller | ||
59 | $em = $this->getDoctrine()->getManager(); | 59 | $em = $this->getDoctrine()->getManager(); |
60 | 60 | ||
61 | foreach ($request->request->get('seccion')['idSeccion'] as $s ){ | 61 | foreach ($request->request->get('seccion')['idSeccion'] as $s ){ |
62 | - $inscripcion = $this->getDoctrine()->getRepository('AppBundle:Seccion')->findOneById($s); | 62 | + $secc = $this->getDoctrine()->getRepository('AppBundle:Seccion')->findOneById($s); |
63 | + $estatus = $this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(2); | ||
63 | //var_dump($inscripcion->getId()); exit; | 64 | //var_dump($inscripcion->getId()); exit; |
64 | - $ea->setIdSeccion($inscripcion); | 65 | + $ea->setIdSeccion($secc, $estatus); |
65 | }; | 66 | }; |
66 | $em->persist($ea); | 67 | $em->persist($ea); |
67 | $em->flush(); | 68 | $em->flush(); |
src/AppBundle/Entity/EstadoAcademico.php
@@ -302,13 +302,13 @@ class EstadoAcademico | @@ -302,13 +302,13 @@ class EstadoAcademico | ||
302 | * Set idSeccion | 302 | * Set idSeccion |
303 | * | 303 | * |
304 | */ | 304 | */ |
305 | - public function setIdSeccion($idSeccion) | 305 | + public function setIdSeccion($idSeccion, $estatus) |
306 | { | 306 | { |
307 | 307 | ||
308 | $inscripcion = new Inscripcion(); | 308 | $inscripcion = new Inscripcion(); |
309 | $inscripcion->setIdEstadoAcademico($this); | 309 | $inscripcion->setIdEstadoAcademico($this); |
310 | $inscripcion->setIdSeccion($idSeccion); | 310 | $inscripcion->setIdSeccion($idSeccion); |
311 | - $inscripcion->setIdEstatus($this->getIdDocenteServicio()->getIdEstatus()); | 311 | + $inscripcion->setIdEstatus($estatus); |
312 | $this->addHasInscripcion($inscripcion); | 312 | $this->addHasInscripcion($inscripcion); |
313 | 313 | ||
314 | 314 |
src/AppBundle/Entity/Inscripcion.php
@@ -9,6 +9,7 @@ use Doctrine\ORM\Mapping as ORM; | @@ -9,6 +9,7 @@ use Doctrine\ORM\Mapping as ORM; | ||
9 | * | 9 | * |
10 | * @ORM\Table(name="inscripcion") | 10 | * @ORM\Table(name="inscripcion") |
11 | * @ORM\Entity | 11 | * @ORM\Entity |
12 | + * @ORM\HasLifecycleCallBacks() | ||
12 | */ | 13 | */ |
13 | class Inscripcion | 14 | class Inscripcion |
14 | { | 15 | { |
@@ -47,6 +48,46 @@ class Inscripcion | @@ -47,6 +48,46 @@ class Inscripcion | ||
47 | 48 | ||
48 | 49 | ||
49 | 50 | ||
51 | + /** | ||
52 | + * @var \DateTime | ||
53 | + * | ||
54 | + * @ORM\Column(name="fecha_creacion", type="date", nullable=false, options={"comment" = "fecha de creacion de la inscripcion"}) | ||
55 | + */ | ||
56 | + protected $created; | ||
57 | + | ||
58 | + | ||
59 | + /** | ||
60 | + * @var \DateTime | ||
61 | + * | ||
62 | + * @ORM\Column(name="fecha_ultima_actualizacion", type="date", nullable=false, options={"comment" = "fecha de actualizacion de la inscripcion"}) | ||
63 | + */ | ||
64 | + protected $modified; | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | ||
71 | + /** | ||
72 | + * @ORM\PrePersist | ||
73 | + */ | ||
74 | + public function prePersist() | ||
75 | + { | ||
76 | + | ||
77 | + $this->created = new \DateTime(); | ||
78 | + $this->modified = new \DateTime(); | ||
79 | + | ||
80 | + } | ||
81 | + | ||
82 | + | ||
83 | + /** | ||
84 | + * @ORM\PreUpdate | ||
85 | + */ | ||
86 | + public function preUpdate() | ||
87 | + { | ||
88 | + $this->modified = new \DateTime(); | ||
89 | + | ||
90 | + } | ||
50 | 91 | ||
51 | 92 | ||
52 | /** | 93 | /** |
@@ -127,4 +168,50 @@ class Inscripcion | @@ -127,4 +168,50 @@ class Inscripcion | ||
127 | { | 168 | { |
128 | return $this->idEstatus; | 169 | return $this->idEstatus; |
129 | } | 170 | } |
171 | + | ||
172 | + /** | ||
173 | + * Set created | ||
174 | + * | ||
175 | + * @param \DateTime $created | ||
176 | + * @return Inscripcion | ||
177 | + */ | ||
178 | + public function setCreated($created) | ||
179 | + { | ||
180 | + $this->created = $created; | ||
181 | + | ||
182 | + return $this; | ||
183 | + } | ||
184 | + | ||
185 | + /** | ||
186 | + * Get created | ||
187 | + * | ||
188 | + * @return \DateTime | ||
189 | + */ | ||
190 | + public function getCreated() | ||
191 | + { | ||
192 | + return $this->created; | ||
193 | + } | ||
194 | + | ||
195 | + /** | ||
196 | + * Set modified | ||
197 | + * | ||
198 | + * @param \DateTime $modified | ||
199 | + * @return Inscripcion | ||
200 | + */ | ||
201 | + public function setModified($modified) | ||
202 | + { | ||
203 | + $this->modified = $modified; | ||
204 | + | ||
205 | + return $this; | ||
206 | + } | ||
207 | + | ||
208 | + /** | ||
209 | + * Get modified | ||
210 | + * | ||
211 | + * @return \DateTime | ||
212 | + */ | ||
213 | + public function getModified() | ||
214 | + { | ||
215 | + return $this->modified; | ||
216 | + } | ||
130 | } | 217 | } |
src/AppBundle/Entity/Inscripcion.php~
@@ -9,6 +9,7 @@ use Doctrine\ORM\Mapping as ORM; | @@ -9,6 +9,7 @@ use Doctrine\ORM\Mapping as ORM; | ||
9 | * | 9 | * |
10 | * @ORM\Table(name="inscripcion") | 10 | * @ORM\Table(name="inscripcion") |
11 | * @ORM\Entity | 11 | * @ORM\Entity |
12 | + * @ORM\HasLifecycleCallBacks() | ||
12 | */ | 13 | */ |
13 | class Inscripcion | 14 | class Inscripcion |
14 | { | 15 | { |
@@ -29,7 +30,7 @@ class Inscripcion | @@ -29,7 +30,7 @@ class Inscripcion | ||
29 | private $idEstadoAcademico; | 30 | private $idEstadoAcademico; |
30 | 31 | ||
31 | /** | 32 | /** |
32 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica", inversedBy="hasInscripcion") | 33 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Seccion", inversedBy="hasInscripcion") |
33 | * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") | 34 | * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") |
34 | * */ | 35 | * */ |
35 | private $idSeccion; | 36 | private $idSeccion; |
@@ -47,5 +48,124 @@ class Inscripcion | @@ -47,5 +48,124 @@ class Inscripcion | ||
47 | 48 | ||
48 | 49 | ||
49 | 50 | ||
51 | + /** | ||
52 | + * @var \DateTime | ||
53 | + * | ||
54 | + * @ORM\Column(name="fecha_creacion", type="date", nullable=false, options={"comment" = "fecha de creacion de la inscripcion"}) | ||
55 | + */ | ||
56 | + protected $created; | ||
57 | + | ||
58 | + | ||
59 | + /** | ||
60 | + * @var \DateTime | ||
61 | + * | ||
62 | + * @ORM\Column(name="fecha_ultima_actualizacion", type="date", nullable=false, options={"comment" = "fecha de actualizacion de la inscripcion"}) | ||
63 | + */ | ||
64 | + protected $modified; | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | ||
71 | + /** | ||
72 | + * @ORM\PrePersist | ||
73 | + */ | ||
74 | + public function prePersist() | ||
75 | + { | ||
76 | + | ||
77 | + $this->created = new \DateTime(); | ||
78 | + $this->modified = new \DateTime(); | ||
79 | + | ||
80 | + } | ||
81 | + | ||
82 | + | ||
83 | + /** | ||
84 | + * @ORM\PreUpdate | ||
85 | + */ | ||
86 | + public function preUpdate() | ||
87 | + { | ||
88 | + $this->modified = new \DateTime(); | ||
89 | + | ||
90 | + } | ||
50 | 91 | ||
92 | + | ||
93 | + /** | ||
94 | + * Get id | ||
95 | + * | ||
96 | + * @return integer | ||
97 | + */ | ||
98 | + public function getId() | ||
99 | + { | ||
100 | + return $this->id; | ||
101 | + } | ||
102 | + | ||
103 | + /** | ||
104 | + * Set idEstadoAcademico | ||
105 | + * | ||
106 | + * @param \AppBundle\Entity\EstadoAcademico $idEstadoAcademico | ||
107 | + * @return Inscripcion | ||
108 | + */ | ||
109 | + public function setIdEstadoAcademico(\AppBundle\Entity\EstadoAcademico $idEstadoAcademico = null) | ||
110 | + { | ||
111 | + $this->idEstadoAcademico = $idEstadoAcademico; | ||
112 | + | ||
113 | + return $this; | ||
114 | + } | ||
115 | + | ||
116 | + /** | ||
117 | + * Get idEstadoAcademico | ||
118 | + * | ||
119 | + * @return \AppBundle\Entity\EstadoAcademico | ||
120 | + */ | ||
121 | + public function getIdEstadoAcademico() | ||
122 | + { | ||
123 | + return $this->idEstadoAcademico; | ||
124 | + } | ||
125 | + | ||
126 | + /** | ||
127 | + * Set idSeccion | ||
128 | + * | ||
129 | + * @param \AppBundle\Entity\Seccion $idSeccion | ||
130 | + * @return Inscripcion | ||
131 | + */ | ||
132 | + public function setIdSeccion(\AppBundle\Entity\Seccion $idSeccion = null) | ||
133 | + { | ||
134 | + $this->idSeccion = $idSeccion; | ||
135 | + | ||
136 | + return $this; | ||
137 | + } | ||
138 | + | ||
139 | + /** | ||
140 | + * Get idSeccion | ||
141 | + * | ||
142 | + * @return \AppBundle\Entity\Seccion | ||
143 | + */ | ||
144 | + public function getIdSeccion() | ||
145 | + { | ||
146 | + return $this->idSeccion; | ||
147 | + } | ||
148 | + | ||
149 | + /** | ||
150 | + * Set idEstatus | ||
151 | + * | ||
152 | + * @param \AppBundle\Entity\Estatus $idEstatus | ||
153 | + * @return Inscripcion | ||
154 | + */ | ||
155 | + public function setIdEstatus(\AppBundle\Entity\Estatus $idEstatus) | ||
156 | + { | ||
157 | + $this->idEstatus = $idEstatus; | ||
158 | + | ||
159 | + return $this; | ||
160 | + } | ||
161 | + | ||
162 | + /** | ||
163 | + * Get idEstatus | ||
164 | + * | ||
165 | + * @return \AppBundle\Entity\Estatus | ||
166 | + */ | ||
167 | + public function getIdEstatus() | ||
168 | + { | ||
169 | + return $this->idEstatus; | ||
170 | + } | ||
51 | } | 171 | } |