mirror of
https://github.com/wallabag/wallabag.git
synced 2025-10-15 19:42:08 +00:00
parent
27dce581ca
commit
ee122a7528
15 changed files with 151 additions and 50 deletions
|
@ -85,6 +85,25 @@ class EntryRepository extends EntityRepository
|
|||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves entries filtered with a search term for a user.
|
||||
*
|
||||
* @param int $userId
|
||||
* @param string $term
|
||||
*
|
||||
* @return QueryBuilder
|
||||
*/
|
||||
public function getBuilderForSearchByUser($userId, $term)
|
||||
{
|
||||
return $this
|
||||
->getBuilderByUser($userId)
|
||||
->andWhere('e.content LIKE :term')->setParameter('term', '%'.$term.'%')
|
||||
->orWhere('e.title LIKE :term')->setParameter('term', '%'.$term.'%')
|
||||
->leftJoin('e.tags', 't')
|
||||
->groupBy('e.id')
|
||||
->having('count(t.id) = 0');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves untagged entries for a user.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue