<?php
namespace App\Controller\Dashboard\Websites;
use App\Component\ViewLayer\Views\AbstractHtmlView;
use App\Controller\PaginationTrait;
use Cms\Modules\PageBundle\Entity\Page\PageProxy;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
/**
*
* @Route(
* "/content/legacy.page",
* )
*/
final class LegacyPageController extends AbstractContentController
{
const ROUTES__LIST = 'app.app.dashboard.websites.content.legacy.page.list';
const ROUTES__UPDATE = 'app.app.dashboard.websites.content.legacy.page.update';
const ROUTES__DELETE = 'app.app.dashboard.websites.content.legacy.page.delete';
use PaginationTrait;
/**
* @param int $pagination
* @return AbstractHtmlView|RedirectResponse
*
* @Route(
* "/list/{pagination}",
* name = self::ROUTES__LIST,
* requirements = {
* "pagination" = "[1-9]\d*",
* },
* defaults = {
* "pagination" = 0,
* },
* )
*/
public function listAction(int $pagination = 0)
{
return $this->listLegacyLogic(
PageProxy::class,
$pagination
);
}
/**
* @param PageProxy $object
* @return RedirectResponse
*
* @Route(
* "/{object}/update",
* name = self::ROUTES__UPDATE,
* requirements = {
* "object" = "[1-9]\d*",
* },
* )
* @ParamConverter(
* "object",
* class = PageProxy::class,
* converter = "doctrine.orm"
* )
*/
public function updateAction(PageProxy $object): RedirectResponse
{
return $this->updateLegacyLogic(
$object,
$this->generateUrl(self::ROUTES__LIST)
);
}
/**
* @return AbstractHtmlView|RedirectResponse
*
* @Route(
* "/{object}/delete",
* name = self::ROUTES__DELETE,
* requirements = {
* "object" = "[1-9]\d*",
* },
* )
* @ParamConverter(
* "object",
* class = PageProxy::class,
* converter = "doctrine.orm",
* )
*/
public function deleteAction(PageProxy $object)
{
return $this->deleteLegacyLogic(
$object,
self::ROUTES__LIST
);
}
}