You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
610 B
27 lines
610 B
<?php
|
|
|
|
namespace Entity\Repository;
|
|
|
|
use Doctrine\ORM\EntityRepository;
|
|
|
|
/**
|
|
* PagesRepository
|
|
*
|
|
* This class was generated by the Doctrine ORM. Add your own custom
|
|
* repository methods below.
|
|
*/
|
|
class PagesRepository extends EntityRepository
|
|
{
|
|
public function getLatestPages($limit = null)
|
|
{
|
|
$qb = $this->createQueryBuilder('b')
|
|
->select('b')
|
|
->addOrderBy('b.created', 'DESC');
|
|
return $qb;
|
|
if (false === is_null($limit))
|
|
$qb->setMaxResults($limit);
|
|
|
|
return $qb->getQuery()
|
|
->getResult();
|
|
}
|
|
}
|
|
|