I'm looking for a way to simplify building complex queries. So, for example I need to add a bunch of OR conditions to a larger AND condition. Ideally I could use a separate QueryBuilder instance to build the AND condition. For example:
$mainBuilder->andWhere('something = 1')
foreach ($array as $val)
{
$subBuilder->orWhere($val . ' = 1');
}
$mainBuilder->andWhere($subBuilder);
Is there a way to use QueryBuilders like this? Any other suggestions on how to build complex queries using the QueryBuilder?