mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-15 13:31:13 +00:00
Merge pull request #4865 from wallabag/fix-4864
Added a query to parse only non-hashed URL
This commit is contained in:
commit
863dd6ed07
2 changed files with 15 additions and 1 deletions
|
@ -59,7 +59,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
|||
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
|
||||
$repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
|
||||
|
||||
$entries = $repo->findByUser($user->getId());
|
||||
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
|
||||
|
||||
$i = 1;
|
||||
foreach ($entries as $entry) {
|
||||
|
|
|
@ -369,6 +369,20 @@ class EntryRepository extends EntityRepository
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all entries which have an empty value for hash.
|
||||
*
|
||||
* @return Entry|false
|
||||
*/
|
||||
public function findByEmptyHashedUrlAndUserId(int $userId)
|
||||
{
|
||||
return $this->createQueryBuilder('e')
|
||||
->where('e.hashedUrl = :empty')->setParameter('empty', '')
|
||||
->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find an entry by its hashed url and its owner.
|
||||
* If it exists, return the entry otherwise return false.
|
||||
|
|
Loading…
Reference in a new issue