Skip to content

Commit

Permalink
change: removed exact search from query action
Browse files Browse the repository at this point in the history
  • Loading branch information
amvid committed May 13, 2024
1 parent 3351dd2 commit 73ba7ab
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/Airport/Repository/AirportRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,6 @@ public function list(

public function query(int $offset, int $limit, string $query): iterable
{
$exactMatchParams = new ArrayCollection();
$exactMatchParams->add(new Parameter('exactQuery', $query));
$exactMatchParams->add(new Parameter('isActive', true));

$exactMatchResult = $this->createQueryBuilder('a')
->join('a.city', 'c')
->join('c.country', 'co')
->where('a.iata = :exactQuery')
->andWhere('a.isActive = :isActive')
->setParameters($exactMatchParams)
->getQuery()
->getResult();

if (count($exactMatchResult) > 0) {
return $exactMatchResult;
}

$params = new ArrayCollection();
$params->add(new Parameter('query', "$query%"));
$params->add(new Parameter('isActive', true));
Expand Down

0 comments on commit 73ba7ab

Please sign in to comment.