It's lazy loading, which means load on demand as if it's there. What your suggesting is just loading it and dropping lazy loading: won't happen.This is because the ORM relation classes returns a result. I think ORM returning the query object is better, as writing $post->comments->get() is not such a big deal and also you are able to do things like $post->comments->where(...)->order_by(...), etc.
Sorry, I'm really a newbie on this community driven code development. Hope I'll learn fast enough and bother you the less as possible.It's always smart to look into the issues on Github: https://github.com/fuel/orm/issues (this is partially already planned)
My intention was, at this point, to know what other people think about this, and in case the suggestion was well received, to submit my already modified version of the ORM package which supports the features I suggest.Also if you make suggestions on the forums: don't count on any of us remembering, I don't plan or decide based on the forums. That's what the issue tracker is for. The forums or for support and discussion.
I'm sorry, probably my english is not good enough, but I'm really missing the point of what you are trying to say. As I can read on https://github.com/fuel/orm/issues/3, you are proposing conditions to be enabled on the eager loading, but no on the lazy one. It's not just a case of 'when' are you doing the request to the database?It's lazy loading, which means load on demand as if it's there. What your suggesting is just loading it and dropping lazy loading: won't happen.
$post->comments // returns a comments object $post->comments() // returns a query objectbut I dropped, because it remaind me some things I don't like of Symphony. I know we have to deal with limitations, but I think rethinking the limits it's a good exercise. In some way, I think Fuel was founded because of the limits Expression Engine imposed to CI development. Said that, what about something like:
$post->relation('comments')->where()->order_by // add conditions to the comment search $post->comments // behaves as always
It looks like you're new here. If you want to get involved, click one of these buttons!