Hi there,
Thank you for this great framework!! I am really looking forward to FuelPHP 2
I am wondering if following is a bug.
For example, Model_User extends \Orm\Model and has two relations Model_Post and Model_Comment.
If I make a query
$user = Model_User::query()->where('id', 1)->get_one();
$user will contain all relations even if they are not part of a query, that is, I will be able to access
print_r($user->posts)
if my question makes sense, is this is a bug, or its just a way that ORM works?
No, it doesn't.
It has a feature called 'lazy loading', which makes sure that if you request a relation that hasn't been loaded yet, it will load it on the fly. If you enable the profiler you'll see it lauches a second query.
And printing $user->posts is requesting it.