Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1241

Additional parameters for EntityRepository::findAll() and EntityRepository::findOneBy()

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.3.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      In the Doctrine 2.1 versions the method EntityRepository::findBy() accepts additional parameters for ordering, limit and offset.
      Great feature! (While waiting for it I extended the EntityRepository class and implemented these parameters myself using a QueryBuilder.)

      It would be nice for the method EntityRepository::findOneBy() to accept an additional parameter for ordering as well. It could use the following signature:
      public function findOneBy(array $criteria, array $orderBy = null);
      This would be useful for various cases, for example: finding the newest blog-post.

      And maybe update EntityRepository::findAll() as well with the signature:
      public function findAll(array $orderBy = null);

      Looking forward to your thoughts.

        Activity

        Jasper N. Brouwer created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Fix Version/s 2.x [ 10090 ]
        Fix Version/s 2.1 [ 10022 ]
        Benjamin Eberlei made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Benjamin Eberlei made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 2.1 [ 10022 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.2-DEV [ 10157 ]
        Fix Version/s 2.1 [ 10022 ]
        Fix Version/s 2.x [ 10090 ]
        Guilherme Blanco made changes -
        Fix Version/s 2.x [ 10090 ]
        Fix Version/s 2.2 [ 10157 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12767 ] jira-feedback [ 14102 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14102 ] jira-feedback2 [ 15966 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15966 ] jira-feedback3 [ 18220 ]
        Fabio B. Silva made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 2.x [ 10090 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.3.1 [ 10323 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jasper N. Brouwer
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: