mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-16 10:22:14 +01:00
parent
ad621f198f
commit
68060f545a
@ -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 New Issue
Block a user