Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Repositories;
- use Entities;
- class ThreadRepository extends EntityRepository
- {
- public function findMostViewed()
- {
- $qb = $this->_em->getRepository('Entity\Thread')
- ->createQueryBuilder('t')
- ->orderBy('t.viewed', 'DESC')
- ->setMaxResults(5);
- return $qb->getQuery()->getResult();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment