@@ -34,6 +34,15 @@ The following command takes the content type identifier as an argument and lists
3434[[= include_file('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 32, 48) =]]
3535[[= include_file('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 48, 49) =]]
3636```
37+ ``` php hl_lines="14 16"
38+ // ...
39+ [[= include_code('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 5, 7) =]]
40+ // ...
41+ [[= include_code('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 18, 19) =]]
42+ // ...
43+ [[= include_code('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 33, 48) =]]
44+ [[= include_code('code_samples/api/public_php_api/src/Command/FindContentCommand.php', 49, 49) =]]
45+ ```
3746
3847[ ` SearchService::findContentInfo ` ] ( /api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SearchService.html#method_findContentInfo ) (line 16)
3948retrieves [ ` ContentInfo ` ] ( /api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Persistence-Content-ContentInfo.html ) objects of the found content items.
@@ -124,6 +133,14 @@ For example, the following command lists all content items under the specified p
124133// ...
125134[[= include_file('code_samples/api/public_php_api/src/Command/FilterCommand.php', 19, 21) =]][[= include_file('code_samples/api/public_php_api/src/Command/FilterCommand.php', 33, 53) =]]
126135```
136+ ``` php hl_lines="15-18"
137+ // ...
138+ [[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 5, 9) =]]
139+
140+ // ...
141+ [[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 20, 21) =]]
142+ [[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 34, 53) =]]
143+ ```
127144
128145The same Filter can be applied to find locations instead of content items, for example:
129146
@@ -133,6 +150,14 @@ The same Filter can be applied to find locations instead of content items, for e
133150[[= include_file('code_samples/api/public_php_api/src/Command/FilterCommand.php', 19, 21) =]]// ...
134151[[= include_file('code_samples/api/public_php_api/src/Command/FilterLocationCommand.php', 33, 53) =]]
135152```
153+ ``` php hl_lines="20"
154+ // ...
155+ [[= include_code('code_samples/api/public_php_api/src/Command/FilterLocationCommand.php', 5, 9) =]]
156+
157+ [[= include_code('code_samples/api/public_php_api/src/Command/FilterCommand.php', 20, 21) =]]
158+ // ...
159+ [[= include_code('code_samples/api/public_php_api/src/Command/FilterLocationCommand.php', 34, 53) =]]
160+ ```
136161
137162!!! caution
138163
@@ -186,6 +211,12 @@ For example, in the code below, `locationId` is provided to list all children of
186211[[= include_file('code_samples/api/public_php_api/src/Controller/CustomController.php', 4, 12) =]] // ...
187212[[= include_file('code_samples/api/public_php_api/src/Controller/CustomController.php', 16, 32) =]]
188213```
214+ ``` php hl_lines="22-24"
215+ // ...
216+ [[= include_code('code_samples/api/public_php_api/src/Controller/CustomController.php', 5, 12) =]]
217+ // ...
218+ [[= include_code('code_samples/api/public_php_api/src/Controller/CustomController.php', 17, 32) =]]
219+ ```
189220
190221The rendering of results is then relegated to [ templates] ( templates.md ) (lines 22-24).
191222
@@ -196,6 +227,12 @@ When using Repository filtering, provide the results of `ContentService::find()`
196227[[= include_file('code_samples/api/public_php_api/src/Controller/CustomFilterController.php', 4, 12) =]] // ...
197228[[= include_file('code_samples/api/public_php_api/src/Controller/CustomFilterController.php', 16, 31) =]]
198229```
230+ ``` php hl_lines="19"
231+ // ...
232+ [[= include_code('code_samples/api/public_php_api/src/Controller/CustomFilterController.php', 5, 12) =]]
233+ // ...
234+ [[= include_code('code_samples/api/public_php_api/src/Controller/CustomFilterController.php', 17, 31) =]]
235+ ```
199236
200237### Paginate search results
201238
@@ -206,12 +243,21 @@ To paginate search or filtering results, it's recommended to use the [Pagerfanta
206243[[= include_file('code_samples/api/public_php_api/src/Controller/PaginationController.php', 8, 15) =]] // ...
207244[[= include_file('code_samples/api/public_php_api/src/Controller/PaginationController.php', 19, 39) =]]
208245```
246+ ``` php
247+ // ...
248+ [[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 9, 15) =]]
249+ // ...
250+ [[= include_code('code_samples/api/public_php_api/src/Controller/PaginationController.php', 20, 39) =]]
251+ ```
209252
210253Pagination can then be rendered for example using the following template:
211254
212255``` html+twig
213256[[= include_file('code_samples/api/public_php_api/templates/themes/standard/full/custom_pagination.html.twig') =]]
214257```
258+ ``` html+twig
259+ [[= include_code('code_samples/api/public_php_api/templates/themes/standard/full/custom_pagination.html.twig') =]]
260+ ```
215261
216262For more information and examples, see [ PagerFanta documentation] ( https://www.babdev.com/open-source/packages/pagerfanta/docs/2.x/usage ) .
217263
@@ -244,6 +290,12 @@ You can do it using logical operators: `LogicalAnd`, `LogicalOr`, and `LogicalNo
244290[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 44, 49) =]][[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 53, 54) =]]
245291[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 60, 65) =]]
246292
293+ ```
294+ ``` php
295+ [[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 45, 49) =]]
296+ [[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 54, 54) =]]
297+
298+ [[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 61, 65) =]]
247299```
248300
249301This example takes three parameters from a command — ` $text ` , ` $contentTypeId ` , and ` $locationId ` .
@@ -259,6 +311,9 @@ that doesn't belong to the provided Section:
259311``` php
260312[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 46, 54) =]]
261313```
314+ ``` php
315+ [[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 47, 54) =]]
316+ ```
262317
263318### Combine independent Criteria
264319
@@ -292,6 +347,9 @@ For example, to order search results by their publication date, from oldest to n
292347``` php
293348[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 55, 59) =]]
294349```
350+ ``` php
351+ [[= include_code('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 56, 59) =]]
352+ ```
295353
296354!!! tip
297355
@@ -310,6 +368,9 @@ To do this, you use of the query's `$aggregations` property:
310368``` php
311369[[= include_file('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 30, 35) =]]
312370```
371+ ``` php
372+ [[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 31, 35) =]]
373+ ```
313374
314375The name of the aggregation must be unique in the given query.
315376
@@ -318,12 +379,18 @@ Access the results by using the `get()` method of the aggregation:
318379``` php
319380[[= include_file('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 39, 40) =]]
320381```
382+ ``` php
383+ [[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 40, 40) =]]
384+ ```
321385
322386Aggregation results contain the name of the result and the count of found items:
323387
324388``` php
325389[[= include_file('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 42, 45) =]]
326390```
391+ ``` php
392+ [[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 43, 45) =]]
393+ ```
327394
328395With field aggregations you can group search results according to the value of a specific field.
329396In this case the aggregation takes the content type identifier and the field identifier as parameters.
@@ -333,13 +400,19 @@ The following example creates an aggregation named `selection` that groups resul
333400``` php
334401[[= include_file('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 35, 36) =]]
335402```
403+ ``` php
404+ [[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 36, 36) =]]
405+ ```
336406
337407With term aggregation you can define additional limits to the results.
338408The following example limits the number of terms returned to 5 and only considers terms that have 10 or more results:
339409
340410``` php
341411[[= include_file('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 30, 33) =]]
342412```
413+ ``` php
414+ [[= include_code('code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php', 31, 33) =]]
415+ ```
343416
344417To use a range aggregation, you must provide a ` ranges ` array containing a set of ` Range ` objects that define the borders of the specific range sets.
345418
@@ -396,6 +469,9 @@ This example shows a minimal embedding query executed directly through the searc
396469``` php hl_lines="38-39 41-47 49"
397470[[= include_file('code_samples/api/public_php_api/src/Command/FindByTaxonomyEmbeddingCommand.php') =]]
398471```
472+ ``` php hl_lines="38-39 41-47 49"
473+ [[= include_code('code_samples/api/public_php_api/src/Command/FindByTaxonomyEmbeddingCommand.php') =]]
474+ ```
399475
400476For more information, see [ Embeddings reference] ( embeddings_reference.md ) .
401477
@@ -414,6 +490,11 @@ For a list of supported Criteria and Sort Clauses, see [Search in trash referenc
414490[[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 4, 6) =]]//...
415491[[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 35, 42) =]]
416492```
493+ ``` php
494+ [[= include_code('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 5, 6) =]]
495+ //...
496+ [[= include_code('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 36, 42) =]]
497+ ```
417498
418499!!! caution
419500
0 commit comments