aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/AnnotationBundle/Repository
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2016-10-24 11:57:51 +0200
committerGitHub <noreply@github.com>2016-10-24 11:57:51 +0200
commit9313ea9d440e3f93a6bb2d8c0fb6717364cd27f5 (patch)
tree659842576e853a536c67e7c74139a73853b6caf2 /src/Wallabag/AnnotationBundle/Repository
parenta1c18418288a9521c980c96fd5defffc757a81c6 (diff)
parentf623516e107c8146f87d815f033cecb5d812466a (diff)
downloadwallabag-9313ea9d440e3f93a6bb2d8c0fb6717364cd27f5.tar.gz
wallabag-9313ea9d440e3f93a6bb2d8c0fb6717364cd27f5.tar.zst
wallabag-9313ea9d440e3f93a6bb2d8c0fb6717364cd27f5.zip
Merge pull request #2401 from wallabag/reset-account
Reset account
Diffstat (limited to 'src/Wallabag/AnnotationBundle/Repository')
-rw-r--r--src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
index 8cccffba..8d3f07ee 100644
--- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
+++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
@@ -108,4 +108,18 @@ class AnnotationRepository extends EntityRepository
108 ->getQuery() 108 ->getQuery()
109 ->getSingleResult(); 109 ->getSingleResult();
110 } 110 }
111
112 /**
113 * Remove all annotations for a user id.
114 * Used when a user want to reset all informations.
115 *
116 * @param int $userId
117 */
118 public function removeAllByUserId($userId)
119 {
120 $this->getEntityManager()
121 ->createQuery('DELETE FROM Wallabag\AnnotationBundle\Entity\Annotation a WHERE a.user = :userId')
122 ->setParameter('userId', $userId)
123 ->execute();
124 }
111} 125}