src/App/Controller/Dashboard/Websites/LegacyPageController.php line 43

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Dashboard\Websites;
  3. use App\Component\ViewLayer\Views\AbstractHtmlView;
  4. use App\Controller\PaginationTrait;
  5. use Cms\Modules\PageBundle\Entity\Page\PageProxy;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  7. use Symfony\Component\HttpFoundation\RedirectResponse;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. /**
  10.  *
  11.  * @Route(
  12.  *     "/content/legacy.page",
  13.  * )
  14.  */
  15. final class LegacyPageController extends AbstractContentController
  16. {
  17.     const ROUTES__LIST 'app.app.dashboard.websites.content.legacy.page.list';
  18.     const ROUTES__UPDATE 'app.app.dashboard.websites.content.legacy.page.update';
  19.     const ROUTES__DELETE 'app.app.dashboard.websites.content.legacy.page.delete';
  20.     use PaginationTrait;
  21.     /**
  22.      * @param int $pagination
  23.      * @return AbstractHtmlView|RedirectResponse
  24.      *
  25.      * @Route(
  26.      *     "/list/{pagination}",
  27.      *     name = self::ROUTES__LIST,
  28.      *     requirements = {
  29.      *         "pagination" = "[1-9]\d*",
  30.      *     },
  31.      *     defaults = {
  32.      *         "pagination" = 0,
  33.      *     },
  34.      * )
  35.      */
  36.     public function listAction(int $pagination 0)
  37.     {
  38.         return $this->listLegacyLogic(
  39.             PageProxy::class,
  40.             $pagination
  41.         );
  42.     }
  43.     /**
  44.      * @param PageProxy $object
  45.      * @return RedirectResponse
  46.      *
  47.      * @Route(
  48.      *     "/{object}/update",
  49.      *     name = self::ROUTES__UPDATE,
  50.      *     requirements = {
  51.      *         "object" = "[1-9]\d*",
  52.      *     },
  53.      * )
  54.      * @ParamConverter(
  55.      *     "object",
  56.      *     class = PageProxy::class,
  57.      *     converter = "doctrine.orm"
  58.      * )
  59.      */
  60.     public function updateAction(PageProxy $object): RedirectResponse
  61.     {
  62.         return $this->updateLegacyLogic(
  63.             $object,
  64.             $this->generateUrl(self::ROUTES__LIST)
  65.         );
  66.     }
  67.     /**
  68.      * @return AbstractHtmlView|RedirectResponse
  69.      *
  70.      * @Route(
  71.      *     "/{object}/delete",
  72.      *     name = self::ROUTES__DELETE,
  73.      *     requirements = {
  74.      *         "object" = "[1-9]\d*",
  75.      *     },
  76.      * )
  77.      * @ParamConverter(
  78.      *     "object",
  79.      *     class = PageProxy::class,
  80.      *     converter = "doctrine.orm",
  81.      * )
  82.      */
  83.     public function deleteAction(PageProxy $object)
  84.     {
  85.         return $this->deleteLegacyLogic(
  86.             $object,
  87.             self::ROUTES__LIST
  88.         );
  89.     }
  90. }