diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index cd2b47b9..14616d88 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -329,4 +329,18 @@ class EntryRepository extends EntityRepository | |||
329 | 329 | ||
330 | return $qb->getQuery()->getSingleScalarResult(); | 330 | return $qb->getQuery()->getSingleScalarResult(); |
331 | } | 331 | } |
332 | |||
333 | /** | ||
334 | * Remove all entries for a user id. | ||
335 | * Used when a user want to reset all informations. | ||
336 | * | ||
337 | * @param int $userId | ||
338 | */ | ||
339 | public function removeAllByUserId($userId) | ||
340 | { | ||
341 | $this->getEntityManager() | ||
342 | ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = :userId') | ||
343 | ->setParameter('userId', $userId) | ||
344 | ->execute(); | ||
345 | } | ||
332 | } | 346 | } |