+ // then try using hashed_given_url (to use the database index)
+ $res = $this->createQueryBuilder('e')
+ ->where('e.hashedGivenUrl = :hashed_given_url')->setParameter('hashed_given_url', $hashedUrl)
+ ->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
+ ->getQuery()
+ ->getResult();
+
+ if (\count($res)) {
+ return current($res);
+ }
+