mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Merge remote-tracking branch 'origin/2.5.x'
This commit is contained in:
commit
66b7bdd07c
18 changed files with 614 additions and 472 deletions
|
@ -49,6 +49,24 @@ class AnnotationRepository extends ServiceEntityRepository
|
|||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find annotation by id and user.
|
||||
*
|
||||
* @param int $annotationId
|
||||
* @param int $userId
|
||||
*
|
||||
* @return Annotation
|
||||
*/
|
||||
public function findOneByIdAndUserId($annotationId, $userId)
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->where('a.id = :annotationId')->setParameter('annotationId', $annotationId)
|
||||
->andWhere('a.user = :userId')->setParameter('userId', $userId)
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find annotations for entry id.
|
||||
*
|
||||
|
@ -57,7 +75,7 @@ class AnnotationRepository extends ServiceEntityRepository
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function findAnnotationsByPageId($entryId, $userId)
|
||||
public function findByEntryIdAndUserId($entryId, $userId)
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->where('a.entry = :entryId')->setParameter('entryId', $entryId)
|
||||
|
@ -74,7 +92,7 @@ class AnnotationRepository extends ServiceEntityRepository
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function findLastAnnotationByPageId($entryId, $userId)
|
||||
public function findLastAnnotationByUserId($entryId, $userId)
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->where('a.entry = :entryId')->setParameter('entryId', $entryId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue