pomm-project / ModelManager

Model Manager for the Pomm database framework.
MIT License
66 stars 27 forks source link

Projection, with and array_agg #43

Open bolbo opened 9 years ago

bolbo commented 9 years ago

Hi, I have a "vehicule" table. Each vehicule has a collection of element. Each element has a detail in a separate table.

Vehicule

VehiculeEquipement

Equipement

To retrieve a vehicule, I have this function: https://gist.github.com/bolbo/0eea9640a5b29c5c8d38 If I remove equipement_label from the projection in the WITH, I have my vehicule. But with equipement_label, I have a "Notice: Undefined offset: 11".

Can someone help me find the problem ? Thanks

chanmix51 commented 8 years ago

The problem is similar to embedded entities. There are now ways for now to pass a projection as a type. We need to wrap types in a UnitOfTreatment that would either just be a type or a projection. That will be implemented in 2.1