- $res = $this->createQueryBuilder('e')
- ->where('e.url = :url')->setParameter('url', urldecode($url))
- ->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
- ->getQuery()
- ->getResult();
-
- if (\count($res)) {
- return current($res);
- }
-
- return false;
+ return $this->findByHashedUrlAndUserId(
+ UrlHasher::hashUrl($url),
+ $userId
+ );