File tree Expand file tree Collapse file tree 15 files changed +118
-23
lines changed
Service/Search/SearchService Expand file tree Collapse file tree 15 files changed +118
-23
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,24 @@ Following steps are necessary during updating to newer versions.
66- Execute the following command to reindex all elements to be able to use all new features:
77
88 ``` bin/console generic-data-index:update:index ```
9+
10+ ## Upgrade to 2.0.0
11+
12+ ### BC-Breaks
13+
14+ #### Interface changes
15+ - Added ` PermissionTypes $permissionType ` parameter with default type ` PermissionTypes::LIST ` to
16+ - ` AssetSearchServiceInterface::search ` method
17+ - ` DocumentSearchServiceInterface::search ` method
18+ - ` DataObjectSearchServiceInterface::search ` method
19+ - ` ElementSearchServiceInterface::search ` method
20+ - Search services ` byId ` methods now return elements based on the ` PermissionTypes::VIEW ` permission
21+ - Added type specific interfaces for searches to avoid mixing up different search types in search services
22+ - ` AssetSearch ` now implements ` AssetSearchInterface `
23+ - ` DocumentSearch ` now implements ` DocumentSearchInterface `
24+ - ` ElementSearch ` now implements ` ElementSearchInterface `
25+ - Search services now require the specific search type for the search
26+ - ` AssetSearchServiceInterface::search ` now requires a ` AssetSearchInterface `
27+ - ` DocumentSearchServiceInterface::search ` now requires a ` DocumentSearchInterface `
28+ - ` ElementSearchServiceInterface::search ` now requires a ` ElementSearchInterface `
29+ - ` SearchProviderInterface ` now returns type specific search interfaces
Original file line number Diff line number Diff line change 1818
1919use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \BaseSearch ;
2020
21- final class AssetSearch extends BaseSearch
21+ final class AssetSearch extends BaseSearch implements AssetSearchInterface
2222{
2323}
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ /**
5+ * Pimcore
6+ *
7+ * This source file is available under two different licenses:
8+ * - GNU General Public License version 3 (GPLv3)
9+ * - Pimcore Commercial License (PCL)
10+ * Full copyright and license information is available in
11+ * LICENSE.md which is distributed with this source code.
12+ *
13+ * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+ * @license http://www.pimcore.org/license GPLv3 and PCL
15+ */
16+
17+ namespace Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset ;
18+
19+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Interfaces \SearchInterface ;
20+
21+ interface AssetSearchInterface extends SearchInterface
22+ {
23+ }
Original file line number Diff line number Diff line change 1818
1919use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \BaseSearch ;
2020
21- final class DocumentSearch extends BaseSearch
21+ final class DocumentSearch extends BaseSearch implements DocumentSearchInterface
2222{
2323}
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ /**
5+ * Pimcore
6+ *
7+ * This source file is available under two different licenses:
8+ * - GNU General Public License version 3 (GPLv3)
9+ * - Pimcore Commercial License (PCL)
10+ * Full copyright and license information is available in
11+ * LICENSE.md which is distributed with this source code.
12+ *
13+ * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+ * @license http://www.pimcore.org/license GPLv3 and PCL
15+ */
16+
17+ namespace Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Document ;
18+
19+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Interfaces \SearchInterface ;
20+
21+ interface DocumentSearchInterface extends SearchInterface
22+ {
23+ }
Original file line number Diff line number Diff line change 1818
1919use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \BaseSearch ;
2020
21- final class ElementSearch extends BaseSearch
21+ final class ElementSearch extends BaseSearch implements ElementSearchInterface
2222{
2323}
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ /**
5+ * Pimcore
6+ *
7+ * This source file is available under two different licenses:
8+ * - GNU General Public License version 3 (GPLv3)
9+ * - Pimcore Commercial License (PCL)
10+ * Full copyright and license information is available in
11+ * LICENSE.md which is distributed with this source code.
12+ *
13+ * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+ * @license http://www.pimcore.org/license GPLv3 and PCL
15+ */
16+
17+ namespace Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Element ;
18+
19+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Interfaces \SearchInterface ;
20+
21+ interface ElementSearchInterface extends SearchInterface
22+ {
23+ }
Original file line number Diff line number Diff line change 1919use Exception ;
2020use Pimcore \Bundle \GenericDataIndexBundle \Enum \Permission \UserPermissionTypes ;
2121use Pimcore \Bundle \GenericDataIndexBundle \Exception \AssetSearchException ;
22+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \AssetSearchInterface ;
2223use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResult ;
2324use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResultItem ;
24- use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Interfaces \SearchInterface ;
2525use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Modifier \Filter \Basic \IdFilter ;
2626use Pimcore \Bundle \GenericDataIndexBundle \Permission \Workspace \AssetWorkspace ;
2727use Pimcore \Bundle \GenericDataIndexBundle \SearchIndexAdapter \Search \Pagination \PaginationInfoServiceInterface ;
@@ -47,7 +47,7 @@ public function __construct(
4747 /**
4848 * @throws AssetSearchException
4949 */
50- public function search (SearchInterface $ assetSearch ): AssetSearchResult
50+ public function search (AssetSearchInterface $ assetSearch ): AssetSearchResult
5151 {
5252 $ assetSearch = $ this ->searchHelper ->addSearchRestrictions (
5353 search: $ assetSearch ,
Original file line number Diff line number Diff line change 1717namespace Pimcore \Bundle \GenericDataIndexBundle \Service \Search \SearchService \Asset ;
1818
1919use Pimcore \Bundle \GenericDataIndexBundle \Exception \AssetSearchException ;
20+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \AssetSearchInterface ;
2021use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResult ;
2122use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResultItem ;
22- use Pimcore \ Bundle \ GenericDataIndexBundle \ Model \ Search \ Interfaces \ SearchInterface ;
23+
2324use Pimcore \Model \User ;
2425
2526interface AssetSearchServiceInterface
2627{
2728 /**
2829 * @throws AssetSearchException
2930 */
30- public function search (SearchInterface $ assetSearch ): AssetSearchResult ;
31+ public function search (AssetSearchInterface $ assetSearch ): AssetSearchResult ;
3132
3233 /**
3334 * @throws AssetSearchException
Original file line number Diff line number Diff line change 1919use Exception ;
2020use Pimcore \Bundle \GenericDataIndexBundle \Enum \Permission \UserPermissionTypes ;
2121use Pimcore \Bundle \GenericDataIndexBundle \Exception \DocumentSearchException ;
22+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Document \DocumentSearchInterface ;
2223use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Document \SearchResult \DocumentSearchResult ;
2324use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Document \SearchResult \DocumentSearchResultItem ;
24- use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Interfaces \SearchInterface ;
2525use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Modifier \Filter \Basic \IdFilter ;
2626use Pimcore \Bundle \GenericDataIndexBundle \Permission \Workspace \DocumentWorkspace ;
2727use Pimcore \Bundle \GenericDataIndexBundle \SearchIndexAdapter \Search \Pagination \PaginationInfoServiceInterface ;
@@ -47,7 +47,7 @@ public function __construct(
4747 /**
4848 * @throws DocumentSearchException
4949 */
50- public function search (SearchInterface $ documentSearch ): DocumentSearchResult
50+ public function search (DocumentSearchInterface $ documentSearch ): DocumentSearchResult
5151 {
5252 $ documentSearch = $ this ->searchHelper ->addSearchRestrictions (
5353 search: $ documentSearch ,
You can’t perform that action at this time.
0 commit comments