Skip to content

T14754 paginator cursor#17021

Merged
niden merged 4 commits into
5.0.xfrom
T14754-paginator-cursor
May 15, 2026
Merged

T14754 paginator cursor#17021
niden merged 4 commits into
5.0.xfrom
T14754-paginator-cursor

Conversation

@niden
Copy link
Copy Markdown
Member

@niden niden commented May 15, 2026

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Added Phalcon\Paginator\Adapter\QueryBuilderCursor — a keyset (cursor-based) pagination adapter that accepts a QueryBuilder, a limit, and a cursorColumn (the column used as the cursor key, typically a primary key). Each paginate() call fetches limit + 1 rows using cursorColumn > :cursor: to skip already-seen rows; the extra row is used only to detect whether a next page exists and is never returned. getNext() returns the last visible row's cursor value, or 0 when no further page exists. setCursor(int|null $cursor) advances or resets the position. getTotalItems() and getLast() return 0 by design — no COUNT query is issued. Registered in PaginatorFactory as "queryBuilderCursor"

Thanks

@niden niden self-assigned this May 15, 2026
@niden niden added new feature request Planned Feature or New Feature Request 5.0 The issues we want to solve in the 5.0 release labels May 15, 2026
@niden niden requested a review from Jeckerson May 15, 2026 00:54
@niden niden merged commit baedfa2 into 5.0.x May 15, 2026
361 of 363 checks passed
@niden niden deleted the T14754-paginator-cursor branch May 15, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0 The issues we want to solve in the 5.0 release new feature request Planned Feature or New Feature Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant