Implement basic title text search
This commit is contained in:
parent
71ca261cab
commit
865f8ec94f
4 changed files with 38 additions and 6 deletions
|
@ -44,6 +44,19 @@ class OfferRepository extends ServiceEntityRepository
|
|||
;
|
||||
}
|
||||
|
||||
public function findBySearchLiteral(string $literal)
|
||||
{
|
||||
$qb = $this->createQueryBuilder('o');
|
||||
$qb->andWhere($qb->expr()->like('o.title', ':lit'))
|
||||
->setParameter('lit', '%' . $literal . '%')
|
||||
->orderBy('o.id', 'ASC')
|
||||
;
|
||||
|
||||
$qb = $qb->getQuery()->getResult();
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?Offer
|
||||
{
|
||||
|
|
Reference in a new issue