Files
Phraseanet/lib/Alchemy/Phrasea/SearchEngine/Elastic/AST/BinaryOperator.php
Mathieu Darse fe7e63b3d7 QuotedTextNode don't inherit anymore from TextNode
- Quoted text do not hit the thesaurus anymore
- getTextNodes() was misleading, renamed to getTermNodes()
2015-02-25 12:22:52 +01:00

30 lines
613 B
PHP

<?php
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
abstract class BinaryOperator 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()
);
}
}