From cb59d5259c0578efa4d7f07c1cf320fb20845c0a Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Fri, 22 Dec 2023 10:34:14 +0100 Subject: [PATCH] Fix line numbers (#2256) * browsing_content.md: Fix line numbers * creating_content.md: Fix line numbers * search_api.md: Fix line numbers --- .../content_management/content_api/browsing_content.md | 10 +++++----- .../content_management/content_api/creating_content.md | 6 +++--- docs/search/search_api.md | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/content_management/content_api/browsing_content.md b/docs/content_management/content_api/browsing_content.md index b7cc2d1f10..6e32047edd 100644 --- a/docs/content_management/content_api/browsing_content.md +++ b/docs/content_management/content_api/browsing_content.md @@ -168,10 +168,10 @@ To retrieve the Fields of the selected Content item, you can use the following c } ``` -Line 16 shows how [`ContentService::loadContent`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentService.php#L147) loads the Content item provided to the command. -Line 17 makes use of the [`ContentTypeService`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentTypeService.php) to retrieve the Content Type of the requested item. +Line 9 shows how [`ContentService::loadContent`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentService.php#L147) loads the Content item provided to the command. +Line 14 makes use of the [`ContentTypeService`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentTypeService.php) to retrieve the Content Type of the requested item. -Lines 19-24 iterate over Fields defined by the Content Type. +Lines 12-19 iterate over Fields defined by the Content Type. For each Field they print out its identifier, and then using [`FieldTypeService`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/FieldTypeService.php) retrieve the Field's value and print it out to the console. ## Viewing content in different languages @@ -199,9 +199,9 @@ you need to use the [`LocationService`](https://github.com/ibexa/core/blob/main/ [[= include_file('code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php', 30, 49) =]] ``` -`loadLocation` (line 14) returns a value object, here a `Location`. +`loadLocation` (line 15) returns a value object, here a `Location`. -[`LocationService::loadLocationChildren`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/LocationService.php#L106) (line 23) +[`LocationService::loadLocationChildren`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/LocationService.php#L106) (line 5) returns a [`LocationList`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/LocationList.php) value object that you can iterate over. !!! note diff --git a/docs/content_management/content_api/creating_content.md b/docs/content_management/content_api/creating_content.md index eb922291ce..ad23374ea1 100644 --- a/docs/content_management/content_api/creating_content.md +++ b/docs/content_management/content_api/creating_content.md @@ -24,14 +24,14 @@ returns a new [`ContentCreateStruct`](https://github.com/ibexa/core/blob/main/sr [[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 57, 66) =]] ``` -This command creates a draft using [`ContentService::createContent`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentService.php#L210) (line 21). +This command creates a draft using [`ContentService::createContent`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentService.php#L210) (line 7). This method must receive a `ContentCreateStruct` and an array of Location structs. -`ContentCreateStruct` (which extends `ContentStruct`) is created through [`ContentService::newContentCreateStruct`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentService.php#L533) (line 17), +`ContentCreateStruct` (which extends `ContentStruct`) is created through [`ContentService::newContentCreateStruct`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/ContentService.php#L533) (line 2), which receives the Content Type and the primary language for the Content item. For information about translating a Content item into other languages, see [Translating content](#translating-content). -[`ContentStruct::setField`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/ContentStruct.php#L32) (line 18) enables you to define the Field values. +[`ContentStruct::setField`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/ContentStruct.php#L32) (line 3) enables you to define the Field values. When the Field accepts a simple value, you can provide it directly, as in the example above. For some Field Types, for example [images](#creating-an-image), you need to provide an instance of a Value type. diff --git a/docs/search/search_api.md b/docs/search/search_api.md index f32e2cc44f..fc2e6b07d7 100644 --- a/docs/search/search_api.md +++ b/docs/search/search_api.md @@ -196,7 +196,7 @@ For example, in the code below, `locationId` is provided to list all children of [[= include_file('code_samples/api/public_php_api/src/Controller/CustomController.php', 18, 34) =]] ``` -The rendering of results is then relegated to [templates](templates.md) (lines 20-22). +The rendering of results is then relegated to [templates](templates.md) (lines 21-23). When using Repository filtering, provide the results of `ContentService::find()` as parameters to the view: @@ -250,15 +250,15 @@ For more complex searches, you need to combine multiple Criteria. You can do it using logical operators: `LogicalAnd`, `LogicalOr`, and `LogicalNot`. ``` php -[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 43, 49) =]][[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 52, 53) =]] -[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 59, 64) =]] +[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 43, 49) =]][[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 53, 54) =]] +[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 60, 65) =]] ``` This example takes three parameters from a command — `$text`, `$contentTypeId`, and `$locationId`. It then combines them using `Criterion\LogicalAnd` to search for Content items -that belong to a specific subtree, have the chosen Content Type and contain the provided text (lines 6-8). +that belong to a specific subtree, have the chosen Content Type and contain the provided text (lines 3-6). -This also shows that you can get the total number of search results using the `totalCount` property of search results (line 11). +This also shows that you can get the total number of search results using the `totalCount` property of search results (line 9). You can also nest different operators to construct more complex queries. The example below uses the `LogicalNot` operator to search for all content containing a given phrase