mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
32 lines
675 B
PHP
32 lines
675 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST\Boolean;
|
|
|
|
use Alchemy\Phrasea\SearchEngine\Elastic\AST\Node;
|
|
|
|
abstract class BinaryExpression extends Node
|
|
{
|
|
protected $left;
|
|
protected $right;
|
|
protected $operator = 'BIN_OP';
|
|
|
|
public function __construct(Node $left, Node $right)
|
|
{
|
|
$this->left = $left;
|
|
$this->right = $right;
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('(%s %s %s)', $this->left, $this->operator, $this->right);
|
|
}
|
|
|
|
public function getTermNodes()
|
|
{
|
|
return array_merge(
|
|
$this->left->getTermNodes(),
|
|
$this->right->getTermNodes()
|
|
);
|
|
}
|
|
}
|