Skip to content

Commit

Permalink
EZP-31415: Impl. criterion visitor for eZ\Publish\API\Repository\Valu…
Browse files Browse the repository at this point in the history
…es\Content\Query\Criterion\AggregateCriterion
  • Loading branch information
adamwojs committed Feb 27, 2020
1 parent 1d9e300 commit 0fa0578
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/Query/Common/CriterionVisitor/AggregateCriterion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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 EzSystems\EzPlatformSolrSearchEngine\Query\Common\CriterionVisitor;

use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use EzSystems\EzPlatformSolrSearchEngine\Query\CriterionVisitor;

class AggregateCriterion extends CriterionVisitor
{
public function canVisit(Criterion $criterion)
{
return $criterion instanceof Criterion\AggregateCriterion;
}

public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
{
return $subVisitor->visit($criterion->criteria, $subVisitor);
}
}
5 changes: 5 additions & 0 deletions lib/Resources/config/container/solr/criterion_visitors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,8 @@ services:

EzSystems\EzPlatformSolrSearchEngine\Query\Location\CriterionVisitor\Factory\LocationFullTextFactory:
parent: EzSystems\EzPlatformSolrSearchEngine\Query\Common\CriterionVisitor\Factory\FullTextFactoryAbstract

EzSystems\EzPlatformSolrSearchEngine\Query\Common\CriterionVisitor\AggregateCriterion:
tags:
- {name: ezpublish.search.solr.query.content.criterion_visitor}
- {name: ezpublish.search.solr.query.location.criterion_visitor}

0 comments on commit 0fa0578

Please sign in to comment.