[list]- Is this supported by xPDO?
- How should I define the composite relationship?
Would this do the trick?: <composite alias="table1" class="myTable1" local="colid1,colid2" foreign="colid1,colid2" cardinality="many" owner="local" />- How should I define the aggregate relationship?
Would this do the trick?: <aggregate alias="table2" class="myTable2" local="colid1,colid2" foreign="colid1,colid2" cardinality="one" owner="foreign" />
Though xPDO currently supports tables with compound primary keys, it does not support defining aggregate/composite relationships based on compound keys. For now, you may override xPDOObject methods in these classes to handle the unsupported relation definitions.Could you give me some hint about what methods I would need to override - and what I would need to change?
No; that will be part of the support for it; you just need to override getOne() in your class that has the relationship with a compound key until that support is added. You are just going to work around the lack of support for it by overriding the behavior of getOne() when the alias provided matches your relation.
I think I see how I should override getOne and _getRelatedObjectsByFK (for getMany), but it looks as if I also should override xPDOQuery::hydrateGraphNode - but I do not immediately see how to do that, given the fact that it’s part of a different class.
Any hints?