class UVal extends Expression

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.

int(int $value)

The integer value expression component.

float(float $value)

The float value expression component.

numeric(mixed $value)

The numeric value expression component.

string(string $value)

The string value expression component.

stringArray(array $array)

The string array expression component.

assetReference(string $publicId)

The asset reference expression component.

context(string $contextKey)

The context key reference expression component.

metadata(string $metadataKey)

The structured metadata key reference expression component.

uVal(mixed $value)

Named constructor.

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

static Expression int(int $value)

The integer value expression component.

Parameters

Name Type Description
$value int The int value.

Return Value

Expression

static UVal float(float $value)

The float value expression component.

Parameters

Name Type Description
$value float The float value.

Return Value

UVal

static UVal numeric(mixed $value)

The numeric value expression component.

Parameters

Name Type Description
$value mixed The numeric value. Can be used for aspect ratio, for example "16:9", etc.

Return Value

UVal

static UVal string(string $value)

The string value expression component.

Parameters

Name Type Description
$value string The string value

Return Value

UVal

static UVal stringArray(array $array)

The string array expression component.

Parameters

Name Type Description
$array array The array of strings.

Return Value

UVal

static UVal assetReference(string $publicId)

The asset reference expression component.

Parameters

Name Type Description
$publicId string The public ID of the file.

Return Value

UVal

static UVal context(string $contextKey)

The context key reference expression component.

Parameters

Name Type Description
$contextKey string The context key.

Return Value

UVal

static UVal metadata(string $metadataKey)

The structured metadata key reference expression component.

Parameters

Name Type Description
$metadataKey string The structured metadata key.

Return Value

UVal

static UVal uVal(mixed $value)

Named constructor.

Parameters

Name Type Description
$value mixed The value.

Return Value

UVal

Constants

STRING_MARKER

STRING_ARR_DELIM