mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-18 04:45:27 +00:00
Delegate findByUrlAndUserId to findByHashedUrlAndUserId
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
parent
31e276fc16
commit
d5744bf0df
1 changed files with 3 additions and 11 deletions
|
@ -348,17 +348,9 @@ class EntryRepository extends EntityRepository
|
||||||
*/
|
*/
|
||||||
public function findByUrlAndUserId($url, $userId)
|
public function findByUrlAndUserId($url, $userId)
|
||||||
{
|
{
|
||||||
$res = $this->createQueryBuilder('e')
|
return $this->findByHashedUrlAndUserId(
|
||||||
->where('e.url = :url')->setParameter('url', urldecode($url))
|
hash('sha1', $url), // XXX: the hash logic would better be in a separate util to avoid duplication with GenerateUrlHashesCommand::generateHashedUrls
|
||||||
->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
|
$userId);
|
||||||
->getQuery()
|
|
||||||
->getResult();
|
|
||||||
|
|
||||||
if (\count($res)) {
|
|
||||||
return current($res);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue