class Expression extends BaseExpression

Defines the supported operators for arithmetic expressions.

Learn more: Arithmetic expressions

Methods

__construct($exprUserVariableName)

ExpressionComponent constructor.

__toString()

Serializes to string.

jsonSerialize()

Serializes to JSON.

add()

Add.

subtract()

Subtract.

multiply()

Multiply.

divide()

Divide.

modulo()

Modulo.

equal()

Equals.

notEqual()

Does not equal.

lessThan()

Less than.

greaterThan()

Greater than.

lessThanOrEqual()

Less than or equals.

greaterThanOrEqual()

Greater than or equals.

in()

Is in (a list of strings).

notIn()

Is not in (a list of strings).

and_()

Logical AND operator

or_()

Logical OR operator

expression(string $expression)

Creates an instance of Expression from a raw string.

Details

__construct($exprUserVariableName)

ExpressionComponent constructor.

Parameters

Name Type Description
$exprUserVariableName

string __toString()

Serializes to string.

Return Value

string

mixed jsonSerialize()

Serializes to JSON.

Return Value

mixed

ExpressionOperator add()

Add.

Return Value

ExpressionOperator

ExpressionOperator subtract()

Subtract.

Return Value

ExpressionOperator

ExpressionOperator multiply()

Multiply.

Return Value

ExpressionOperator

ExpressionOperator divide()

Divide.

Return Value

ExpressionOperator

ExpressionOperator modulo()

Modulo.

Return Value

ExpressionOperator

ExpressionOperator equal()

Equals.

Return Value

ExpressionOperator

ExpressionOperator notEqual()

Does not equal.

Return Value

ExpressionOperator

ExpressionOperator lessThan()

Less than.

Return Value

ExpressionOperator

ExpressionOperator greaterThan()

Greater than.

Return Value

ExpressionOperator

ExpressionOperator lessThanOrEqual()

Less than or equals.

Return Value

ExpressionOperator

ExpressionOperator greaterThanOrEqual()

Greater than or equals.

Return Value

ExpressionOperator

ExpressionOperator in()

Is in (a list of strings).

Return Value

ExpressionOperator

ExpressionOperator notIn()

Is not in (a list of strings).

Return Value

ExpressionOperator

ExpressionOperator and_()

Logical AND operator

'&&'

Return Value

ExpressionOperator

ExpressionOperator or_()

Logical OR operator

'||'

Return Value

ExpressionOperator

static Expression expression(string $expression)

Creates an instance of Expression from a raw string.

Parameters

Name Type Description
$expression string Arithmetic expression

Return Value

Expression