Skip to content

Commit

Permalink
Re-introduced query type offset
Browse files Browse the repository at this point in the history
Any offset defined in the query type must be kept when computing offset for pagination.
  • Loading branch information
Bertrand Dunogier authored and bdunogier committed Feb 3, 2021
1 parent f142b23 commit c5639f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/API/QueryFieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function countContentItemsForLocation(Location $location, string $fieldDe
public function loadContentItemsSlice(Content $content, string $fieldDefinitionIdentifier, int $offset, int $limit): iterable
{
$query = $this->prepareQuery($content, $content->contentInfo->getMainLocation(), $fieldDefinitionIdentifier);
$query->offset = $offset;
$query->offset += $offset;
$query->limit = $limit;

return $this->executeQueryAndMapResult($query);
Expand All @@ -95,7 +95,7 @@ public function loadContentItemsSlice(Content $content, string $fieldDefinitionI
public function loadContentItemsSliceForLocation(Location $location, string $fieldDefinitionIdentifier, int $offset, int $limit): iterable
{
$query = $this->prepareQuery($location->getContent(), $location, $fieldDefinitionIdentifier);
$query->offset = $offset;
$query->offset += $offset;
$query->limit = $limit;

return $this->executeQueryAndMapResult($query);
Expand Down

0 comments on commit c5639f7

Please sign in to comment.