Add paginated query support with metadata#26
Merged
maltehuebner merged 4 commits intomainfrom Mar 14, 2026
Merged
Conversation
Introduces a result container that holds paginated data along with metadata: page, size, totalItems, and computed totalPages. Refs #25 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PageParameter provides a 0-based page parameter as a user-friendly alternative to the offset-based FromParameter. SizeParameter gains a getter so the DataQueryManager can extract the configured page size. Refs #25 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Doctrine ORM uses Doctrine\ORM\Tools\Pagination\Paginator for efficient total count queries. Elasticsearch uses the FOS Elastica paginator adapter to retrieve results and total count in a single operation. Refs #25 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Exposes the new paginatedQuery() method on the DataQueryManagerInterface, wires PaginatedResult into service autodiscovery, and baselines the optional FOS Elastica createPaginatorAdapter() call in PHPStan. Closes #25 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PaginatedResultclass withgetData(),getPage(),getSize(),getTotalItems(),getTotalPages()PageParameter(0-based) as user-friendly alternative toFromParameter(?page=2&size=50instead of?from=100&size=50)paginatedQuery()method toDataQueryManagerInterfacealongside the existingquery()method (backward compatible)Doctrine\ORM\Tools\Pagination\Paginator) and Elasticsearch (via FOS Elastica paginator adapter)Expected JSON response format
{ "data": [ ... ], "meta": { "page": 0, "size": 100, "totalItems": 54321, "totalPages": 544 } }Test plan
Closes #25
🤖 Generated with Claude Code