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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions user_guide_src/source/models/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,15 @@ afterUpdateBatch **data** = the key/value pairs being updated.
**result** = the results of the ``updateBatch()`` method used through the Query Builder.
================= =========================================================================================================

.. note:: When using the ``paginate()`` method in combination with the ``beforeFind`` event to modify the query,
the results may not behave as expected.

This is because the ``beforeFind`` event only affects the actual retrieval of the results (``findAll()``),
but **not** the query used to count the total number of rows for pagination.

As a result, the total row count used for generating pagination links may not reflect the modified query conditions,
leading to inconsistencies in pagination.

Modifying Find* Data
====================

Expand Down