CoreRequestTransformer example

private RequestTransformer $requestTransformer;

    private string $deLanguageId;

    protected function setUp(): void
    {
        /** @var list<string> $registeredApiPrefixes */
        $registeredApiPrefixes = $this->getContainer()->getParameter('shopware.routing.registered_api_prefixes');

        $this->requestTransformer = new RequestTransformer(
            new CoreRequestTransformer(),
            $this->getContainer()->get(SeoResolver::class),
            $registeredApiPrefixes,
            $this->getContainer()->get(DomainLoader::class)
        );

        $this->deLanguageId = $this->getDeDeLanguageId();
    }

    /** * @dataProvider domainProvider * * @param array<string, string|array<string, string>> $salesChannels * @param ExpectedRequest[] $requests */
private Router $router;

    private RequestStack $requestStack;

    private RequestContext $oldContext;

    private SeoUrlPlaceholderHandlerInterface $seoUrlReplacer;

    protected function setUp(): void
    {
        $this->requestTransformer = new RequestTransformer(
            new CoreRequestTransformer(),
            $this->getContainer()->get(SeoResolver::class),
            $this->getContainer()->getParameter('shopware.routing.registered_api_prefixes'),
            $this->getContainer()->get(DomainLoader::class)
        );

        $this->seoUrlReplacer = $this->getContainer()->get(SeoUrlPlaceholderHandlerInterface::class);

        $this->requestStack = $this->getContainer()->get('request_stack');
        while ($this->requestStack->pop()) {
        }
        $this->router = $this->getContainer()->get('router');
        
Home | Imprint | This part of the site doesn't use cookies.