ModelManager icon indicating copy to clipboard operation
ModelManager copied to clipboard

Projection, with and array_agg

Open bolbo opened this issue 11 years ago • 1 comments

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

Vehicule

  • vehicule_id
  • label

VehiculeEquipement

  • vehicule_id
  • equipement_id
  • price

Equipement

  • equipement_id
  • euipement_label

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

bolbo avatar Jul 21 '15 09:07 bolbo

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

chanmix51 avatar Sep 28 '15 18:09 chanmix51