Skip to content

Loading…

DDC-2378: Efficient count using Selectable #3087

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user bakura:

Hi,

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.

Thanks

@doctrinebot

Comment created by stof:

duplicate of DDC-2217

@doctrinebot

Issue was closed with resolution "Duplicate"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-882] was closed:
#882

@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.