forked from wallabag/wallabag
Quickstart for beginners
This commit is contained in:
committed by
Nicolas Lœuillet
parent
0aafb8dfcb
commit
5c072d2b57
@ -122,6 +122,8 @@ class EntryRepository extends EntityRepository
|
||||
/**
|
||||
* Fetch an entry with a tag. Only used for tests.
|
||||
*
|
||||
* @param int $userId
|
||||
*
|
||||
* @return Entry
|
||||
*/
|
||||
public function findOneWithTags($userId)
|
||||
@ -248,4 +250,21 @@ class EntryRepository extends EntityRepository
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count all entries for a user.
|
||||
*
|
||||
* @param int $userId
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function countAllEntriesByUsername($userId)
|
||||
{
|
||||
$qb = $this->createQueryBuilder('e')
|
||||
->select('count(e)')
|
||||
->where('e.user=:userId')->setParameter('userId', $userId)
|
||||
;
|
||||
|
||||
return $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user