| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- /*
- * This file is part of Packagist.
- *
- * (c) Jordi Boggiano <j.boggiano@seld.be>
- * Nils Adermann <naderman@naderman.de>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Packagist\WebBundle\Entity;
- use Doctrine\ORM\EntityRepository;
- /**
- * @author Jordi Boggiano <j.boggiano@seld.be>
- */
- class PackageRepository extends EntityRepository
- {
- public function getStalePackages()
- {
- $qb = $this->getEntityManager()->createQueryBuilder();
- $qb->select('p, v')
- ->from('Packagist\WebBundle\Entity\Package', 'p')
- ->leftJoin('p.versions', 'v')
- ->where('p.crawledAt IS NULL OR p.crawledAt < ?0')
- ->setParameters(array(new \DateTime('-1hour')));
- return $qb->getQuery()->getResult();
- }
- }
|