Skip to content

Commit

Permalink
Merge branch '4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwojs committed Oct 14, 2024
2 parents 0ab4552 + c38215d commit 1d91509
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/bundle/Resources/config/services/query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ services:
Ibexa\Contracts\CoreSearch\Values\Query\CriterionMapper:
arguments:
$mappers: !tagged_iterator ibexa.core_search.criterion_mapper

Ibexa\CoreSearch\CriterionMapper\FieldValueCriterionMapper:
tags:
- { name: ibexa.core_search.criterion_mapper, priority: -100 }

Ibexa\CoreSearch\CriterionMapper\LogicalAndCriterionMapper:
tags:
- { name: ibexa.core_search.criterion_mapper, priority: -100 }

Ibexa\CoreSearch\CriterionMapper\LogicalOrCriterionMapper:
tags:
- { name: ibexa.core_search.criterion_mapper, priority: -100 }
26 changes: 26 additions & 0 deletions src/lib/CriterionMapper/FieldValueCriterionMapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

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

namespace Ibexa\CoreSearch\CriterionMapper;

use Ibexa\Contracts\CoreSearch\Persistence\CriterionMapper\AbstractFieldCriterionMapper;
use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\CriterionInterface;
use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\FieldValueCriterion;

/**
* @template-extends \Ibexa\Contracts\CoreSearch\Persistence\CriterionMapper\AbstractFieldCriterionMapper<
* \Ibexa\Contracts\CoreSearch\Values\Query\Criterion\FieldValueCriterion
* >
*/
final class FieldValueCriterionMapper extends AbstractFieldCriterionMapper
{
public function canHandle(CriterionInterface $criterion): bool
{
return $criterion instanceof FieldValueCriterion;
}
}
26 changes: 26 additions & 0 deletions src/lib/CriterionMapper/LogicalAndCriterionMapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

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

namespace Ibexa\CoreSearch\CriterionMapper;

use Doctrine\Common\Collections\Expr\CompositeExpression;
use Ibexa\Contracts\CoreSearch\Persistence\CriterionMapper\AbstractCompositeCriterionMapper;
use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\LogicalAnd;

final class LogicalAndCriterionMapper extends AbstractCompositeCriterionMapper
{
protected function getHandledClass(): string
{
return LogicalAnd::class;
}

protected function getType(): string
{
return CompositeExpression::TYPE_AND;
}
}
26 changes: 26 additions & 0 deletions src/lib/CriterionMapper/LogicalOrCriterionMapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

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

namespace Ibexa\CoreSearch\CriterionMapper;

use Doctrine\Common\Collections\Expr\CompositeExpression;
use Ibexa\Contracts\CoreSearch\Persistence\CriterionMapper\AbstractCompositeCriterionMapper;
use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\LogicalOr;

final class LogicalOrCriterionMapper extends AbstractCompositeCriterionMapper
{
protected function getHandledClass(): string
{
return LogicalOr::class;
}

protected function getType(): string
{
return CompositeExpression::TYPE_OR;
}
}

0 comments on commit 1d91509

Please sign in to comment.