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 2020use Pimcore \Bundle \GenericDataIndexBundle \Enum \Permission \PermissionTypes ;
2121use Pimcore \Bundle \GenericDataIndexBundle \Enum \Permission \UserPermissionTypes ;
2222use Pimcore \Bundle \GenericDataIndexBundle \Exception \AssetSearchException ;
23+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \AssetSearchInterface ;
2324use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResult ;
2425use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResultItem ;
25- use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Interfaces \SearchInterface ;
2626use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Modifier \Filter \Basic \IdFilter ;
2727use Pimcore \Bundle \GenericDataIndexBundle \Permission \Workspace \AssetWorkspace ;
2828use Pimcore \Bundle \GenericDataIndexBundle \SearchIndexAdapter \Search \Pagination \PaginationInfoServiceInterface ;
@@ -49,7 +49,7 @@ public function __construct(
4949 * @throws AssetSearchException
5050 */
5151 public function search (
52- SearchInterface $ assetSearch ,
52+ AssetSearchInterface $ assetSearch ,
5353 PermissionTypes $ permissionType = PermissionTypes::LIST
5454 ): AssetSearchResult {
5555 $ assetSearch = $ this ->searchHelper ->addSearchRestrictions (
Original file line number Diff line number Diff line change 1818
1919use Pimcore \Bundle \GenericDataIndexBundle \Enum \Permission \PermissionTypes ;
2020use Pimcore \Bundle \GenericDataIndexBundle \Exception \AssetSearchException ;
21+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \AssetSearchInterface ;
2122use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResult ;
2223use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Asset \SearchResult \AssetSearchResultItem ;
23- use Pimcore \ Bundle \ GenericDataIndexBundle \ Model \ Search \ Interfaces \ SearchInterface ;
24+
2425use Pimcore \Model \User ;
2526
2627interface AssetSearchServiceInterface
@@ -29,7 +30,7 @@ interface AssetSearchServiceInterface
2930 * @throws AssetSearchException
3031 */
3132 public function search (
32- SearchInterface $ assetSearch ,
33+ AssetSearchInterface $ assetSearch ,
3334 PermissionTypes $ permissionType = PermissionTypes::LIST
3435 ): AssetSearchResult ;
3536
Original file line number Diff line number Diff line change 2020use Pimcore \Bundle \GenericDataIndexBundle \Enum \Permission \PermissionTypes ;
2121use Pimcore \Bundle \GenericDataIndexBundle \Enum \Permission \UserPermissionTypes ;
2222use Pimcore \Bundle \GenericDataIndexBundle \Exception \DocumentSearchException ;
23+ use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Document \DocumentSearchInterface ;
2324use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Document \SearchResult \DocumentSearchResult ;
2425use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Document \SearchResult \DocumentSearchResultItem ;
25- use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Interfaces \SearchInterface ;
2626use Pimcore \Bundle \GenericDataIndexBundle \Model \Search \Modifier \Filter \Basic \IdFilter ;
2727use Pimcore \Bundle \GenericDataIndexBundle \Permission \Workspace \DocumentWorkspace ;
2828use Pimcore \Bundle \GenericDataIndexBundle \SearchIndexAdapter \Search \Pagination \PaginationInfoServiceInterface ;
@@ -49,7 +49,7 @@ public function __construct(
4949 * @throws DocumentSearchException
5050 */
5151 public function search (
52- SearchInterface $ documentSearch ,
52+ DocumentSearchInterface $ documentSearch ,
5353 PermissionTypes $ permissionType = PermissionTypes::LIST
5454 ): DocumentSearchResult {
5555 $ documentSearch = $ this ->searchHelper ->addSearchRestrictions (
You can’t perform that action at this time.
0 commit comments