-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
We wanted to create a /batch route by using the HttpKernel:
foreach($requests as $request) {
// ...
$req = Request::create(
$request['relative_url'],
$request['method'],
$options
);
$response = $kernel->handle($req);
}However, since the ResourceCollection service (and probably others like JsonApi) sets the request on construction, it doesn't work with follow up requests:
/**
* ResourceCollection constructor.
*/
public function __construct(RequestStack $requestStack, FinderCollection $finderCollection, Paginator $paginator, FieldManager $fieldManager)
{
$this->request = $requestStack->getCurrentRequest();
// ...
}It will handle the same request over and over again.
Metadata
Metadata
Assignees
Labels
No labels