Skip to content

docs: add detailed explanation about paginate() and beforeFind model event #9618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

michalsn
Copy link
Member

@michalsn michalsn commented Jul 1, 2025

Description
This PR adds a note explaining the potential inconsistency when using the Model::paginate() method in combination with the beforeFind event. It aims to help prevent confusion when paginate() is used alongside query-modifying events.

Resolving this issue is non-trivial, as it would require a careful redesign of the pagination logic or parts of the model to ensure consistent behavior across both data retrieval and counting queries.

Due to this complexity, we are not applying a framework-level fix at this time. Instead, this note provides clear guidance so that developers are aware of the behavior and can plan accordingly.

This note will remain in place to support users until a long-term solution is identified and adopted.

Closes #9617

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added the documentation Pull requests for documentation only label Jul 1, 2025
Copy link
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests for documentation only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants