Skip to content

Commit c5a8131

Browse files
committed
More fixes
1 parent a1809a7 commit c5a8131

8 files changed

Lines changed: 62 additions & 69 deletions

File tree

docs/ai_actions/extend_ai_actions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For example, you can create a handler that connects to a translation model and u
1414
You can execute AI Actions by using the [ActionServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionServiceInterface.html) service, as in the following example:
1515

1616
``` php
17-
[[= include_file('code_samples/ai_actions/src/Command/AddMissingAltTextCommand.php', 104, 131) =]]
17+
[[= include_file('code_samples/ai_actions/src/Command/AddMissingAltTextCommand.php', 86, 105) =]]
1818
```
1919

2020
The `GenerateAltTextAction` is a built-in action that implements the [ActionInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionInterface.html), takes an [Image](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-Action-DataType-Image.html) as an input, and generates the alternative text in the response.
@@ -43,7 +43,7 @@ You can influence the execution of an Action with two events:
4343
Below you can find the full example of a Symfony Command, together with a matching service definition.
4444
The command finds the images modified in the last 24 hours, and adds the alternative text to them if it's missing.
4545

46-
``` php hl_lines="91 104-129"
46+
``` php hl_lines="72 85-110"
4747
[[= include_file('code_samples/ai_actions/src/Command/AddMissingAltTextCommand.php') =]]
4848
```
4949

@@ -77,7 +77,7 @@ See [Action Configuration Search Criteria reference](action_configuration_criter
7777
The following example creates a new Action Configuration:
7878

7979
``` php hl_lines="3 17"
80-
[[= include_file('code_samples/ai_actions/src/Command/ActionConfigurationCreateCommand.php', 62, 79) =]]
80+
[[= include_file('code_samples/ai_actions/src/Command/ActionConfigurationCreateCommand.php', 46, 63) =]]
8181
```
8282

8383
Actions Configurations are tied to a specific Action Type and are translatable.
@@ -88,7 +88,7 @@ Reuse existing Action Configurations to simplify the execution of AI Actions.
8888
You can pass one directly to the `ActionServiceInterface::execute()` method:
8989

9090
``` php hl_lines="7-8"
91-
[[= include_file('code_samples/ai_actions/src/Command/ActionConfigurationCreateCommand.php', 80, 88) =]]
91+
[[= include_file('code_samples/ai_actions/src/Command/ActionConfigurationCreateCommand.php', 64, 72) =]]
9292
```
9393

9494
The passed Action Configuration is only taken into account if the Action Context was not passed to the Action directly using the [ActionInterface::setActionContext()](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionInterface.html#method_hasActionContext) method.
@@ -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="21 29-32 34-69 71-74"
119+
``` php hl_lines="17 23-26 28-63 65-68"
120120
[[= include_file('code_samples/ai_actions/src/AI/Handler/LLaVaTextToTextActionHandler.php') =]]
121121
```
122122

@@ -233,7 +233,7 @@ An example Action Handler combines the input data and the Action Type options an
233233
The language of the transcribed data is extracted from the Runtime Context for better results.
234234
The Action Type options provided in the Action Context dictate whether the timestamps will be removed before returning the result.
235235

236-
``` php hl_lines="34-37 52-55"
236+
``` php hl_lines="66-68 52-55"
237237
[[= include_file('code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php') =]]
238238
```
239239

docs/commerce/cart/cart_api.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ From the developer's perspective, carts and entries are referenced with a UUID i
2323
To access a single cart, use the `CartServiceInterface::getCart` method:
2424

2525
``` php
26-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 88, 91) =]]
26+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 63, 66) =]]
2727
```
2828

2929
## Get multiple carts
@@ -35,7 +35,7 @@ It follows the same search Query pattern as other APIs:
3535
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 10, 11) =]]
3636
// ...
3737

38-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 74, 83) =]]
38+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 49, 57) =]]
3939
```
4040

4141
## Create cart
@@ -46,7 +46,7 @@ To create a cart, use the `CartServiceInterface::createCart` method and provide
4646
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 8, 9) =]]
4747
// ...
4848

49-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 95, 104) =]]
49+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 70, 78) =]]
5050
```
5151

5252
## Update cart metadata
@@ -59,7 +59,7 @@ To update cart metadata, use the `CartServiceInterface::updateCartMetadata` meth
5959
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 9, 10) =]]
6060
// ...
6161

