Symfony2プロジェクトでKnpPaginatorBundleを使用しています。Doctrine 2のネイティブクエリをpaginatorインスタンスに渡そうとすると、エラーが発生しました。
One of listeners must count and slice given target
ネイティブクエリに対するこれの正しい実装の例はありますか?
バンドルのドキュメントには例(https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/Resources/doc/custom_pagination_subscribers.md)がありますが、これはファイルシステムのみであり、これをdbクエリに変換する方法がわかりません。
手伝ってくれますか?
編集
私の質問:
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;
およびテーブル:
author (id, first_name, last_name)
books (id, title, rate, author_id)