$response =
$event->
getResponse();
if (!
$response instanceof StoreApiResponse
) { return;
} if (!
$event->
getRequest()->headers->
has(PlatformRequest::HEADER_INCLUDE_SEO_URLS
)) { return;
} $dataBag =
new SeoResolverData();
$this->
find($dataBag,
$response->
getObject());
$this->
enrich($dataBag,
$event->
getRequest()->attributes->
get(PlatformRequest::ATTRIBUTE_SALES_CHANNEL_CONTEXT_OBJECT
));
} private function find(SeoResolverData
$data, Struct
$struct): void
{ if ($struct instanceof AggregationResultCollection
) { foreach ($struct as $item) { $this->
findStruct($data,
$item);
} }