custom/plugins/DreiscSeoPro/src/Decorator/Shopware/Storefront/Routing/RequestTransformerDecorator.php line 39

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace DreiscSeoPro\Decorator\Shopware\Storefront\Routing;
  3. use DreiscSeoPro\Core\Routing\RequestTransformer;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Exception\InconsistentCriteriaIdsException;
  5. use Shopware\Core\Framework\Routing\RequestTransformerInterface;
  6. use Shopware\Storefront\Framework\Routing\Exception\SalesChannelMappingException;
  7. use Symfony\Component\HttpFoundation\Request;
  8. class RequestTransformerDecorator implements RequestTransformerInterface
  9. {
  10.     /**
  11.      * @var RequestTransformerInterface
  12.      */
  13.     private $decorated;
  14.     /**
  15.      * @var RequestTransformer
  16.      */
  17.     private $requestTransformer;
  18.     /**
  19.      * @param RequestTransformerInterface $decorated
  20.      * @param RequestTransformer $requestTransformer
  21.      */
  22.     public function __construct(RequestTransformerInterface $decoratedRequestTransformer $requestTransformer)
  23.     {
  24.         $this->decorated $decorated;
  25.         $this->requestTransformer $requestTransformer;
  26.     }
  27.     /**
  28.      * @param Request $request
  29.      * @return Request
  30.      * @throws SalesChannelMappingException
  31.      * @throws InconsistentCriteriaIdsException
  32.      */
  33.     public function transform(Request $request): Request
  34.     {
  35.         /**
  36.          * Start the shopware progress
  37.          * In this step the sales channel and the seo url information will be fetch
  38.          */
  39.         $clone $this->decorated->transform($request);
  40.         /**
  41.          * Start SEO Professional transformer
  42.          */
  43.         return $this->requestTransformer->transform($clone$request);
  44.     }
  45.     /**
  46.      * Return only attributes that should be inherited by subrequests
  47.      */
  48.     public function extractInheritableAttributes(Request $sourceRequest): array
  49.     {
  50.         /**
  51.          * Start the shopware progress
  52.          */
  53.         return $this->decorated->extractInheritableAttributes($sourceRequest);
  54.     }
  55. }