Hi I'm gonna use querybuilder to create dynamic query based on requests and have it on my resultset
$builder = $this->modelsManager->createBuilder()
->columns($columns)
->from(array('ParentDB'=>'NS\Models\ParentDB'))
->innerJoin('NS\Models\ChildDB','ParentDB.Id=ChildDB.parentId','ChildDB');
if ( $condition ){
$builder->where( $someCondition )->getQuery()->execute( $params );
}else{
$builder->getQuery()->execute();
}
my goal is creating query dynamiclly for example join other tables if needed or add another where conditions and perhaps params.. should I use PHQL instead?