the orm relations are: news-belongsto-user news-hasmany-comments comment-belongsto-user user-hasmany-news
The strange thing is that on the third level of nesting (comment->user) it has only a relation on the first comment every other comment has no user. If I try it with the Object all relations are fine.
(Background info: I want to use the exclude_from_array feature on the ORM Model: Passwords, Salt and so on)
version 1.6, the query from the profiler gets all comments with the related user (passed the query manually in phpmyadmin). I still think the relation gets lost in the to_array() function in the orm Model.
Besides from that is there another way to exclude select statements on nested relations?
Actually it works with the to_array function even on related data but like I said there is the Problem that the relation gets lost on the third level of nesting.
I think the issue is here that you have the same Model in the query twice.
to avoid recusive issues, to_array() keeps track of the models it has processed. Which I think accounts for the fact that the second 'user' object is skipped.