class Conditional extends CommonTransformation

Class Condition

Represents conditional transformation.

Methods

ifCondition(BaseExpressionComponent|string $expression, BaseAction|Transformation $action)

Condition named constructor.

setIfCondition(BaseExpressionComponent|string $expression)

Specifies a condition to be met before applying a transformation.

otherwise(Action|Transformation $action)

Specifies a transformation that is applied in the case that the initial condition is evaluated as false.

toUrl(ImageTransformation|string|null $withTransformation = null)

Serializes transformation to URL.

Details

static Conditional ifCondition(BaseExpressionComponent|string $expression, BaseAction|Transformation $action)

Condition named constructor.

Parameters

Name Type Description
$expression BaseExpressionComponent|string
$action BaseAction|Transformation

Return Value

Conditional

Conditional setIfCondition(BaseExpressionComponent|string $expression)

Specifies a condition to be met before applying a transformation.

Parameters

Name Type Description
$expression BaseExpressionComponent|string The conditional expression

Return Value

Conditional

See also

https://cloudinary.com/documentation/conditional_transformations

Conditional otherwise(Action|Transformation $action)

Specifies a transformation that is applied in the case that the initial condition is evaluated as false.

Parameters

Name Type Description
$action Action|Transformation

Return Value

Conditional

See also

https://cloudinary.com/documentation/conditional_transformations

string toUrl(ImageTransformation|string|null $withTransformation = null)

Serializes transformation to URL.

Parameters

Name Type Description
$withTransformation ImageTransformation|string|null Optional transformation to append.

Return Value

string