62-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 107, 114) =]]
62+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 82, 89) =]]
6363
```
6464

6565
You can also use this method to change cart ownership:
@@ -80,17 +80,17 @@ $cart = $cartService->updateCartMetadata($cart, $updateMetadataStruct);
8080
To delete a cart permanently, use the `CartServiceInterface::deleteCart` method and pass the `CartInterface` object:
8181

8282
``` php
83-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 88, 89) =]]
84-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 149, 150) =]]
83+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 63, 64) =]]
84+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 124, 125) =]]
8585
```
8686

8787
## Empty cart
8888

8989
To remove all products from the cart in a single operation, use the `CartServiceInterface::emptyCart` method:
9090

9191
``` php
92-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 88, 89) =]]
93-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 116, 117) =]]
92+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 63, 64) =]]
93+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 91, 92) =]]
9494
```
9595

9696
## Check cart validity
@@ -101,8 +101,8 @@ To validate the cart, use the `CartServiceInterface::validateCart` method.
101101
Validation is done with help from the `symfony/validator` component, and the method returns a `Symfony\Component\Validator\ConstraintViolationListInterface` object.
102102

103103
``` php
104-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 88, 89) =]]
105-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 119, 120) =]]
104+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 63, 64) =]]
105+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 94, 95) =]]
106106
```
107107

108108
## Add entry to cart
@@ -114,20 +114,17 @@ Then pass it to the `CartServiceInterface::addEntry` method:
114114
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 11, 12) =]]
115115
// ...
116116

117-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 88, 89) =]]
118-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 124, 131) =]]
117+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 63, 64) =]]
118+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 99, 106) =]]
119119
```
120120

121121
## Remove entry from cart
122122

123123
To remove an entry from the cart, use the `CartServiceInterface::removeEntry` method.
124124

125125
``` php
126-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 11, 12) =]]
127-
// ...
128-
129-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 88, 89) =]]
130-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 134, 137) =]]
126+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 63, 64) =]]
127+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 109, 112) =]]
131128
```
132129

133130
## Update entry metadata
@@ -139,9 +136,9 @@ To change entry metadata, use the `CartServiceInterface::updateEntry` method and
139136
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 12, 13) =]]
140137
// ...
141138

142-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 88, 89) =]]
143-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 129, 130) =]]
144-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 139, 147) =]]
139+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 63, 64) =]]
140+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 109, 110) =]]
141+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 114, 122) =]]
145142
```
146143

147144
## Adding context data
@@ -188,5 +185,5 @@ To combine the contents of multiple shopping carts into a target cart, use the `
188185
This operation is helpful when you want to consolidate items from a reorder cart and a current cart into a single order.
189186

190187
```php
191-
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 151, 164) =]]
188+
[[= include_file('code_samples/api/commerce/src/Command/CartCommand.php', 126, 139) =]]
192189
```

docs/commerce/order_management/order_management_api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ To get orders and manage them, use the [`Ibexa\Contracts\OrderManagement\OrderSe
1919
To access a single order by using its string identifier, use the [`OrderServiceInterface::getOrderByIdentifier`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_getOrderByIdentifier) method:
2020

2121
``` php
22-
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 61, 65) =]]
22+
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 51, 55) =]]
2323
```
2424

2525
### Get single order by ID
2626

2727
To access a single order by using its numerical ID, use the [`OrderServiceInterface::getOrder`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_getOrder) method:
2828

2929
``` php
30-
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 67, 72) =]]
30+
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 57, 61) =]]
3131
```
3232

3333
## Get multiple orders
@@ -39,15 +39,15 @@ It follows the same search query pattern as other APIs:
3939
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 8, 9) =]][[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 10, 14) =]]
4040

4141
// ...
42-
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 120, 130) =]]
42+
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 110, 119) =]]
4343
```
4444

4545
## Create order
4646

4747
To create an order, use the [`OrderServiceInterface::createOrder`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_createOrder) method and provide it with the [`Ibexa\Contracts\OrderManagement\Value\Struct\OrderCreateStruct`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-Value-Struct-OrderCreateStruct.html) object that contains a list of products, purchased quantities, product, total prices, and tax amounts.
4848

4949
``` php
50-
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 101, 113) =]]
50+
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 91, 102) =]]
5151
```
5252

5353
## Update order
@@ -57,5 +57,5 @@ You could do it to support a scenario when, for example, the order is processed
5757
To update order information, use the [`OrderServiceInterface::updateOrder`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-OrderManagement-OrderServiceInterface.html#method_updateOrder) method:
5858

5959
``` php
60-
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 114, 119) =]]
60+
[[= include_file('code_samples/api/commerce/src/Command/OrderCommand.php', 104, 108) =]]
6161
```

docs/commerce/payment/extend_payment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ When you create a payment, you can attach custom data to it, for example, you ca
9494
You add custom data by using the `setContext` method:
9595

9696
``` php
97-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 97, 109) =]]
97+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 80, 91) =]]
9898
```
9999

100100
Then, you retrieve it with the `getContext` method:
101101

102102
``` php
103-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 70, 74) =]]
103+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 54, 58) =]]
104104
```

docs/commerce/payment/payment_api.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ You can change that by providing a custom payment identifier in `Ibexa\Contracts
1717
To access a single payment by using its numerical ID, use the `PaymentServiceInterface::getPayment` method:
1818

1919
``` php
20-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 64, 68) =]]
20+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 48, 52) =]]
2121
```
2222

2323
### Get single payment by identifier
2424

2525
To access a single payment by using its string identifier, use the `PaymentServiceInterface::getPaymentByIdentifier` method:
2626

2727
``` php
28-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 70, 72) =]]
28+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 54, 56) =]]
2929
```
3030

3131
## Get multiple payments
@@ -34,16 +34,15 @@ To fetch multiple payments, use the `PaymentServiceInterface::findPayments` meth
3434
It follows the same search query pattern as other APIs:
3535

3636
``` php
37-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 79, 95) =]]
37+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 63, 79) =]]
3838
```
3939

4040
## Create payment
4141

4242
To create a payment, use the `PaymentServiceInterface::createPayment` method and provide it with the `Ibexa\Contracts\Payment\Payment\PaymentCreateStruct` object that takes the following arguments: `method`, `order` and `amount`.
4343

4444
``` php
45-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 101, 105) =]]
46-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 108, 112) =]]
45+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 81, 95) =]]
4746
```
4847

4948
## Update payment
@@ -54,13 +53,13 @@ The `Ibexa\Contracts\Payment\Payment\PaymentUpdateStruct` object takes the follo
5453
To update payment information, use the `PaymentServiceInterface::updatePayment` method:
5554

5655
``` php
57-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 113, 119) =]]
56+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 97, 103) =]]
5857
```
5958

6059
## Delete payment
6160

6261
To delete a payment from the system, use the `PaymentServiceInterface::deletePayment` method:
6362

6463
``` php
65-
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 121, 122) =]]
64+
[[= include_file('code_samples/api/commerce/src/Command/PaymentCommand.php', 105, 106) =]]
6665
```

docs/commerce/payment/payment_method_api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ From the developer's perspective, payment methods are referenced with identifier
2626
To access a single payment method by using its string identifier, use the `PaymentMethodService::getPaymentMethodByIdentifier` method:
2727

2828
``` php
29-
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 56, 60) =]]
29+
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 46, 50) =]]
3030
```
3131

3232
### Get single payment method by ID
3333

3434
To access a single payment method by using its numerical ID, use the `PaymentMethodService::getPaymentMethod` method:
3535

3636
``` php
37-
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 50, 54) =]]
37+
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 40, 44) =]]
3838
```
3939

4040
## Get multiple payment methods
@@ -44,7 +44,7 @@ To fetch multiple payment methods, use the `PaymentMethodService::findPaymentMet
4444
It follows the same search query pattern as other APIs:
4545

4646
``` php
47-
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 62, 79) =]]
47+
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 52, 69) =]]
4848
```
4949

5050
## Create payment method
@@ -59,7 +59,7 @@ To create a payment method, use the `PaymentMethodService::createPaymentMethod`
5959
- `options` object.
6060

6161
``` php
62-
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 62, 63) =]][[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 81, 91) =]]
62+
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 52, 53) =]][[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 71, 81) =]]
6363
```
6464

6565
## Update payment method
@@ -70,20 +70,20 @@ An `Ibexa\Contracts\Payment\PaymentMethod\PaymentMethodUpdateStruct` object can
7070
To update payment method information, use the `PaymentMethodServiceInterface::updatePaymentMethod` method:
7171

7272
``` php
73-
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 93, 103) =]]
73+
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 83, 93) =]]
7474
```
7575

7676
## Delete payment method
7777

7878
To delete a payment method from the system, use the `PaymentMethodService::deletePayment` method:
7979
``` php
80-
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 105, 111) =]]
80+
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 95, 101) =]]
8181
```
8282

8383
## Check whether payment method is used
8484

8585
To check whether a payment method is used, for example, before you delete it, use the `PaymentMethodService::isPaymentMethodUsed` method:
8686

8787
``` php
88-
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 113, 126) =]]
88+
[[= include_file('code_samples/api/commerce/src/Command/PaymentMethodCommand.php', 103, 116) =]]
8989
```

0 commit comments

Comments
 (0)