Skip to content

Commit

Permalink
[v5] Moved from Criterion to CriterionInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Dec 11, 2024
1 parent 3c096b1 commit 7e59b8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

namespace App\Query\Criterion\Elasticsearch;

use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface;
use Ibexa\Contracts\Elasticsearch\Query\CriterionVisitor;
use Ibexa\Contracts\Elasticsearch\Query\LanguageFilter;

final class CameraManufacturerVisitor implements CriterionVisitor
{
public function supports(Criterion $criterion, LanguageFilter $languageFilter): bool
public function supports(CriterionInterface $criterion, LanguageFilter $languageFilter): bool
{
return $criterion instanceof CameraManufacturerCriterion;
}

public function visit(CriterionVisitor $dispatcher, Criterion $criterion, LanguageFilter $languageFilter): array
public function visit(CriterionVisitor $dispatcher, CriterionInterface $criterion, LanguageFilter $languageFilter): array
{
return [
'terms' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

namespace App\Query\Criterion\Solr;

use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface;
use Ibexa\Contracts\Solr\Query\CriterionVisitor;

final class CameraManufacturerVisitor extends CriterionVisitor
{
public function canVisit(Criterion $criterion)
public function canVisit(CriterionInterface $criterion)
{
return $criterion instanceof CameraManufacturerCriterion;
}

public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
public function visit(CriterionInterface $criterion, CriterionVisitor $subVisitor = null)
{
$expressions = array_map(
function ($value): string {
Expand Down

0 comments on commit 7e59b8f

Please sign in to comment.