Skip to content

Commit e2b73ef

Browse files
committed
Adjusted lines
1 parent d21ffbe commit e2b73ef

File tree

6 files changed

+31
-30
lines changed

6 files changed

+31
-30
lines changed

docs/ai_actions/extend_ai_actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Create a class implementing the [ActionHandlerInterface](/api/php_api/php_api_re
116116

117117
See the code sample below, together with a matching service definition:
118118

119-
``` php hl_lines="17 23-26 28-63 65-68"
119+
``` php hl_lines="17 25-27 30-65 67-70"
120120
[[= include_file('code_samples/ai_actions/src/AI/Handler/LLaVaTextToTextActionHandler.php') =]]
121121
```
122122

docs/commerce/checkout/checkout_api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ From the developer's perspective, checkouts are referenced with an UUID identifi
2222
To access a single checkout, use the `CheckoutServiceInterface::getCheckout` method:
2323

2424
``` php
25-
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 26, 27) =]]
25+
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 28, 29) =]]
2626
```
2727

2828
## Get single checkout for specific cart
@@ -31,15 +31,15 @@ To fetch checkout for a cart that already exists, use the `CheckoutServiceInterf
3131
You can use it when you want to initiate the checkout process right after products are successfully added to a cart.
3232

3333
``` php
34-
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 20, 24) =]]
34+
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 22, 26) =]]
3535
```
3636

3737
## Create checkout
3838

3939
To create a checkout, use the `CheckoutServiceInterface::createCheckout` method and provide it with a `CheckoutCreateStruct` struct that contains a `CartInterface` object.
4040

4141
``` php
42-
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 29, 35) =]]
42+
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 31, 37) =]]
4343
```
4444

4545
## Update checkout
@@ -53,13 +53,13 @@ To update the checkout, use the `CheckoutServiceInterface::updateCheckout` metho
5353
All data is placed in session storage.
5454

5555
``` php
56-
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 37, 39) =]]
56+
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 39, 41) =]]
5757
```
5858

5959
## Delete checkout
6060

6161
To delete a checkout from the session, use the `CheckoutServiceInterface::deleteCheckout` method:
6262

6363
``` php
64-
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 41, 42) =]]
64+
[[= include_file('code_samples/api/commerce/src/Controller/CustomCheckoutController.php', 43, 44) =]]
6565
```

docs/content_management/content_api/managing_content.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Creating a new location, like creating content, requires using a struct, because
2222
To add a new location to existing content you need to create a [`LocationCreateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-LocationCreateStruct.html) and pass it to the [`LocationService::createLocation`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LocationService.html#method_createLocation) method:
2323

2424
``` php
25-
[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 42, 43) =]]
26-
[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 47, 49) =]]
25+
[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 46, 47) =]]
26+
[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 51, 53) =]]
2727
```
2828

2929
`LocationCreateStruct` must receive the parent location ID.
@@ -32,7 +32,7 @@ It sets the `parentLocationId` property of the new location.
3232
You can also provide other properties for the location, otherwise they're set to their defaults:
3333

3434
``` php
35-
[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 44, 46) =]]
35+
[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 48, 50) =]]
3636
```
3737

3838
### Changing the main location
@@ -41,15 +41,16 @@ When a content item has more that one location, one location is always considere
4141
You can change the main location using [`ContentService`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html), by updating the `ContentInfo` with a [`ContentUpdateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-ContentUpdateStruct.html) that sets the new main location:
4242

4343
``` php
44-
[[= include_file('code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php', 43, 47) =]]
44+
[[= include_file('code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php', 46, 51) =]]
4545
```
4646

4747
### Hiding and revealing locations
4848

4949
To hide or reveal (unhide) a location you need to make use of [`LocationService::hideLocation`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LocationService.html#method_hideLocation) or [`LocationService::unhideLocation`:](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LocationService.html#method_unhideLocation)
5050

5151
``` php
52-
[[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 41, 42) =]][[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 44, 45) =]]
52+
[[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 44, 45) =]]
53+
[[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 47, 48) =]]
5354
```
5455

5556
See [location visibility](locations.md#location-visibility) for detailed information on the behavior of visible and hidden Locations.
@@ -66,22 +67,22 @@ Content which has more locations is still available in its other locations.
6667
If you delete the [main location](#changing-the-main-location) of a content item that has more locations, another location becomes the main one.
6768

6869
``` php
69-
[[= include_file('code_samples/api/public_php_api/src/Command/DeleteContentCommand.php', 39, 40) =]]
70+
[[= include_file('code_samples/api/public_php_api/src/Command/DeleteContentCommand.php', 40, 43) =]]
7071
```
7172

7273
To send the location and its subtree to Trash, use [`TrashService::trash`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-TrashService.html#method_trash).
7374
Items in Trash can be later [restored, or deleted permanently](#trash).
7475

7576
``` php
76-
[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 46, 47) =]]
77+
[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 50, 51) =]]
7778
```
7879

7980
### Moving and copying a subtree
8081

8182
You can move a location with its whole subtree using [`LocationService::moveSubtree`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LocationService.html#method_moveSubtree):
8283

8384
``` php
84-
[[= include_file('code_samples/api/public_php_api/src/Command/MoveContentCommand.php', 41, 44) =]]
85+
[[= include_file('code_samples/api/public_php_api/src/Command/MoveContentCommand.php', 44, 47) =]]
8586
```
8687

8788
[`LocationService::copySubtree`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LocationService.html#method_copySubtree) is used in the same way, but it copies the location and its subtree instead of moving it.
@@ -108,7 +109,7 @@ You must provide the method with the ID of the object in Trash.
108109
Trash location is identical to the origin location of the object.
109110

110111
``` php
111-
[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 56, 57) =]]
112+
[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 60, 61) =]]
112113
```
113114

114115
The content item is restored under its previous location.
@@ -138,30 +139,30 @@ In this case you use [`ContentTypeCreateStruct`](/api/php_api/php_api_reference/
138139
A content type must have at least one name, in the main language, and at least one field definition.
139140

140141
``` php
141-
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 54, 64) =]][[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 71, 80) =]]
142+
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 56, 66) =]][[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 73, 82) =]]
142143

143144
```
144145

145146
You can specify more details of the field definition in the create struct, for example:
146147

147148
``` php
148-
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 62, 72) =]]
149+
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 64, 74) =]]
149150
```
150151

151152
### Copying content types
152153

153154
To copy a content type, use [`ContentTypeService::copyContentType`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentTypeService.html#method_copyContentType):
154155

155156
``` php
156-
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 83, 85) =]]
157+
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 85, 88) =]]
157158
```
158159

159160
The copy is automatically getting an identifier based on the original content type identifier and the copy's ID, for example: `copy_of_folder_21`.
160161

161162
To change the identifier of the copy, use a [`ContentTypeUpdateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-ContentType-ContentTypeUpdateStruct.html):
162163

163164
``` php
164-
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 85, 91) =]]
165+
[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php', 87, 93) =]]
165166
```
166167

167168
## Calendar events
@@ -178,19 +179,19 @@ To get a list of events for a specified time period, use the `CalendarServiceInt
178179
You need to provide the method with an EventQuery, which takes a date range and a count as the minimum of parameters:
179180

180181
``` php
181-
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 34, 45) =]]
182+
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 37, 48) =]]
182183
```
183184

184185
You can also get the first and last event in the list by using the `first()` and `last()` methods of an `EventCollection` (`Ibexa\Contracts\Calendar\EventCollection`):
185186

186187
``` php
187-
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 46, 48) =]]
188+
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 49, 51) =]]
188189
```
189190

190191
You can process the events in a collection using the `find(Closure $predicate)`, `filter(Closure $predicate)`, `map(Closure $callback)` or `slice(int $offset, ?int $length = null)` methods of `EventCollection`, for example:
191192

192193
``` php
193-
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 49, 53) =]]
194+
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 52, 56) =]]
194195
```
195196

196197
### Performing calendar actions
@@ -200,5 +201,5 @@ You must pass an `Ibexa\Contracts\Calendar\EventAction\EventActionContext` insta
200201
`EventActionContext` defines events on which the action is performed, and action-specific parameters, for example, a new date:
201202

202203
``` php
203-
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 54, 58) =]]
204+
[[= include_file('code_samples/api/public_php_api/src/Command/CalendarCommand.php', 57, 61) =]]
204205
```

docs/multisite/languages/language_api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can manage languages configured in the system with PHP API by using [`Langua
1111
To get a list of all languages in the system use [`LanguageService::loadLanguages`:](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LanguageService.html#method_loadLanguage)
1212

1313
``` php
14-
[[= include_file('code_samples/api/public_php_api/src/Command/AddLanguageCommand.php', 27, 33) =]]
14+
[[= include_file('code_samples/api/public_php_api/src/Command/AddLanguageCommand.php', 31, 37) =]]
1515
```
1616

1717
## Creating a language
@@ -20,5 +20,5 @@ To create a new language, you need to create a [`LanguageCreateStruct`](/api/php
2020
Then, use [`LanguageService::createLanguage`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-LanguageService.html#method_createLanguage) and pass the `LanguageCreateStruct` to it:
2121

2222
``` php
23-
[[= include_file('code_samples/api/public_php_api/src/Command/AddLanguageCommand.php', 34, 38) =]]
23+
[[= include_file('code_samples/api/public_php_api/src/Command/AddLanguageCommand.php', 38, 42) =]]
2424
```

docs/pim/price_api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ To access a currency object by its code, use `CurrencyServiceInterface::getCurre
1212
To access a whole list of currencies, use `CurrencyServiceInterface::findCurrencies`.
1313

1414
``` php
15-
[[= include_file('code_samples/api/product_catalog/src/Command/CurrencyCommand.php', 42, 50) =]]
15+
[[= include_file('code_samples/api/product_catalog/src/Command/CurrencyCommand.php', 45, 53) =]]
1616
```
1717

1818
To create a new currency, use `CurrencyServiceInterface::createCurrency()` and provide it with a `CurrencyCreateStruct` with code, number of fractional digits and a flag indicating if the currency is enabled:
1919

2020
``` php
21-
[[= include_file('code_samples/api/product_catalog/src/Command/CurrencyCommand.php', 57, 60) =]]
21+
[[= include_file('code_samples/api/product_catalog/src/Command/CurrencyCommand.php', 60, 63) =]]
2222
```
2323

2424
## Prices

docs/pim/product_api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Provide the method with the product type object and the main language code.
4747
You also need to set (at least) the code for the product and the required Field of the underlying content type, `name`:
4848

4949
``` php
50-
[[= include_file('code_samples/api/product_catalog/src/Command/ProductCommand.php', 71, 76) =]]
50+
[[= include_file('code_samples/api/product_catalog/src/Command/ProductCommand.php', 69, 76) =]]
5151
```
5252

5353
To delete a product, use `LocalProductServiceInterface::deleteProduct()`:
@@ -108,13 +108,13 @@ To work with product types, use [`ProductTypeServiceInterface`](/api/php_api/php
108108
Get a product type object by using `ProductTypeServiceInterface::getProductType()`:
109109

110110
``` php
111-
[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 38, 39) =]]
111+
[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 41, 42) =]]
112112
```
113113

114114
You can also get a list of product types with `ProductTypeServiceInterface::findProductTypes()`:
115115

116116
``` php
117-
[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 42, 47) =]]
117+
[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 45, 50) =]]
118118
```
119119

120120
## Product availability

0 commit comments

Comments
 (0)