diff --git a/code_samples/search/location/isbookmarked_criterion.php b/code_samples/search/location/isbookmarked_criterion.php new file mode 100644 index 0000000000..c61bf951b1 --- /dev/null +++ b/code_samples/search/location/isbookmarked_criterion.php @@ -0,0 +1,9 @@ +filter = new IsBookmarked(); +/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ +$results = $searchService->findLocations($query); diff --git a/docs/search/criteria_reference/isbookmarked_criterion.md b/docs/search/criteria_reference/isbookmarked_criterion.md new file mode 100644 index 0000000000..049232deca --- /dev/null +++ b/docs/search/criteria_reference/isbookmarked_criterion.md @@ -0,0 +1,45 @@ +--- +description: IsBookmarked Search Criterion +--- + +# IsBookmarked Criterion + +The [`IsBookmarked` Search Criterion](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Criterion-Location-IsBookmarked.html) +searches for location based on whether it's bookmarked or not. +It works with current user reference. + +This Criterion is available only for location Search. + +## Arguments + +- `value` - bool representing whether to search for bookmarked location (default `true`) or not bookmarked location (`false`) + +## Example + +### PHP + +``` php +[[= include_file('code_samples/search/location/isbookmarked_criterion.php', 2) =]] +``` + +### REST API + +=== "XML" + + ```xml + + + true + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "IsBookmarkedCriterion": true + } + } + ``` diff --git a/docs/search/criteria_reference/search_criteria_reference.md b/docs/search/criteria_reference/search_criteria_reference.md index 43326db78e..7d779d3425 100644 --- a/docs/search/criteria_reference/search_criteria_reference.md +++ b/docs/search/criteria_reference/search_criteria_reference.md @@ -42,6 +42,7 @@ Due to this storage limitation, searching content using the Country Field Type o |[ImageMimeType](imagemimetype_criterion.md)|Image type|✔|✔|| |[ImageOrientation](imageorientation_criterion.md)|Image orientation|✔|✔|| |[ImageWidth](imagewidth_criterion.md)|Image width in pixels|✔|✔|| +|[IsBookmarked](isbookmarked_criterion.md)|Whether a location is bookmarked or not| |✔ |✔ | |[IsCurrencyEnabledCriterion](iscurrencyenabled_criterion.md)|Whether a specified currency is enabled in the system| | | | |[IsFieldEmpty](isfieldempty_criterion.md)|Whether a specified Field of a content item is empty or not|✔ |✔ | | |[IsMainLocation](ismainlocation_criterion.md)|Whether a Location is the main Location of a content item| |✔ |✔ | diff --git a/mkdocs.yml b/mkdocs.yml index c3a2ec30df..d86f9f5301 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -503,6 +503,7 @@ nav: - ImageMimeType: search/criteria_reference/imagemimetype_criterion.md - ImageOrientation: search/criteria_reference/imageorientation_criterion.md - ImageWidth: search/criteria_reference/imagewidth_criterion.md + - IsBookmarked: search/criteria_reference/isbookmarked_criterion.md - IsCurrencyEnabled: search/criteria_reference/iscurrencyenabled_criterion.md - IsFieldEmpty: search/criteria_reference/isfieldempty_criterion.md - IsMainLocation: search/criteria_reference/ismainlocation_criterion.md