Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.3.2
    • Fix Version/s: None
    • Component/s: ORM

      Description

      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:

      count
      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

        Activity

        Hide
        Christophe Coevoet added a comment -

        duplicate of DDC-2217

        Show
        Christophe Coevoet added a comment - duplicate of DDC-2217
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-882] was closed:
        https://github.com/doctrine/doctrine2/pull/882

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-882] was closed: https://github.com/doctrine/doctrine2/pull/882

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Michaël Gallego
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: