Variable
class Variable extends GenericQualifier
Defines methods for using variables.
Learn more: User defined variables
Methods
Defines a new user variable with the given value.
Defines a new user variable with the given asset public id.
Defines a new user variable with the given context key.
Defines a new user variable with the given structured metadata key.
Indicates Cloudinary to treat the value as float.
Indicates Cloudinary to treat the value as integer.
Sets the variable name as the qualifier key.
Sets ((re)initializes) the qualifier value.
Returns the variable name.
Determines whether the candidate is a valid variable name.
Serializes to json.
Details
static Variable
set(string $name, mixed $value)
Defines a new user variable with the given value.
static Variable
setAssetReference(string $name, mixed $publicId)
Defines a new user variable with the given asset public id.
static Variable
setFromContext(string $name, mixed $contextKey)
Defines a new user variable with the given context key.
static Variable
setFromMetadata(string $name, mixed $metadataKey)
Defines a new user variable with the given structured metadata key.
$this
asFloat(bool $asFloat = true)
Indicates Cloudinary to treat the value as float.
$this
asInteger(bool $asInteger = true)
Indicates Cloudinary to treat the value as integer.
Variable
setKey(string $name)
Sets the variable name as the qualifier key.
Variable
setQualifierValue(...$value)
Sets ((re)initializes) the qualifier value.
string
getVariableName()
Returns the variable name.
static bool
isVariable(string $candidate)
Determines whether the candidate is a valid variable name.
mixed
jsonSerialize()
Serializes to json.
Constants
VALUE_CLASS |
|
AS_FLOAT |
|
AS_INTEGER |
|