Check out this query:
$qb->andWhere('superhero.alias = :searchTerm')
->orWhere('superhero.superpower = :searchTerm')
->where('superhero.isActive = true')
->andWhere('superhero.homePlanet = :planet');
Now, imagine a superhero whose superpower perfectly matches your searchTerm
. This superhero is currently on a well-deserved vacation (i.e., isActive = false
), but their homePlanet
does match your search. Will they show up in the search results?