-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* IsBookmarked criterion added * code moved to code_samples * PHP CS Fixes * REST API examples added * Fixes after review --------- Co-authored-by: julitafalcondusza <julitafalcondusza@users.noreply.github.com>
- Loading branch information
1 parent
8c90153
commit d3ad9cf
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php declare(strict_types=1); | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; | ||
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Location\IsBookmarked; | ||
|
||
$query = new LocationQuery(); | ||
$query->filter = new IsBookmarked(); | ||
/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ | ||
$results = $searchService->findLocations($query); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<Query> | ||
<Filter> | ||
<IsBookmarkedCriterion>true</IsBookmarkedCriterion> | ||
</Filter> | ||
</Query> | ||
``` | ||
|
||
=== "JSON" | ||
|
||
```json | ||
"Query": { | ||
"Filter": { | ||
"IsBookmarkedCriterion": true | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters