I am using KnpPaginatorBundle in my Symfony2 project. When I try to pass my own Doctrine 2 request for the paginator instance, I got an error:
One of listeners must count and slice given target
Does anyone have an example of the correct implementation of this for some own query?
In the package documentation I see an example ( https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/Resources/doc/custom_pagination_subscribers.md ), but only for the file system, and I donβt know how to translate this into a db request .
You can help?
EDIT
my request:
SELECT a.*, highest_rated_book.* FROM authors a LEFT JOIN (SELECT * FROM books b ORDER BY b.rate DESC) AS highest_rated_book ON a.id = highest_rated_book.author_id GROUP BY highest_rated_book.author_id ORDER BY a.id;
and tables:
author (id, first_name, last_name) books (id, title, rate, author_id)
source share