Welcome Guest, Not a member yet? Register   Sign In
IgnitedRecord 1.0 pre-release

[eluser]m4rw3r[/eluser]
WARNING: This is a long post, and discusses some internals of IR Smile

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)

[eluser]dexcell[/eluser]
Again, thank you very much m4rw3r.

[eluser]dexcell[/eluser]
I've sent you PM about a little bug, i don't know if it's sent or not, because my sent message box count still zero (CI website problem?)

[eluser]m4rw3r[/eluser]
I've got it, and it is fixed (you have to check the checkbox titled "Store a copy in the Sent messages folder?").

[eluser]m4rw3r[/eluser]
I've made a basic screencast featuring IR here!

[eluser]dexcell[/eluser]
Ah, miss that option.

Great video Big Grin I Think you should include that link in IR assembla page.
Btw what text editor are you using in that video?

[eluser]m4rw3r[/eluser]
Texteditor: e-texteditor
Theme: IDLE (had to change temporarily, just for you Smile), need a better one next time I do a screencast
OS: Modded Win XP Media Center

[eluser]dexcell[/eluser]
Thanks for the answer Smile
And, i just realized there is currently no IR_form.php in SVN
Can i have a copy please Big Grin

[eluser]m4rw3r[/eluser]
Added it to svn, but it needs some more types of fields and general cleaning.

[eluser]dexcell[/eluser]
Thanks m4rw3r.




Theme © iAndrew 2016 - Forum software by © MyBB