custom/plugins/TemplaidInvoices/src/Controller/ListController.php line 50

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace TemplaidInvoices\Controller;
  3. use Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Exception\InconsistentCriteriaIdsException;
  5. use Shopware\Core\Framework\Routing\Annotation\LoginRequired;
  6. use Shopware\Core\Framework\Routing\Annotation\RouteScope;
  7. use Shopware\Core\Framework\Routing\Annotation\Since;
  8. use Shopware\Core\Framework\Routing\Exception\MissingRequestParameterException;
  9. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  10. use Shopware\Storefront\Controller\StorefrontController;
  11. use Shopware\Storefront\Framework\Routing\Annotation\NoStore;
  12. use Symfony\Component\HttpFoundation\JsonResponse;
  13. use Symfony\Component\HttpFoundation\Request;
  14. use Symfony\Component\HttpFoundation\Response;
  15. use Symfony\Component\HttpKernel\EventListener\AbstractSessionListener;
  16. use Symfony\Component\Routing\Annotation\Route;
  17. use TemplaidInvoices\Storefront\Page\Account\TemplaidAssortmentPageLoader;
  18. /**
  19.  * @RouteScope(scopes={"storefront"})
  20.  */
  21. class ListController extends StorefrontController
  22. {
  23.     private TemplaidAssortmentPageLoader $assortmentPageLoader;
  24.     public function __construct(
  25.         TemplaidAssortmentPageLoader $assortmentPageLoader
  26.     )
  27.     {
  28.         $this->assortmentPageLoader $assortmentPageLoader;
  29.     }
  30.     /**
  31.      * @Since("6.0.0.0")
  32.      * @LoginRequired()
  33.      * @Route("/account/assortment/{list}/{listId}", name="frontend.templaid.assortment.page", options={"seo"="false"}, methods={"GET", "POST"}, defaults={"XmlHttpRequest"=true})
  34.      * @NoStore()
  35.      *
  36.      * @throws CustomerNotLoggedInException
  37.      * @throws InconsistentCriteriaIdsException
  38.      * @throws MissingRequestParameterException
  39.      * @throws \Exception
  40.      */
  41.     public function invoices(string $liststring $listIdRequest $requestSalesChannelContext $context): Response
  42.     {
  43.         $page $this->assortmentPageLoader->load($request$context);
  44.         return $this->renderStorefront('@Storefront/storefront/page/account/assortment.html.twig', ['page' => $page'list' => $list'listId' => $listId]);
  45.     }
  46. }