mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Move boolean logic in is own namespace
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
|
||||
class AndExpression extends BinaryOperator
|
||||
class AndOperator extends BinaryOperator
|
||||
{
|
||||
protected $operator = 'AND';
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\AST\Node;
|
||||
|
||||
abstract class BinaryOperator extends Node
|
||||
{
|
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
|
||||
class ExceptExpression extends BinaryOperator
|
||||
class ExceptOperator extends BinaryOperator
|
||||
{
|
||||
protected $operator = 'EXCEPT';
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
|
||||
class OrExpression extends BinaryOperator
|
||||
class OrOperator extends BinaryOperator
|
||||
{
|
||||
protected $operator = 'OR';
|
||||
|
@@ -121,21 +121,21 @@ class QueryVisitor implements Visit
|
||||
private function visitAndNode(Element $element)
|
||||
{
|
||||
return $this->handleBinaryOperator($element, function($left, $right) {
|
||||
return new AST\AndExpression($left, $right);
|
||||
return new AST\Boolean\AndOperator($left, $right);
|
||||
});
|
||||
}
|
||||
|
||||
private function visitOrNode(Element $element)
|
||||
{
|
||||
return $this->handleBinaryOperator($element, function($left, $right) {
|
||||
return new AST\OrExpression($left, $right);
|
||||
return new AST\Boolean\OrOperator($left, $right);
|
||||
});
|
||||
}
|
||||
|
||||
private function visitExceptNode(Element $element)
|
||||
{
|
||||
return $this->handleBinaryOperator($element, function($left, $right) {
|
||||
return new AST\ExceptExpression($left, $right);
|
||||
return new AST\Boolean\ExceptOperator($left, $right);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user