Skip to content

Commit 1660c18

Browse files
committed
browsing_content.md: Use RelationListIteratorAdapter
1 parent 540f4fe commit 1660c18

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

docs/content_management/content_api/browsing_content.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ You can also use it to request other Content-related value objects from various
2929
``` php hl_lines="9"
3030
// ...
3131
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 4, 5) =]]
32-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 16, 17) =]]
32+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 18, 19) =]]
3333
// ...
34-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 50, 52) =]][[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 58, 59) =]]
35-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 60, 66) =]]
34+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 52, 54) =]][[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 60, 61) =]]
35+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 62, 68) =]]
3636
```
3737

3838
`ContentInfo` is loaded from the [`ContentService`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html) (line 9).
@@ -49,7 +49,7 @@ It provides you with basic content metadata such as modification and publication
4949
To get the Locations of a content item you need to make use of the [`LocationService`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LocationService.html):
5050

5151
``` php
52-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 68, 72) =]]
52+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 70, 74) =]]
5353
```
5454

5555
[`LocationService::loadLocations`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LocationService.html#method_loadLocations)
@@ -66,7 +66,7 @@ additionally enables you to retrieve the human-readable [URL alias](url_manageme
6666
gets the Location's main [URL alias](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-URLAlias.html):
6767

6868
``` php
69-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 68, 71) =]][[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 72, 75) =]]
69+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 70, 73) =]][[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 74, 77) =]]
7070
```
7171

7272
### Content type
@@ -75,7 +75,7 @@ You can retrieve the content type of a content item
7575
through the [`getContentType`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-ContentInfo.html#method_getContentType) method of the ContentInfo object:
7676

7777
``` php
78-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 77, 79) =]]
78+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 79, 81) =]]
7979
```
8080

8181
### Versions
@@ -84,14 +84,14 @@ To iterate over the versions of a content item,
8484
use the [`ContentService::loadVersions`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_loadVersions) method, which returns an array of `VersionInfo` value objects.
8585

8686
``` php
87-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 81, 87) =]]
87+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 83, 90) =]]
8888
```
8989

9090
You can additionally provide the `loadVersions` method with the version status
9191
to get only versions of a specific status, e.g.:
9292

9393
``` php
94-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 88, 89) =]]
94+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 90, 91) =]]
9595
```
9696

9797
!!! note
@@ -103,11 +103,12 @@ to get only versions of a specific status, e.g.:
103103

104104
Content Relations are versioned.
105105
To list Relations to and from your content,
106-
you need to pass a `VersionInfo` object to the [`ContentService::loadRelationList`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_loadRelationList) method.
106+
you can to pass a `VersionInfo` object to the [`ContentService::loadRelationList`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_loadRelationList) method which is paginated.
107+
Or you can use the [`RelationListIteratorAdapter`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Iterator-BatchIteratorAdapter-RelationListIteratorAdapter.html) within a [`BatchIterator`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Iterator-BatchIterator.html).
107108
You can get the current version's `VersionInfo` using [`ContentService::loadVersionInfo`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_loadVersionInfo).
108109

109110
``` php
110-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 100, 107) =]]
111+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 102, 113) =]]
111112
```
112113

113114
You can also specify the version number as the second argument to get Relations for a specific version:
@@ -127,7 +128,7 @@ and the optional Field this relation is made with.
127128
You can use the `getOwner` method of the `ContentInfo` object to load the content item's owner as a `User` value object.
128129

129130
``` php
130-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 109, 110) =]]
131+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 115, 116) =]]
131132
```
132133

133134
To get the creator of the current version and not the content item's owner,
@@ -140,7 +141,7 @@ the [`getSection`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-C
140141
of the ContentInfo object:
141142

142143
``` php
143-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 112, 113) =]]
144+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 118, 119) =]]
144145
```
145146

146147
!!! note
@@ -156,7 +157,7 @@ You need to provide it with the Object state group.
156157
All Object state groups can be retrieved through [`loadObjectStateGroups`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ObjectStateService.html#method_loadObjectStateGroups).
157158

158159
``` php
159-
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 115, 120) =]]
160+
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 121, 126) =]]
160161
```
161162

162163
## Viewing content with Fields

0 commit comments

Comments
 (0)