Pinq\Expressions\Expression::binaryOperation PHP Method

binaryOperation() final public static method

final public static binaryOperation ( Expression $leftOperand, string $operator, Expression $rightOperand ) : BinaryOperationExpression
$leftOperand Expression
$operator string
$rightOperand Expression
return BinaryOperationExpression
    public static final function binaryOperation(Expression $leftOperand, $operator, Expression $rightOperand)
    {
        return new BinaryOperationExpression($leftOperand, $operator, $rightOperand);
    }

Usage Example

コード例 #1
0
 public function testParameterCollectionCanEvaluateAlteredParameterVariableExpressions()
 {
     $this->collection->addExpression(O\Expression::binaryOperation(O\Expression::variable(O\Expression::value('var-foo')), O\Operators\Binary::CONCATENATION, O\Expression::value('--concat')), ParameterHasher::valueType(), new Functions\ElementProjection('', null, null, ['param' => 'var-foo'], [], []));
     $this->assertResolvesTo(['abcde--concat'], ['param' => 'abcde']);
     $this->assertResolvesTo(['1--concat'], ['param' => 1]);
     $this->assertResolvesTo(['--concat'], ['param' => null]);
 }
All Usage Examples Of Pinq\Expressions\Expression::binaryOperation