2018-07-18 11:35:27 -04:00
|
|
|
<?php declare(strict_types=1);
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2018-02-14 16:42:39 -05:00
|
|
|
namespace App\Controller;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
2018-02-14 16:42:39 -05:00
|
|
|
use App\Entity\PreviouslyOwnedLenses;
|
2018-07-16 13:50:07 -04:00
|
|
|
use App\Form\PreviouslyOwnedLensesType;
|
2018-11-30 16:01:30 -05:00
|
|
|
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;
|
|
|
|
|
2022-02-17 15:16:47 -05:00
|
|
|
#[Route(path: 'previously-owned-lens')]
|
2018-11-30 16:01:30 -05:00
|
|
|
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.
|
|
|
|
*/
|
2022-02-17 15:16:47 -05:00
|
|
|
#[Route(path: '/', 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.
|
|
|
|
*/
|
2022-02-17 15:16:47 -05:00
|
|
|
#[Route(path: '/{id}', name: 'previously-owned-lens_show', methods: ['GET'])]
|
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.
|
|
|
|
*/
|
2022-02-17 15:16:47 -05:00
|
|
|
#[Route(path: '/{id}/edit', name: 'previously-owned-lens_edit', methods: ['GET', 'POST'])]
|
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
|
|
|
}
|
|
|
|
}
|