class AssetTransformation implements ComponentInterface

Class AssetTransformation

A.K.A EagerTransformation

Methods

__construct(Transformation|array $transformation = null, string $extension = null)

AssetTransformation constructor.

extension(string $extension)

Sets the file extension.

fromString(string $string)

Creates a new asset from the provided string (URL).

fromJson(string|array $json)

Creates a new asset from the provided JSON.

fromParams(array $params)

Creates a new asset transformation from the provided array of parameters.

importString(string $string)

Imports data from the provided string (URL).

importJson(string|array $json)

Imports data from the provided JSON.

addTransformation(CommonTransformation $transformation)

Adds (appends) a transformation.

addAction(BaseAction|BaseQualifier|mixed $action)

Adds (chains) a transformation action.

__toString()

Serializes to string.

jsonSerialize($includeEmptyKeys = false)

No description

Details

__construct(Transformation|array $transformation = null, string $extension = null)

AssetTransformation constructor.

Parameters

Name Type Description
$transformation Transformation|array The asset transformation.
$extension string The file extension.

$this extension(string $extension)

Sets the file extension.

Parameters

Name Type Description
$extension string The file extension.

Return Value

$this

static mixed fromString(string $string)

Creates a new asset from the provided string (URL).

Parameters

Name Type Description
$string string The asset string (URL).

Return Value

mixed

static mixed fromJson(string|array $json)

Creates a new asset from the provided JSON.

Parameters

Name Type Description
$json string|array The asset json. Can be an array or a JSON string.

Return Value

mixed

static AssetTransformation fromParams(array $params)

Creates a new asset transformation from the provided array of parameters.

Parameters

Name Type Description
$params array The asset transformation parameters.

Return Value

AssetTransformation

mixed importString(string $string)

Imports data from the provided string (URL).

Parameters

Name Type Description
$string string The asset string (URL).

Return Value

mixed

mixed importJson(string|array $json)

Imports data from the provided JSON.

Parameters

Name Type Description
$json string|array The asset json. Can be an array or a JSON string.

Return Value

mixed

AssetTransformation addTransformation(CommonTransformation $transformation)

Adds (appends) a transformation.

Appended transformation is nested.

Parameters

Name Type Description
$transformation CommonTransformation The transformation to add.

Return Value

AssetTransformation

AssetTransformation addAction(BaseAction|BaseQualifier|mixed $action)

Adds (chains) a transformation action.

Parameters

Name Type Description
$action BaseAction|BaseQualifier|mixed The transformation action to add. If BaseQualifier is provided, it is wrapped with action.

Return Value

AssetTransformation

string __toString()

Serializes to string.

Return Value

string

jsonSerialize($includeEmptyKeys = false)

Parameters

Name Type Description
$includeEmptyKeys

Constants

DELIMITER