[eluser]m4rw3r[/eluser]
WARNING: This is a long post, and discusses some internals of IR
I can implement a way if you want (it can be handy sometimes).
To get the text field data from your result you should do something like this:
Code:
foreach($result as $u)
{
echo $u->username;
foreach($u->entries as $e)
{
echo $e->text;
}
}
The thing with joining qualifiers neatly to entries is very hard to do in a nice way.
The problem is that dbobj2ORM() only handles one level of joins (from my dissection of the Doctrine ORM code, I think it also is limited to one level).
So everything that is joined needs to be placed on the "master" object (in your case, user). If you select the data of the qualifier it will be assigned to the user object (not as an object, because Through relations are not supported yet).
I have redesigned the way dbobj2ORM() decides where to put a certain column (not committed yet). I can use the prefix of the aliased name, but that may cause other problems. If an aliased column collides with a "native" column, the "native" column won't be available to the user.
In your case it will work as expected if you alias the columns from qualifiers as entries_fieldname, then it will be assigned to the entry object(s).
I'll add it as an option (it is faster, because it saves a column lookup).
Example of a common(?) collision:
Users table has columns id and username
Posts table has columns id and user_id
A post has one user
Then the alias of users.id will be user_id and collide with user_id
Because of this, the post object will not contain the user_id column
(but it is accessable through post->user->id)
How often can this happen? I mean collisions with an alias and a column selected with a * ?
And if it does happen, is it okay with it happening? (in the above case, I'll say that it is ok)