-
Notifications
You must be signed in to change notification settings - Fork 41
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
Support for Paginator #85
Comments
I've not considered that issue. Thank you. I've been doing some thinking on this issue the last week but I have not come up with any good generic solution. I don't believe adding a third parameter is a good solution because I don't want to add a fourth parameter when the other feature X comes around. I was thinking of refactor $specification->modify($qb, $alias);
$query = $qb->where($specification->getFilter($qb, $alias))->getQuery();
if ($modifier !== null) {
$modifier->modify($query);
} I would suggest you to write your own |
How I handled this problem was I created a second method "getPaginator" to Justin Proffitt On Tue, Mar 17, 2015 at 5:54 AM, Tobias Nyholm notifications@github.com
|
What if match() retured the Query instead of executing it? |
Would it be overkill to let match() continue to execute the query but have a different function return the Query or QueryBuilder instead? (I've been using the match quite a bit in code that I plan to deploy to production but obviously refactoring to execute the query isn't that crazy.) I haven't used the Paginator but could see it being useful at some point. |
FYI: I think the fix for this issue has just been merged to master :) Instead of doing |
Right now the EntitySpecificationRepository::match method builds and executes a query directly. There is no way I can see to implement Doctrines Paginator for paginating complex queries. Would it break any principles to add a third "paginate" boolean parameter to the match method that wraps the query in a Paginator before execution, or to add a second "getPaginator" method to the EntitySpecificationRepository that returns a Paginator rather than results?
The text was updated successfully, but these errors were encountered: