Jira issue originally created by user bakura:
I'm currently using intensively the Criteria and Selectable interfaces to provide a generic REST library.
However, I've found a problem when I want to paginate data:
return count($this->selectable->matching(new Criteria()));
The problem is that EntityRepository returns an ArrayCollection and, hence, load the whole collection which is inefficient. It would be nice if it could return a PersistentCollection instead with lazy-load and perform an optimized count.
Comment created by stof:
duplicate of DDC-2217
Issue was closed with resolution "Duplicate"
Comment created by @doctrinebot:
A related Github Pull-Request [GH-882] was closed: