improvements

This commit is contained in:
Kevin Papst
2016-10-27 08:13:59 +02:00
parent b72fd888b1
commit 55ac11d517
12 changed files with 297 additions and 109 deletions

View File

@@ -36,7 +36,18 @@ class ProjectRepository extends EntityRepository
$qb->select('p')
->from('TimesheetBundle:Project', 'p')
->orderBy('p.name', 'DESC');
->orderBy('p.id', 'DESC');
return $qb->getQuery();
}
public function queryAll($orderBy = 'id')
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select('p')
->from('TimesheetBundle:Project', 'p')
->orderBy('p.' . $orderBy, 'ASC');
return $qb->getQuery();
}
@@ -58,7 +69,7 @@ class ProjectRepository extends EntityRepository
*/
public function findAll($page = 1)
{
return $this->getPager($this->queryLatest(), $page);
return $this->getPager($this->queryAll(), $page);
}
/**