itemListView('lenses/index.html.twig', 'lenses', [ 'received' => 'DESC', 'brand' => 'ASC', 'productLine' => 'ASC', 'mount' => 'ASC', 'minFocalLength' => 'ASC', 'maxFStop' => 'ASC', ]); } /** * Creates a new lens entity. * * @Route("/new", name="lens_new", methods={"GET", "POST"}) */ public function newAction(Request $request) { return $this->itemCreate($request, 'lenses/new.html.twig', 'lense', 'lens_show'); } /** * Finds and displays a lens entity. * * @Route("/{id}", name="lens_show", methods={"GET"}) */ public function showAction(Lenses $lens) { return $this->itemView($lens, 'lenses/show.html.twig', 'lense'); } /** * Displays a form to edit an existing lens entity. * * @Route("/{id}/edit", name="lens_edit", methods={"GET", "POST"}) */ public function editAction(Request $request, Lenses $lens) { return $this->itemUpdate($request, $lens, 'lenses/edit.html.twig', 'lense', 'lens_show'); } /** * Moves a camera to the previouslyOwned table * * @Route("/{id}/deacquire", name="lens_deacquire", methods={"POST"}) * @param Request $request * @param Lenses $lens * @return RedirectResponse */ public function deacquireAction(Request $request, Lenses $lens) { return $this->itemDeacquire($request, $lens, 'previously-owned-lens_index'); } /** * Deletes a lens entity. * * @Route("/{id}", name="lens_delete", methods={"DELETE"}) */ public function deleteAction(Request $request, Lenses $lens) { return $this->itemDelete($request, $lens, 'lens_index'); } /** * Creates a form to delete a lens entity. * * @param Lenses $lens The lens entity * * @return FormInterface The form */ private function createDeleteForm(Lenses $lens): FormInterface { return $this->buildForm($lens, 'lens_delete', 'DELETE'); } /** * Creates a form to move * * @param Lenses $lens The lens entity * * @return FormInterface */ private function createDeacquireForm(Lenses $lens): FormInterface { return $this->buildForm($lens, 'lens_deacquire'); } }