mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-27 11:31:05 +00:00
parent
ad621f198f
commit
68060f545a
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');
|
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
|
$repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
|
||||||
|
|
||||||
$entries = $repo->findByUser($user->getId());
|
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($entries as $entry) {
|
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.
|
* Find an entry by its hashed url and its owner.
|
||||||
* If it exists, return the entry otherwise return false.
|
* If it exists, return the entry otherwise return false.
|
||||||
|
|
Loading…
Reference in a new issue