Skip to content

Commit f516ebc

Browse files
Apply suggestions from code review
Co-authored-by: Adam Wójs <adam@wojs.pl>
1 parent 31d6c7f commit f516ebc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

code_samples/back_office/search/src/Search/SortingDefinition/Provider/SectionNameSortingDefinitionProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public function getSortingDefinitions(): array
2323
{
2424
return [
2525
new SortingDefinition(
26-
'version_number_asc',
26+
'section_asc',
2727
$this->translator->trans('sort_definition.section_name_asc.label'),
2828
[
2929
new SortClause\SectionName(Query::SORT_ASC),
3030
],
3131
333
3232
),
3333
new SortingDefinition(
34-
'version_number_desc',
34+
'section_desc',
3535
$this->translator->trans('sort_definition.section_name_desc.label'),
3636
[
3737
new SortClause\SectionName(Query::SORT_DESC),
@@ -44,8 +44,8 @@ public function getSortingDefinitions(): array
4444
public static function getTranslationMessages(): array
4545
{
4646
return [
47-
(new Message('sort_definition.section_name_asc.label', 'ibexa_search'))->setDesc('Sort by section A-Z'),
48-
(new Message('sort_definition.section_name_desc.label', 'ibexa_search'))->setDesc('Sort by section Z-A'),
47+
(new Message('sort_definition.section_name_asc.label'))->setDesc('Sort by section A-Z'),
48+
(new Message('sort_definition.section_name_desc.label'))->setDesc('Sort by section Z-A'),
4949
];
5050
}
5151
}

docs/administration/back_office/search_sorting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Add a "sort by" method to the Back Office search result page.
44

55
# Customize search sorting
66

7-
To add an entry to the "Sort by" to the Back Office search result page, create a service implementing the `SortingDefinitionProviderInterface` and tagged `ibexa.search.sorting_definition.provider`.
7+
To add an entry to the "Sort by" to the Back Office search result page, create a service implementing the `Ibexa\Contracts\Search\SortingDefinition\SortingDefintionProviderInterface` and tagged `ibexa.search.sorting_definition.provider`.
88

99
The following example class implements `SortingDefinitionProviderInterface::getSortingDefinitions`, and add two definitions to sort by section name.
1010
A sorting definition is an identifier, a menu label, a list of [Content Search's Sort Clauses](sort_clause_reference.md#sort-clauses), even [custom ones](create_custom_sort_clause.md), and a priority to position it in the menu.

0 commit comments

Comments
 (0)