aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/AnnotationBundle/Repository
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/AnnotationBundle/Repository')
-rw-r--r--src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
index 5f7da70e..d999dc0f 100644
--- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
+++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
@@ -106,4 +106,17 @@ class AnnotationRepository extends EntityRepository
106 ->getQuery() 106 ->getQuery()
107 ->getSingleResult(); 107 ->getSingleResult();
108 } 108 }
109
110 /**
111 * Remove all annotations for a user id.
112 * Used when a user want to reset all informations
113 *
114 * @param int $userId
115 */
116 public function removeAllByUserId($userId)
117 {
118 $this->getEntityManager()
119 ->createQuery('DELETE FROM Wallabag\AnnotationBundle\Entity\Annotation a WHERE a.user = '.$userId)
120 ->execute();
121 }
109} 122}