Skip to content

Commit

Permalink
imported iterator_to_array polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Dec 19, 2024
1 parent 5c4512b commit 2b60956
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/bundle/Controller/QueryFieldRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
use Ibexa\Contracts\Rest\Exceptions\NotFoundException;
use Ibexa\FieldTypeQuery\QueryFieldService;
use function Ibexa\PolyfillPhp82\iterator_to_array;
use Ibexa\Rest\RequestParser;
use Ibexa\Rest\Server\Values as RestValues;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -51,8 +52,12 @@ public function __construct(
$this->requestParser = $requestParser;
}

public function getResults(Request $request, int $contentId, int $versionNumber, string $fieldDefinitionIdentifier): RestValues\ContentList
{
public function getResults(
Request $request,
int $contentId,
int $versionNumber,
string $fieldDefinitionIdentifier
): RestValues\ContentList {
$offset = (int)$request->query->get('offset', '0');
$limit = (int)$request->query->get('limit', '-1');

Expand Down Expand Up @@ -90,10 +95,10 @@ function (Content $content) {
$this->locationService->loadLocation($content->contentInfo->mainLocationId),
$content,
$this->getContentType($content->contentInfo),
\Ibexa\PolyfillPhp82\iterator_to_array($this->contentService->loadRelations($content->getVersionInfo()))
iterator_to_array($this->contentService->loadRelations($content->getVersionInfo()))
);
},
\Ibexa\PolyfillPhp82\iterator_to_array($items)
iterator_to_array($items)
),
$this->queryFieldService->countContentItems($content, $fieldDefinitionIdentifier)
);
Expand Down

0 comments on commit 2b60956

Please sign in to comment.