Skip to content
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

EZP-31741: Fixed features detection in eZ\Publish\Core\Repository\SearchService::supports #113

Merged
merged 2 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eZ/Bundle/EzPublishCoreBundle/Resources/config/papi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
alias: ezpublish.spi.search_engine.indexer

ezpublish.spi.search_engine:
class: eZ\Publish\SPI\Search\Handler
class: eZ\Publish\SPI\Search\VersatileHandler
factory: ["@ezpublish.api.search_engine.factory", buildSearchEngine]
public: false
lazy: true
Expand Down
12 changes: 11 additions & 1 deletion eZ/Publish/Core/Search/Legacy/Content/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use eZ\Publish\SPI\Persistence\Content;
use eZ\Publish\SPI\Persistence\Content\Location;
use eZ\Publish\SPI\Search\Handler as SearchHandlerInterface;
use eZ\Publish\SPI\Search\VersatileHandler as SearchHandlerInterface;
use eZ\Publish\Core\Persistence\Legacy\Content\Mapper as ContentMapper;
use eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper as LocationMapper;
use eZ\Publish\Core\Search\Legacy\Content\Location\Gateway as LocationGateway;
Expand Down Expand Up @@ -367,6 +367,11 @@ public function deleteContent($contentId, $versionId = null)
$this->indexerGateway->remove($contentId, $versionId);
}

public function deleteTranslation(int $contentId, string $languageCode): void
{
// Not needed with Legacy Storage/Search Engine
}

/**
* Deletes a location from the index.
*
Expand Down Expand Up @@ -395,4 +400,9 @@ public function commit($flush = false)
{
// Not needed with Legacy Storage/Search Engine
}

public function supports(int $capabilityFlag): bool
{
return false;
}
}
19 changes: 19 additions & 0 deletions eZ/Publish/SPI/Search/VersatileHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace eZ\Publish\SPI\Search;

/**
* @internal for internal use by Symfony DI configuration. Inject Handler and use instance of for
* specific features instead.
*
* Note that in the next major VersatileHandler will be merged into Handler interface.
*/
interface VersatileHandler extends Handler, Capable, ContentTranslationHandler
{
}