vendor/store.shopware.com/swagb2bplatform/components/Address/BridgePlatform/CheckoutAddressSelectPreventerStorefrontV640.php line 46

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\B2B\Address\BridgePlatform;
  3. use Shopware\B2B\StoreFrontAuthentication\Framework\AuthenticationService;
  4. use Shopware\Core\Checkout\Customer\CustomerEntity;
  5. use Shopware\Core\Framework\Routing\Annotation\LoginRequired;
  6. use Shopware\Core\Framework\Routing\Annotation\RouteScope;
  7. use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
  8. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  9. use Shopware\Storefront\Controller\AddressController;
  10. use Symfony\Component\HttpFoundation\RedirectResponse;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. /**
  14.  * @RouteScope(scopes={"storefront"})
  15.  */
  16. class CheckoutAddressSelectPreventerStorefrontV640 extends AddressController
  17. {
  18.     private AddressController $decorated;
  19.     private AuthenticationService $authenticationService;
  20.     public function __construct(AddressController $decoratedAuthenticationService $authenticationService)
  21.     {
  22.         $this->decorated $decorated;
  23.         $this->authenticationService $authenticationService;
  24.     }
  25.     /**
  26.      * @LoginRequired(allowGuest=true)
  27.      */
  28.     public function addressBook(Request $requestRequestDataBag $dataBagSalesChannelContext $contextCustomerEntity $customer): Response
  29.     {
  30.         if ($this->authenticationService->isB2B()) {
  31.             throw $this->decorated->createNotFoundException();
  32.         }
  33.         return $this->decorated->addressBook($request$dataBag$context$customer);
  34.     }
  35.     /**
  36.      * @LoginRequired()
  37.      */
  38.     public function accountAddressOverview(Request $requestSalesChannelContext $contextCustomerEntity $customer): Response
  39.     {
  40.         return $this->decorated->accountAddressOverview($request$context$customer);
  41.     }
  42.     /**
  43.      * @LoginRequired()
  44.      */
  45.     public function accountCreateAddress(Request $requestRequestDataBag $dataSalesChannelContext $contextCustomerEntity $customer): Response
  46.     {
  47.         if ($this->authenticationService->isB2B()) {
  48.             throw $this->decorated->createNotFoundException();
  49.         }
  50.         return $this->decorated->accountCreateAddress($request$data$context$customer);
  51.     }
  52.     /**
  53.      * @LoginRequired()
  54.      */
  55.     public function accountEditAddress(Request $requestSalesChannelContext $contextCustomerEntity $customer): Response
  56.     {
  57.         return $this->decorated->accountEditAddress($request$context$customer);
  58.     }
  59.     /**
  60.      * @LoginRequired()
  61.      */
  62.     public function switchDefaultAddress(string $typestring $addressIdSalesChannelContext $contextCustomerEntity $customer): RedirectResponse
  63.     {
  64.         return $this->decorated->switchDefaultAddress($type$addressId$context$customer);
  65.     }
  66.     /**
  67.      * @LoginRequired()
  68.      */
  69.     public function deleteAddress(string $addressIdSalesChannelContext $contextCustomerEntity $customer): Response
  70.     {
  71.         return $this->decorated->deleteAddress($addressId$context$customer);
  72.     }
  73.     /**
  74.      * @LoginRequired()
  75.      */
  76.     public function saveAddress(RequestDataBag $dataSalesChannelContext $contextCustomerEntity $customer): Response
  77.     {
  78.         if ($this->authenticationService->isB2B()) {
  79.             throw $this->createNotFoundException();
  80.         }
  81.         return $this->decorated->saveAddress($data$context$customer);
  82.     }
  83. }