Ver Fonte

Merge remote branch 'origin/name_detection' into name_detection

xaav há 13 anos atrás
pai
commit
101bee89f4

+ 32 - 0
src/Packagist/WebBundle/Entity/._PackageRepository.php5032529025011279819.tmp

@@ -0,0 +1,32 @@
+<?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();
+    }
+}