Implement basic title text search

This commit is contained in:
Jannis Portmann 2022-01-20 17:51:02 +01:00
parent 71ca261cab
commit 865f8ec94f
4 changed files with 38 additions and 6 deletions

View file

@ -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
{