if ($user = Model_User::query()->related('books')->where('id', '=', $user_id)) {
$books = $user->books;
}
Fuel\Core\PhpErrorException [ Notice ]:
Undefined property: Orm\Query::$books
$books = Model_Book::query()->related('users')->where('users.id', $user_id)->get();
$books = $user->books->get();
Fuel\Core\PhpErrorException [ Notice ]:
Undefined property: Orm\Query::$books
if ($user = Model_User::query()->related('books')->where('id', '=', $user_id)->get()) {
$books = $user->books;
}
Fuel\Core\PhpErrorException [ Notice ]:
Trying to get property of non-object
It looks like you're new here. If you want to get involved, click one of these buttons!