Added totalCount config to Phalcon\Paginator\Adapter\QueryBuilder #12041
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.
I guess situations like this https://forum.phalconphp.com/discussion/12207/how-to-alter-count-logic-in-querybuilderpaginator in some high complex application, are highly possible.
With this patch developers can specify the exact number of total results ( by performing a query of their own before that ) without build-ed in counter being fired.
Maybe another plus of this patch is sometimes people wants to count id, instead of *, with this patch they can do it the way they want without any dramatic changes to the framework itself.
//other ideas:
It can be done by checking if the given value is_numeric, otherwise people can specify raw queries, or pass another builder, but i think it might end up being an overkill.
example usage :