docs used new with() and load() overloads

This commit is contained in:
silverqx
2023-05-28 08:44:08 +02:00
parent 9a1c3c6b86
commit db84428b5e
2 changed files with 3 additions and 3 deletions

View File

@@ -383,7 +383,7 @@ You can also call all `last` overloads provided by the [`QList::last`](https://d
The `load` method eager loads the given relationships for all models in the collection:
users.load({{"comments"}, {"posts"}});
users.load({"comments", "posts"});
users.load("comments.author");

View File

@@ -978,7 +978,7 @@ select * from authors where id in (1, 2, 3, 4, 5, ...)
Sometimes you may need to eager load several different relationships. To do so, just pass a `QVector<Orm::WithItem>` of relationships to the `with` method:
auto books = Book::with({{"author"}, {"publisher"}})->get();
auto books = Book::with({"author", "publisher"})->get();
#### Nested Eager Loading
@@ -1071,7 +1071,7 @@ Sometimes you may need to eager load a relationship after the parent model has a
You may load more relationships at once, to do so, just pass a `QVector<Orm::WithItem>` of relationships to the `load` method:
Book::find(1)->load({{"author"}, {"publisher"}});
Book::find(1)->load({"author", "publisher"});
:::note
So far, this only works on models, not on containers returned from Model's `get` or `all` methods.