Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

EZP-31415: Impl. criterion visitor for CompositeCriterion #170

Merged
merged 4 commits into from
Mar 12, 2020
Merged
Changes from 1 commit
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
Next Next commit
EZP-31415: Impl. criterion visitor for eZ\Publish\API\Repository\Valu…
…es\Content\Query\Criterion\AggregateCriterion
  • Loading branch information
adamwojs committed Feb 27, 2020
commit 0fa0578a7c78f41e336837ee2703e54ce8e66370
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
@@ -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}