Details
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.