getDoctrine()->getManager(); $previouslyOwnedLenses = $em->getRepository('App:PreviouslyOwnedLenses')->findBy([], [ 'brand' => 'ASC', 'productLine' => 'ASC', 'mount' => 'ASC', 'minFocalLength' => 'ASC', 'maxFStop' => 'ASC', ]); return $this->render('previouslyownedlenses/index.html.twig', array( 'previouslyOwnedLenses' => $previouslyOwnedLenses, )); } /** * Finds and displays a previouslyOwnedLense entity. * * @Route("/{id}", name="previously-owned-lens_show") * @Method("GET") */ public function showAction(PreviouslyOwnedLenses $previouslyOwnedLense) { return $this->render('previouslyownedlenses/show.html.twig', array( 'previouslyOwnedLense' => $previouslyOwnedLense, )); } /** * Displays a form to edit an existing previouslyOwnedLense entity. * * @Route("/{id}/edit", name="previously-owned-lens_edit") * @Method({"GET", "POST"}) */ public function editAction(Request $request, PreviouslyOwnedLenses $previouslyOwnedLense) { $editForm = $this->createForm('App\Form\PreviouslyOwnedLensesType', $previouslyOwnedLense); $editForm->handleRequest($request); if ($editForm->isSubmitted() && $editForm->isValid()) { $this->getDoctrine()->getManager()->flush(); return $this->redirectToRoute('previously-owned-lens_edit', array('id' => $previouslyOwnedLense->getId())); } return $this->render('previouslyownedlenses/edit.html.twig', array( 'previouslyOwnedLense' => $previouslyOwnedLense, 'edit_form' => $editForm->createView(), )); } }