collection-crud/src/Controller/PreviouslyOwnedLensesContro...

57 lines
1.7 KiB
PHP
Raw Normal View History

2018-07-18 11:35:27 -04:00
<?php declare(strict_types=1);
2017-11-30 15:06:13 -05:00
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;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
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 AbstractController
2017-11-30 15:06:13 -05:00
{
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
}
}