Commit 9148653e742993cda05f5a1ad588f7f453a32bb9

Authored by Bruno Menezes
1 parent 5701b3da
Exists in master and in 1 other branch 3.1

removendo NotFoundException desnecessário

src/Cacic/CommonBundle/Controller/ComputadorController.php
@@ -175,6 +175,7 @@ class ComputadorController extends Controller @@ -175,6 +175,7 @@ class ComputadorController extends Controller
175 public function updateAction( Request $request, $idComputador) 175 public function updateAction( Request $request, $idComputador)
176 { 176 {
177 $computador = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Computador' )->find( $idComputador ); 177 $computador = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Computador' )->find( $idComputador );
  178 +
178 if ( !$computador ) 179 if ( !$computador )
179 throw $this->createNotFoundException( 'Computador não encontrado' ); 180 throw $this->createNotFoundException( 'Computador não encontrado' );
180 else 181 else
@@ -183,8 +184,6 @@ class ComputadorController extends Controller @@ -183,8 +184,6 @@ class ComputadorController extends Controller
183 $this->getDoctrine()->getManager()->persist( $computador ); 184 $this->getDoctrine()->getManager()->persist( $computador );
184 $this->getDoctrine()->getManager()->flush(); 185 $this->getDoctrine()->getManager()->flush();
185 186
186 - throw $this->createNotFoundException( 'Computador não encontrado' );  
187 -  
188 return $this->redirect($this->generateUrl('cacic_computador_coletar') ); 187 return $this->redirect($this->generateUrl('cacic_computador_coletar') );
189 } 188 }
190 189