collection-crud/src/Controller/PreviouslyOwnedLensesController.php

57 lines
1.6 KiB
PHP
Raw Normal View History

2017-11-30 15:06:13 -05:00
<?php
namespace App\Controller;
2017-11-30 15:06:13 -05:00
use App\Entity\PreviouslyOwnedLenses;
2018-07-16 13:50:07 -04:00
use App\Form\PreviouslyOwnedLensesType;
2017-11-30 15:06:13 -05:00
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
2018-07-11 09:18:46 -04:00
use Symfony\Component\Routing\Annotation\Route;
2017-11-30 15:06:13 -05:00
use Symfony\Component\HttpFoundation\Request;
/**
* @Route("previously-owned-lens")
*/
class PreviouslyOwnedLensesController extends Controller
{
2018-07-16 13:50:07 -04:00
use FormControllerTrait;
protected const ENTITY = PreviouslyOwnedLenses::class;
protected const FORM = PreviouslyOwnedLensesType::class;
2017-11-30 15:06:13 -05:00
/**
* Lists all previouslyOwnedLense entities.
*
2018-07-11 09:18:46 -04:00
* @Route("/", name="previously-owned-lens_index", methods={"GET"})
2017-11-30 15:06:13 -05:00
*/
public function indexAction()
{
2018-07-16 13:50:07 -04:00
return $this->itemListView('previouslyownedlenses/index.html.twig', 'previouslyOwnedLenses', [
2017-11-30 15:06:13 -05:00
'brand' => 'ASC',
'productLine' => 'ASC',
'mount' => 'ASC',
'minFocalLength' => 'ASC',
'maxFStop' => 'ASC',
]);
}
/**
* Finds and displays a previouslyOwnedLense entity.
*
2018-07-11 09:18:46 -04:00
* @Route("/{id}", name="previously-owned-lens_show", methods={"GET"})
2017-11-30 15:06:13 -05:00
*/
2018-07-16 13:50:07 -04:00
public function showAction(PreviouslyOwnedLenses $previouslyOwnedLens)
2017-11-30 15:06:13 -05:00
{
2018-07-16 13:50:07 -04:00
return $this->itemView($previouslyOwnedLens, 'previouslyownedlenses/show.html.twig', 'previouslyOwnedLense');
2017-11-30 15:06:13 -05:00
}
/**
* Displays a form to edit an existing previouslyOwnedLense entity.
*
2018-07-11 09:18:46 -04:00
* @Route("/{id}/edit", name="previously-owned-lens_edit", methods={"GET", "POST"})
2017-11-30 15:06:13 -05:00
*/
2018-07-16 13:50:07 -04:00
public function editAction(Request $request, PreviouslyOwnedLenses $previouslyOwnedLens)
2017-11-30 15:06:13 -05:00
{
2018-07-16 13:50:07 -04:00
return $this->itemUpdate($request, $previouslyOwnedLens, 'previouslyownedlenses/edit.html.twig', 'previouslyOwnedLense', 'previously-owned-lens_show');
2017-11-30 15:06:13 -05:00
}
}