N
N
Nikolai Egorov2018-03-21 21:37:51
symfony
Nikolai Egorov, 2018-03-21 21:37:51

Is it possible to use pagerfanta-bundle pagination with standard repository methods findAll() and findBy()?

I'm not experienced in Symfony, I'm learning slowly. I use white-october/pagerfanta-bundle for pagination. There was such a question. Is it possible to use this bundle for pagination and fetching records using standard repository methods: $repository->findAll(); $repository->findBy();. In the examples, the usage code is shown only in conjunction with the QueryBuilder.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-03-22
@Minifets

No.
Because $repository->findAll(); $repository->findBy();already return the result of the query, while pagerfanta expects to receive a QueryBuilder to complete the query with its parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question