class CustomFunction extends BaseQualifier

Calls a custom function.

Learn more: Custom functions

Methods

wasm(string $source)

Specifies the wasm file to use for the custom function.

remote(string $source)

Specifies the URL of the remote custom function.

fromParams(array $qualifiers, bool $isPre = false)

Creates a new instance from an array of qualifiers.

__construct(string $source, string $type = null, bool $preprocess = false)

CustomFunction constructor.

preprocess(bool $preprocess = true)

Defines the function as the remote preprocessing custom function.

Details

static CustomFunction wasm(string $source)

Specifies the wasm file to use for the custom function.

For more information about WebAssembly functions see the documentation.

Parameters

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

Return Value

CustomFunction

See also

CustomFunction
https://cloudinary.com/documentation/custom_functions#webassembly_functions

static CustomFunction remote(string $source)

Specifies the URL of the remote custom function.

For more information about remote custom functions see the documentation.

Parameters

Name Type Description
$source string The URL of the remote function.

Return Value

CustomFunction

See also

CustomFunction
https://cloudinary.com/documentation/custom_functions#remote_functions

static CustomFunction fromParams(array $qualifiers, bool $isPre = false)

Creates a new instance from an array of qualifiers.

Parameters

Name Type Description
$qualifiers array The qualifiers.
$isPre bool Indicates whether the function is a pre-processing function. Default: false.

Return Value

CustomFunction

See also

CustomFunction

__construct(string $source, string $type = null, bool $preprocess = false)

CustomFunction constructor.

Parameters

Name Type Description
$source string Source of this custom function
$type string The type of custom function (CustomFunction::REMOTE or CustomFunction::WASM).
$preprocess bool Preprocess custom function. Only remote functions are supported for preprocess

See also

CustomFunction::REMOTE
CustomFunction::WASM

CustomFunction preprocess(bool $preprocess = true)

Defines the function as the remote preprocessing custom function.

For more information about preprocessing custom functions see the documentation.

Parameters

Name Type Description
$preprocess bool Whether to defines the function as the remote preprocessing custom function.

Return Value

CustomFunction

See also

CustomFunction
https://cloudinary.com/documentation/custom_functions#preprocessing_custom_functions

Constants

VALUE_CLASS

WASM

WASM.

REMOTE

Remote.