-
Notifications
You must be signed in to change notification settings - Fork 81
Added doc for TaxonomyNoEntries #3082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.6
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd; | ||
| use Ibexa\Contracts\Taxonomy\Search\Query\Criterion\TaxonomyNoEntries; | ||
|
|
||
| $query = new Query(); | ||
| $query->query = new LogicalAnd( | ||
| [ | ||
|
Check failure on line 12 in code_samples/search/content/taxonomy_no_entries_criterion.php
|
||
| new TaxonomyNoEntries('tags'), | ||
| new ContentTypeIdentifier('article'), | ||
| ] | ||
| ); | ||
|
|
||
| /** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ | ||
| $results = $searchService->findContent($query); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd; | ||
| use Ibexa\Contracts\Taxonomy\Search\Query\Criterion\TaxonomySubtree; | ||
|
|
||
| $query = new Query(); | ||
| $query->query = new LogicalAnd( | ||
| [ | ||
| new TaxonomySubtree(42), | ||
| new ContentTypeIdentifier('article'), | ||
| ] | ||
| ); | ||
|
|
||
| /** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ | ||
| $results = $searchService->findContent($query); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| description: TaxonomyNoEntries Search Criterion | ||
| --- | ||
|
|
||
| # TaxonomyNoEntries Criterion | ||
|
Check notice on line 5 in docs/search/criteria_reference/taxonomy_no_entries.md
|
||
|
|
||
| The [`TaxonomyNoEntries` Search Criterion](https://example.com/api/php_api/php_api_reference/classes/Ibexa-Contracts-Taxonomy-Search-Query-Criterion-TaxonomyNoEntries.html) searches for content that has no entries assigned from the specified [taxonomy](taxonomy.md). | ||
|
|
||
| Use it when you need to find content items to which no taxonomy entries have been assigned (for example, articles without tags). | ||
|
Check notice on line 9 in docs/search/criteria_reference/taxonomy_no_entries.md
|
||
| It is available for all supported search engines and in [repository filtering](search_api.md#repository-filtering) | ||
|
|
||
| ## Arguments | ||
|
|
||
| - `taxonomy` - `string` representing the identifier of the taxonomy (for example, `tags` or `categories`) | ||
|
|
||
| ## Example | ||
|
|
||
| ### PHP | ||
|
|
||
| The following example searches for articles that have no entries assigned in the `tags` taxonomy: | ||
|
|
||
| ```php hl_lines="11-14" | ||
| [[= include_file('code_samples/search/content/taxonomy_no_entries_criterion.php') =]] | ||
| ``` | ||
|
|
||
| The criteria limit the results to content matching all of the conditions listed below: | ||
|
|
||
| - content has no entries assigned in the `tags` taxonomy | ||
| - content type is `article` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| description: TaxonomySubtree Search Criterion | ||
| --- | ||
|
|
||
| # TaxonomySubtree Criterion | ||
|
Check notice on line 5 in docs/search/criteria_reference/taxonomy_subtree.md
|
||
|
|
||
| The [`TaxonomySubtree` Search Criterion](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Taxonomy-Search-Query-Criterion-TaxonomySubtree.html) searches for content assigned to the specified [taxonomy](taxonomy.md) entry or any of its descendants. | ||
|
|
||
| ## Arguments | ||
|
|
||
| - `taxonomyEntryId` - `int` representing the ID of the taxonomy entry that is the root of the subtree | ||
|
|
||
| ## Example | ||
|
|
||
| ### PHP | ||
|
|
||
| The following example searches for articles assigned to taxonomy entry with ID `42` or any of its child entries: | ||
|
|
||
| ```php hl_lines="11-14" | ||
| [[= include_file('code_samples/search/content/taxonomy_subtree_criterion.php') =]] | ||
| ``` | ||
|
|
||
| The criteria limit the results to content matching all of the conditions listed below: | ||
|
|
||
| - content is assigned to taxonomy entry `42` or any of its descendants | ||
|
Check notice on line 25 in docs/search/criteria_reference/taxonomy_subtree.md
|
||
| - content type is `article` | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example.com is a TMP change that must be removed before merge - the criterion is not part of the PHP API reference until it's released