]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/ChangeRepository.php
WIP
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / ChangeRepository.php
diff --git a/src/Wallabag/CoreBundle/Repository/ChangeRepository.php b/src/Wallabag/CoreBundle/Repository/ChangeRepository.php
new file mode 100644 (file)
index 0000000..18d015a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace Wallabag\CoreBundle\Repository;
+
+use Doctrine\ORM\EntityRepository;
+
+class ChangeRepository extends EntityRepository
+{
+    /**
+     * Used only in test case to get a tag for our entry.
+     *
+     * @param int $timestamp
+     *
+     * @return Tag
+     */
+    public function findChangesSinceDate($timestamp)
+    {
+        $date = new \DateTime();
+        $date->setTimestamp($timestamp);
+
+        return $this->createQueryBuilder('c')
+            ->where('c.createdAt >= :timestamp')->setParameter('timestamp', $date)
+            ->getQuery()
+            ->getResult();
+    }
+}