I have very difficult relations on my tables.
I've added a few relations to my models. (http://docs.phalconphp.com/en/latest/reference/models.html#bidirectional-relations)
but as result from the ::find() I get a complex building of objects and arrays.
Here is an example:
What I got:
id | headerID | contentID | name
1 | 1 | 1 | test
2 | 1 | 2 | value
3 | 2 | 1 | test
But what I want to get:
id | headerName | headerContent | contentName | name
1 | sample | sample | sample | test
2 | sample2 | sample | sample | value
So I want something like "SELECT ... FROM ... LEFT JOIN ..." But I don't want to write an extra statment for that.
Does someone know a method to do this automatically by code?
The reason why I want it is that I don't want so many foreach-Loops.