I use pomm in a symfony 3.4 project. Here is my use case.
In a model generated from a Pomm command, I have this method implemented:
$sql = <<<SQL
select tableA.*, array_agg(tableB) as tableB
from tableA, tableA_tableB, tableA
where tableA.id=$id and tableA.id=tableA_tableB.tableA_id and tableB.id=tableA_tableB.tableB_id
group by tableA.id
SQL;
$projection = $this->createProjection()
->setField('tableB', 'tableB', TableB::class)
;
return $this->query($sql, [], $projection);
I have a tableA and tableB. A tableA can have 0 to N tableB and a tableB can have 0 to N tableA. My problem is that I can not get a collection of tableB in the field 'tableB' of my projection. Table :: class is a flexible entity. What should I do ? Thank you !