src/Controller/Bikers/SecurityWidgetController.php line 44

Open in your IDE?
  1. <?php
  2. namespace BitBag\OpenMarketplace\Controller\Bikers;
  3. use FOS\RestBundle\View\View;
  4. use Sylius\Bundle\OrderBundle\Controller\OrderController as BaseOrderController;
  5. use Sylius\Component\Core\Repository\OrderRepositoryInterface;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Templating\EngineInterface;
  9. use Twig\Environment;
  10. use Webmozart\Assert\Assert;
  11. final class SecurityWidgetController extends BaseOrderController
  12. {
  13. //    public function __construct(private EngineInterface|Environment $templatingEngine)
  14. //    {
  15. //    }
  16.     public function renderAction(Request $requeststring $urlpath): Response
  17.     {
  18.         $configuration $this->requestConfigurationFactory->create($this->metadata$request);
  19.         $cart $this->getCurrentCart();
  20.         $d 0;
  21.         if (null !== $cart->getId()) {
  22.             $orderRepository $this->getOrderRepository();
  23.             Assert::isInstanceOf($orderRepositoryOrderRepositoryInterface::class);
  24.             $cart $orderRepository->findCartForSummary($cart->getId());
  25.             $items $cart->getItems();
  26.             $d count($items);
  27.         }
  28.         if (!$configuration->isHtmlRequest()) {
  29.             return $this->viewHandler->handle($configurationView::create($cart));
  30.         }
  31.         return $this->render('@SyliusShop/Menu/_security.html.twig', [
  32.             'cart' => $cart,
  33.             'count' => $d,
  34.             'urlpath' => $urlpath,
  35.         ]);
  36.     }
  37. }