diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/ChangeRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/ChangeRepository.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/ChangeRepository.php b/src/Wallabag/CoreBundle/Repository/ChangeRepository.php new file mode 100644 index 00000000..18d015a7 --- /dev/null +++ b/src/Wallabag/CoreBundle/Repository/ChangeRepository.php | |||
@@ -0,0 +1,26 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Repository; | ||
4 | |||
5 | use Doctrine\ORM\EntityRepository; | ||
6 | |||
7 | class ChangeRepository extends EntityRepository | ||
8 | { | ||
9 | /** | ||
10 | * Used only in test case to get a tag for our entry. | ||
11 | * | ||
12 | * @param int $timestamp | ||
13 | * | ||
14 | * @return Tag | ||
15 | */ | ||
16 | public function findChangesSinceDate($timestamp) | ||
17 | { | ||
18 | $date = new \DateTime(); | ||
19 | $date->setTimestamp($timestamp); | ||
20 | |||
21 | return $this->createQueryBuilder('c') | ||
22 | ->where('c.createdAt >= :timestamp')->setParameter('timestamp', $date) | ||
23 | ->getQuery() | ||
24 | ->getResult(); | ||
25 | } | ||
26 | } | ||