if (!
$request->headers->
has(PlatformRequest::HEADER_CONTEXT_TOKEN
)) { if ($this->
contextTokenRequired($request)) { throw RoutingException::
missingRequestParameter(PlatformRequest::HEADER_CONTEXT_TOKEN
);
} $request->headers->
set(PlatformRequest::HEADER_CONTEXT_TOKEN, Random::
getAlphanumericString(32
));
} // Retrieve context for current request
$usedContextToken =
(string) $request->headers->
get(PlatformRequest::HEADER_CONTEXT_TOKEN
);
$contextServiceParameters =
new SalesChannelContextServiceParameters( (string) $request->attributes->
get(PlatformRequest::ATTRIBUTE_SALES_CHANNEL_ID
),
$usedContextToken,
$request->headers->
get(PlatformRequest::HEADER_LANGUAGE_ID
),
$request->attributes->
get(SalesChannelRequest::ATTRIBUTE_DOMAIN_CURRENCY_ID
),
$request->attributes->
get(SalesChannelRequest::ATTRIBUTE_DOMAIN_ID
) );
$context =
$this->contextService->
get($contextServiceParameters);
// Validate if a customer login is required for the current request
$this->
validateLogin($request,
$context);