Skip to content

Commit

Permalink
docs used /qt/ in URLs instead of /qt-6/
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Apr 21, 2024
1 parent aa98dd4 commit b83b824
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions docs/tinyorm/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ keywords: [c++ orm, orm, collections, collection, model, tinyorm]

The `Orm::Tiny::Types::ModelsCollection` is specialized container which provides a fluent, convenient wrapper for working with vector of models. All TinyORM methods that return more than one model result, will return instances of the `ModelsCollection` class, including results retrieved via the `get` method or methods that return relationships like the `getRelation` and `getRelationValue`.

The `ModelsCollection` class extends `QVector<Model>`, so it naturally inherits dozens of methods used to work with the underlying vector of TinyORM models. Be sure to review the [`QList`](https://doc.qt.io/qt-6/qlist.html) documentation to learn all about these helpful methods!
The `ModelsCollection` class extends `QVector<Model>`, so it naturally inherits dozens of methods used to work with the underlying vector of TinyORM models. Be sure to review the [`QList`](https://doc.qt.io/qt/qlist.html) documentation to learn all about these helpful methods!

:::info
The `ModelsCollection` template parameter can be declared only with the model type or a model type pointer, it also can't be `const` and can't be a reference. It's constrained using the `DerivedCollectionModel` concept.
Expand Down Expand Up @@ -328,7 +328,7 @@ If no model passes a given truth test then the value of the second `defaultModel
{"votes", NullVariant::ULongLong()}}
*/

You can also call all `first` overloads provided by the [`QList::first`](https://doc.qt.io/qt-6/qlist.html#first).
You can also call all `first` overloads provided by the [`QList::first`](https://doc.qt.io/qt/qlist.html#first).

#### `firstWhere()` {#method-first-where}

Expand Down Expand Up @@ -434,7 +434,7 @@ If no model passes a given truth test then the value of the second `defaultModel
{"votes", NullVariant::ULongLong()}}
*/

You can also call all `last` overloads provided by the [`QList::last`](https://doc.qt.io/qt-6/qlist.html#last).
You can also call all `last` overloads provided by the [`QList::last`](https://doc.qt.io/qt/qlist.html#last).

#### `load()` {#method-load}

Expand Down Expand Up @@ -820,21 +820,21 @@ The [`toBase`](#method-tobase) is an alias to the `all` method.

#### `toJson()` {#method-tojson}

The `toJson` method converts the collection of models with all nested relations into a JSON serialized [`QByteArray`](https://doc.qt.io/qt-6/qbytearray.html).
The `toJson` method converts the collection of models with all nested relations into a JSON serialized [`QByteArray`](https://doc.qt.io/qt/qbytearray.html).

It returns an empty array for empty `many` type relations and `null` for empty `one` type relations.

:::info
The `toJson` method accepts the [`QJsonDocument::JsonFormat`](https://doc.qt.io/qt-6/qjsondocument.html#JsonFormat-enum), possible values are `QJsonDocument::Indented` or `QJsonDocument::Compact`.
The `toJson` method accepts the [`QJsonDocument::JsonFormat`](https://doc.qt.io/qt/qjsondocument.html#JsonFormat-enum), possible values are `QJsonDocument::Indented` or `QJsonDocument::Compact`.
:::

#### `toJsonArray()` {#method-tojsonarray}

The `toJsonArray` method converts the collection of models with all nested relations into a [`QJsonArray`](https://doc.qt.io/qt-6/qjsonarray.html).
The `toJsonArray` method converts the collection of models with all nested relations into a [`QJsonArray`](https://doc.qt.io/qt/qjsonarray.html).

#### `toJsonDocument()` {#method-tojsondocument}

The `toJsonDocument` method converts the collection of models with all nested relations into a [`QJsonDocument`](https://doc.qt.io/qt-6/qjsondocument.html).
The `toJsonDocument` method converts the collection of models with all nested relations into a [`QJsonDocument`](https://doc.qt.io/qt/qjsondocument.html).

#### `toMap()` {#method-tomap}

Expand Down Expand Up @@ -1012,7 +1012,7 @@ The `value` method also accepts the second `defaultValue` argument, which will b

// 0

You can also call all `value` overloads provided by the [`QList::value`](https://doc.qt.io/qt-6/qlist.html#value).
You can also call all `value` overloads provided by the [`QList::value`](https://doc.qt.io/qt/qlist.html#value).

#### `where()` {#method-where}

Expand Down
4 changes: 2 additions & 2 deletions docs/tinyorm/serialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You may also convert entire [collections](tinyorm/collections.mdx) of models to

### Serializing To JSON

To convert a model to JSON, you should use the `toJson` method. Like `toVector` or `toMap`, the `toJson` method is recursive, so all attributes and relations will be converted to JSON. You may also specify any JSON encoding options that are supported by [QJsonDocument::toJson](https://doc.qt.io/qt-6/qjsondocument.html#toJson):
To convert a model to JSON, you should use the `toJson` method. Like `toVector` or `toMap`, the `toJson` method is recursive, so all attributes and relations will be converted to JSON. You may also specify any JSON encoding options that are supported by [QJsonDocument::toJson](https://doc.qt.io/qt/qjsondocument.html#toJson):

using Models::User;

Expand All @@ -68,7 +68,7 @@ You may also convert entire [collections](tinyorm/collections.mdx) of models to

return users.toJson();

You can also convert models to the [`QJsonObject`](https://doc.qt.io/qt-6/qjsonobject.html) and [`QJsonDocument`](https://doc.qt.io/qt-6/qjsondocument.html) using the `toJsonArray` and `toJsonDocument` methods and collection of models to [`QJsonArray`](https://doc.qt.io/qt-6/qjsonarray.html) and [`QJsonDocument`](https://doc.qt.io/qt-6/qjsondocument.html) using the [`toJsonArray`](tinyorm/collections.mdx#method-tojsonarray) and [`toJsonDocument`](tinyorm/collections.mdx#method-tojsondocument) methods.
You can also convert models to the [`QJsonObject`](https://doc.qt.io/qt/qjsonobject.html) and [`QJsonDocument`](https://doc.qt.io/qt/qjsondocument.html) using the `toJsonArray` and `toJsonDocument` methods and collection of models to [`QJsonArray`](https://doc.qt.io/qt/qjsonarray.html) and [`QJsonDocument`](https://doc.qt.io/qt/qjsondocument.html) using the [`toJsonArray`](tinyorm/collections.mdx#method-tojsonarray) and [`toJsonDocument`](tinyorm/collections.mdx#method-tojsondocument) methods.

#### Relationships

Expand Down

0 comments on commit b83b824

Please sign in to comment.