procedure = $this->database->prepare($query); } public function getResponse(Request $request): Response { $count = $this->getQueriesCount($request); $payload = []; while ($count-- > 0) { $id = mt_rand(1, 10000); $this->procedure->bindInteger($id); $payload[] = $this->procedure->processOne() ->selectAll()->cast(RandomNumber::class) ->collectHead(); } return new SimpleOKResponse(new JsonEntity($payload)); } }