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\PreviouslyOwnedFlash;
|
2018-07-16 13:10:00 -04:00
|
|
|
use App\Form\PreviouslyOwnedFlashType;
|
2022-02-18 11:34:25 -05:00
|
|
|
use Doctrine\Persistence\ManagerRegistry;
|
2018-11-30 16:01:30 -05:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
2022-03-03 11:15:12 -05:00
|
|
|
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
2018-07-11 09:18:46 -04:00
|
|
|
use Symfony\Component\Routing\Annotation\Route;
|
2017-11-30 15:06:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Previouslyownedflash controller.
|
|
|
|
*/
|
2022-02-17 15:16:47 -05:00
|
|
|
#[Route(path: 'previously-owned-flash')]
|
2018-11-30 16:01:30 -05:00
|
|
|
class PreviouslyOwnedFlashController extends AbstractController
|
2017-11-30 15:06:13 -05:00
|
|
|
{
|
2022-03-03 10:53:48 -05:00
|
|
|
use FormControllerTrait;
|
2022-02-18 11:34:25 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
protected const ENTITY = PreviouslyOwnedFlash::class;
|
|
|
|
protected const FORM = PreviouslyOwnedFlashType::class;
|
2022-02-18 11:34:25 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
|
|
|
{
|
|
|
|
}
|
2022-02-18 11:34:25 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
/**
|
|
|
|
* Lists all previouslyOwnedFlash entities.
|
|
|
|
*/
|
|
|
|
#[Route(path: '/', name: 'previously-owned-flash_index', methods: ['GET'])]
|
|
|
|
public function indexAction(): Response
|
|
|
|
{
|
|
|
|
return $this->itemListView('previouslyownedflash/index.html.twig', 'previouslyOwnedFlashes');
|
|
|
|
}
|
2022-02-18 11:34:25 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
/**
|
|
|
|
* Creates a new previouslyOwnedFlash entity.
|
|
|
|
*/
|
|
|
|
#[Route(path: '/new', name: 'previously-owned-flash_new', methods: ['GET', 'POST'])]
|
|
|
|
public function newAction(Request $request): RedirectResponse|Response
|
|
|
|
{
|
|
|
|
return $this->itemCreate($request, 'previouslyownedflash/new.html.twig', 'previouslyOwnedFlash', 'previously-owned-flash_show');
|
|
|
|
}
|
2022-02-18 11:34:25 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
/**
|
|
|
|
* Finds and displays a previouslyOwnedFlash entity.
|
|
|
|
*/
|
|
|
|
#[Route(path: '/{id}', name: 'previously-owned-flash_show', methods: ['GET'])]
|
|
|
|
public function showAction(PreviouslyOwnedFlash $previouslyOwnedFlash): Response
|
|
|
|
{
|
|
|
|
return $this->itemView($previouslyOwnedFlash, 'previouslyownedcamera/show.html.twig', 'previouslyOwnedFlash');
|
|
|
|
}
|
2022-02-18 11:34:25 -05:00
|
|
|
|
2022-03-03 10:53:48 -05:00
|
|
|
/**
|
|
|
|
* Displays a form to edit an existing previouslyOwnedFlash entity.
|
|
|
|
*/
|
|
|
|
#[Route(path: '/{id}/edit', name: 'previously-owned-flash_edit', methods: ['GET', 'POST'])]
|
|
|
|
public function editAction(Request $request, PreviouslyOwnedFlash $previouslyOwnedFlash): RedirectResponse|Response
|
|
|
|
{
|
|
|
|
return $this->itemUpdate($request, $previouslyOwnedFlash, 'previouslyownedflash/edit.html.twig', 'previouslyOwnedFlash', 'previously-owned-flash_show');
|
|
|
|
}
|
2017-11-30 15:06:13 -05:00
|
|
|
}
|