I thought the purpose of the query builder object was to help dynamically build queries. However, any time I try to use the query builder in this kind of a context, the helper methods overwrite one another. For example:
$object_identifiers_I_need = array("Obj_One", "Obj_Two", "Obj_Three");
$qb = $em->createQueryBuilder();
foreach($object_identifiers_I_need as $object_identifier){
$qb->add('select', $object_identifier)
}
returns only:
SELECT Obj_Three ...
rather than the desired
SELECT Obj_One, Obj_Two, Obj_Three ...
Am I missing something? Is there a way to add multiple selects without sticking them all in an array in a single call?