I\'ve been reading Doctrine\'s documentation, but I haven\'t been able to find a way to sort findAll() Results.
I\'m using symfony2 + doctrine, this is the statemen
It's useful to look at source code sometimes.
For example findAll
implementation is very simple (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php
):
public function findAll()
{
return $this->findBy(array());
}
So we look at findBy
and find what we need (orderBy
)
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)